Skip to content

Commit 6dc6c9b

Browse files
fveselovigcbot
authored andcommitted
Remove genx_faddr intrinsic handlers from IGC
Remove dead code related to genx_faddr intrinsic as it is not generated since 2021
1 parent 807d188 commit 6dc6c9b

File tree

8 files changed

+2
-121
lines changed

8 files changed

+2
-121
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXBaling.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ void GenXBaling::processInst(Instruction *Inst)
213213
processWrPredPredRegion(Inst);
214214
else if (IntrinID == GenXIntrinsic::genx_sat || GenXIntrinsic::isIntegerSat(IntrinID))
215215
processSat(Inst);
216-
else if (IntrinID == GenXIntrinsic::genx_faddr)
217-
processFuncPointer(Inst);
218216
else if (GenXIntrinsic::isReadWritePredefReg(IntrinID))
219217
processRdWrPredefReg(Inst);
220218
else if (GenXIntrinsic::isRdRegion(IntrinID))
@@ -1013,29 +1011,6 @@ void GenXBaling::processInlineAsm(Instruction *Inst) {
10131011
setBaleInfo(Inst, BI);
10141012
}
10151013

1016-
/***********************************************************************
1017-
* processFuncPointer : process genx.faddr which is used in <=1 WrRegions
1018-
* and is baled into it.
1019-
*/
1020-
void GenXBaling::processFuncPointer(Instruction *Inst) {
1021-
auto *CI = dyn_cast<CallInst>(Inst);
1022-
IGC_ASSERT_MESSAGE(CI, "genx.faddr expected");
1023-
IGC_ASSERT_MESSAGE(GenXIntrinsic::getGenXIntrinsicID(CI) == GenXIntrinsic::genx_faddr,
1024-
"genx.faddr expected");
1025-
IGC_ASSERT(Inst->hasOneUse());
1026-
auto *NextUser = Inst->user_back();
1027-
if (isa<BitCastInst>(NextUser)) {
1028-
// bitcasts <N x i64> -> <2*N x i32> may appear after i64 emulation
1029-
IGC_ASSERT(NextUser->hasOneUse());
1030-
IGC_ASSERT(NextUser->getType()->getScalarType()->isIntegerTy(32));
1031-
NextUser = NextUser->user_back();
1032-
}
1033-
IGC_ASSERT(NextUser->use_empty() || GenXIntrinsic::isWrRegion(NextUser));
1034-
1035-
BaleInfo BI(BaleInfo::FADDR);
1036-
setBaleInfo(Inst, BI);
1037-
}
1038-
10391014
void GenXBaling::processRdWrPredefReg(Instruction *Inst) {
10401015
auto *CI = dyn_cast<CallInst>(Inst);
10411016
IGC_ASSERT_MESSAGE((CI && GenXIntrinsic::isReadWritePredefReg(Inst)),
@@ -2717,7 +2692,6 @@ const char *BaleInfo::getTypeString() const
27172692
case BaleInfo::CMPDST: return "cmpdst";
27182693
case BaleInfo::GSTORE: return "g_store";
27192694
case BaleInfo::SHUFFLEPRED: return "shufflepred";
2720-
case BaleInfo::FADDR: return "faddr";
27212695
default: return "???";
27222696
}
27232697
}

IGC/VectorCompiler/lib/GenXCodeGen/GenXBaling.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ struct BaleInfo {
243243
// Type is how this instruction relates to its bale, whether it is a
244244
// rdregion, wrregion, modifier, or main instruction.
245245
enum { MAININST, WRREGION, SATURATE, NOTMOD, NEGMOD, ABSMOD,
246-
RDREGION, ADDRADD, ADDROR, FADDR, RDPREDREGION, ALLANY, NOTP, ZEXT, SEXT,
246+
RDREGION, ADDRADD, ADDROR, RDPREDREGION, ALLANY, NOTP, ZEXT, SEXT,
247247
SHUFFLEPRED, WRPREDREGION, WRPREDPREDREGION, CMPDST, GSTORE, REGINTR };
248248
uint16_t Type;
249249
uint16_t Bits; // bitmap of which operands are baled in
@@ -464,7 +464,6 @@ class GenXBaling {
464464
void processRdPredRegion(Instruction *Inst);
465465
void processInlineAsm(Instruction *Inst);
466466
void processExtractValue(ExtractValueInst *EV);
467-
void processFuncPointer(Instruction *Inst);
468467
void processRdWrPredefReg(Instruction *Inst);
469468
void processMainInst(Instruction *Inst, int IntrinID);
470469
bool processSelectToPredicate(SelectInst *SI);

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ class GenXKernelBuilder {
598598
unsigned Mod, const DstOpndDesc &DstDesc);
599599
void buildInputs(Function *F, bool NeedRetIP);
600600

601-
void buildFunctionAddr(Instruction *Inst, const DstOpndDesc &DstDesc);
602601
void buildLoneWrRegion(const DstOpndDesc &Desc);
603602
void buildLoneWrPredRegion(Instruction *Inst, genx::BaleInfo BI);
604603
void buildLoneOperand(Instruction *Inst, genx::BaleInfo BI, unsigned Mod,
@@ -1660,10 +1659,6 @@ bool GenXKernelBuilder::buildInstruction(Instruction *Inst) {
16601659
Inst = cast<Instruction>(DstDesc.WrRegion->getOperand(OperandNum));
16611660
BI = Baling->getBaleInfo(Inst);
16621661
}
1663-
if (BI.Type == BaleInfo::FADDR) {
1664-
buildFunctionAddr(Inst, DstDesc);
1665-
return false;
1666-
}
16671662
unsigned Mod = 0;
16681663
if (BI.Type == BaleInfo::SATURATE) {
16691664
// Inst is a fp saturate. See if it bales in the instruction that
@@ -2710,18 +2705,6 @@ void GenXKernelBuilder::buildNoopCast(CastInst *CI, genx::BaleInfo BI,
27102705
0, false));
27112706
}
27122707

2713-
void GenXKernelBuilder::buildFunctionAddr(Instruction *Inst,
2714-
const DstOpndDesc &DstDesc) {
2715-
auto *CI = dyn_cast<CallInst>(Inst);
2716-
IGC_ASSERT(CI);
2717-
IGC_ASSERT_MESSAGE(GenXIntrinsic::getGenXIntrinsicID(CI) == GenXIntrinsic::genx_faddr,
2718-
"genx.faddr expected in a FADDR bale");
2719-
auto *Dst = createDestination(Inst, DONTCARESIGNED, MODIFIER_NONE, DstDesc);
2720-
IGC_ASSERT(Dst);
2721-
auto *F = cast<Function>(Inst->getOperand(0));
2722-
CISA_CALL(Kernel->AppendVISACFSymbolInst(F->getName().str(), Dst));
2723-
}
2724-
27252708
/***********************************************************************
27262709
* buildLoneWrRegion : build a lone wrregion
27272710
*/

IGC/VectorCompiler/lib/GenXCodeGen/GenXEmulate.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ static cl::opt<bool> OptStricterOword(
7676
static cl::opt<bool> OptStricterAlloc(
7777
"vc-i64emu-strict-report-alloc", cl::init(false), cl::Hidden,
7878
cl::desc("strict check will break on 64-bit alloc"));
79-
static cl::opt<bool> OptStricterFaddr(
80-
"vc-i64emu-strict-report-faddr", cl::init(false), cl::Hidden,
81-
cl::desc("strict check will break on 64-bit faddr"));
8279
static cl::opt<bool>
8380
OptStricterConst("vc-i64emu-strict-const", cl::init(false), cl::Hidden,
8481
cl::desc("strict check will break on 64-bit constanti"));
@@ -1648,8 +1645,6 @@ bool GenXEmulate::Emu64Expander::hasStrictEmulationRequirement(
16481645
return OptStricterOword;
16491646
case GenXIntrinsic::genx_alloca:
16501647
return OptStricterAlloc;
1651-
case GenXIntrinsic::genx_faddr:
1652-
return OptStricterFaddr;
16531648
}
16541649

16551650
switch (Inst->getOpcode()) {

IGC/VectorCompiler/lib/GenXCodeGen/GenXGlobalValueLowering.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ SPDX-License-Identifier: MIT
2323
/// 4. All paths to global SLM use must start from the same kernel.
2424
///
2525
/// For any other global values relocations are used.
26-
/// In vISA relocations are enabled via faddr instruction:
27-
/// faddr very_important_data V1(0,0)<1>
2826
/// For global value symbols (global variable or function) LLVM IR
2927
/// represintation of this instruction is:
3028
/// %g = call i64 @llvm.genx.gaddr.i64.p0a8i8([8 x i8]* @very_important_data)

IGC/VectorCompiler/lib/GenXCodeGen/GenXPatternMatch.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,13 +2409,6 @@ bool GenXPatternMatch::simplifyWrRegion(CallInst *Inst) {
24092409
if (!isa<UndefValue>(OldV))
24102410
return false;
24112411

2412-
// have to keep faddr's wrregion to ensure faddr's proper baling
2413-
auto *Parent = NewV;
2414-
while (isa<BitCastInst>(Parent))
2415-
Parent = cast<Instruction>(Parent)->getOperand(0);
2416-
if (vc::getAnyIntrinsicID(Parent) == GenXIntrinsic::genx_faddr)
2417-
return false;
2418-
24192412
if (NewVTy->isVectorTy() &&
24202413
cast<IGCLLVM::FixedVectorType>(NewVTy)->getNumElements() > 1)
24212414
return false;

IGC/VectorCompiler/lib/GenXCodeGen/GenXUtil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ bool isWrPredRegionLegalSetP(const CallInst &WrPredRegion);
584584
// Many of our analyzes do not check whether a function F's user
585585
// which is a CallInst calls exactly F. This may not be true
586586
// when a function pointer is passed as an argument of a call to
587-
// another function, e.g. genx.faddr intrinsic.
587+
// another function.
588588
// Returns V casted to CallInst if the check is true,
589589
// nullptr otherwise.
590590
const CallInst *checkFunctionCall(const Value *V, const Function *F);

IGC/VectorCompiler/test/Baling/funcptr_emu_bc.ll

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)