Skip to content

Commit 51a1410

Browse files
azabaznoigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: fb5308f
Bale-in IntToPtr and PtrToInt operands
1 parent 5548944 commit 51a1410

File tree

3 files changed

+2
-38
lines changed

3 files changed

+2
-38
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXBaling.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ static cl::opt<bool> BaleSelect("bale-select", cl::init(true), cl::Hidden,
7878
static cl::opt<bool> BaleFNeg("bale-fneg", cl::init(true), cl::Hidden,
7979
cl::desc("Bale fneg"));
8080

81-
static cl::opt<bool> BaleIntToPtr("bale-inttoptr", cl::init(true), cl::Hidden,
82-
cl::desc("Bale inttoptr"));
83-
84-
static cl::opt<bool> BalePtrToInt("bale-ptrtoint", cl::init(true), cl::Hidden,
85-
cl::desc("Bale ptrtoint"));
86-
8781
//----------------------------------------------------------------------
8882
// Administrivia for GenXFuncBaling pass
8983
//
@@ -373,16 +367,6 @@ static int checkModifier(Instruction *Inst)
373367
return BaleInfo::SEXT;
374368
}
375369
break;
376-
case Instruction::IntToPtr: {
377-
LLVM_DEBUG(llvm::dbgs()
378-
<< "Instruction " << *Inst << " detected as INTTOPTR\n");
379-
return BaleInfo::INTTOPTR;
380-
} break;
381-
case Instruction::PtrToInt: {
382-
LLVM_DEBUG(llvm::dbgs()
383-
<< "Instruction " << *Inst << " detected as PTRTOINT\n");
384-
return BaleInfo::PTRTOINT;
385-
} break;
386370
default:
387371
switch (GenXIntrinsic::getGenXIntrinsicID(Inst)) {
388372
case GenXIntrinsic::genx_absi:
@@ -449,12 +433,6 @@ bool GenXBaling::operandCanBeBaled(
449433
break;
450434
}
451435
}
452-
453-
// Always bale in IntToPtr and PtrToInt operands
454-
if (Opnd->getOpcode() == Instruction::IntToPtr ||
455-
Opnd->getOpcode() == Instruction::PtrToInt)
456-
return true;
457-
458436
if (GenXIntrinsic::isRdRegion(Opnd)) {
459437
// The operand is a rdregion. Check any restrictions.
460438
// (Note we call isRegionOKForIntrinsic even when Inst is not an
@@ -1338,10 +1316,6 @@ static bool acceptableMainInst(Instruction *Inst) {
13381316
if (Inst->getOpcode() == Instruction::FNeg)
13391317
return BaleFNeg;
13401318
#endif
1341-
if (Inst->getOpcode() == Instruction::IntToPtr)
1342-
return BaleIntToPtr;
1343-
if (Inst->getOpcode() == Instruction::PtrToInt)
1344-
return BalePtrToInt;
13451319
return false;
13461320
}
13471321

@@ -2699,8 +2673,6 @@ const char *BaleInfo::getTypeString() const
26992673
case BaleInfo::GSTORE: return "g_store";
27002674
case BaleInfo::SHUFFLEPRED: return "shufflepred";
27012675
case BaleInfo::FADDR: return "faddr";
2702-
case BaleInfo::INTTOPTR: return "inttoptr";
2703-
case BaleInfo::PTRTOINT: return "ptrtoint";
27042676
default: return "???";
27052677
}
27062678
}

IGC/VectorCompiler/lib/GenXCodeGen/GenXBaling.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ struct BaleInfo {
257257
// rdregion, wrregion, modifier, or main instruction.
258258
enum { MAININST, WRREGION, SATURATE, NOTMOD, NEGMOD, ABSMOD,
259259
RDREGION, ADDRADD, ADDROR, FADDR, RDPREDREGION, ALLANY, NOTP, ZEXT, SEXT,
260-
SHUFFLEPRED, WRPREDREGION, WRPREDPREDREGION, CMPDST, GSTORE, REGINTR, INTTOPTR, PTRTOINT};
261-
260+
SHUFFLEPRED, WRPREDREGION, WRPREDPREDREGION, CMPDST, GSTORE, REGINTR };
262261
uint16_t Type;
263262
uint16_t Bits; // bitmap of which operands are baled in
264263
BaleInfo(int Type = MAININST, unsigned Bits = 0) : Type(Type), Bits(Bits) {}

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,8 +1465,7 @@ bool GenXKernelBuilder::buildInstruction(Instruction *Inst) {
14651465
Inst = cast<Instruction>(Inst->getOperand(0));
14661466
BI = Baling->getBaleInfo(Inst);
14671467
}
1468-
if (BI.Type == BaleInfo::REGINTR || BI.Type == BaleInfo::INTTOPTR ||
1469-
BI.Type == BaleInfo::PTRTOINT)
1468+
if (BI.Type == BaleInfo::REGINTR)
14701469
return false;
14711470
if (BI.Type == BaleInfo::WRREGION || BI.Type == BaleInfo::WRPREDREGION ||
14721471
BI.Type == BaleInfo::WRPREDPREDREGION) {
@@ -2175,12 +2174,6 @@ VISA_VectorOpnd *GenXKernelBuilder::createSource(Value *V, Signedness Signed,
21752174
case BaleInfo::SEXT:
21762175
Signed = SIGNED;
21772176
break;
2178-
case BaleInfo::INTTOPTR:
2179-
Signed = UNSIGNED;
2180-
break;
2181-
case BaleInfo::PTRTOINT:
2182-
Signed = SIGNED;
2183-
break;
21842177
default:
21852178
IGC_ASSERT_EXIT_MESSAGE(0, "unknown bale type");
21862179
break;

0 commit comments

Comments
 (0)