Skip to content

Commit 79e29f5

Browse files
DianaChensys_zuul
authored andcommitted
[Autobackout][FuncReg]Revert of change: 7d079ed
Add analysis of stateless memory load/store Add the analysis to StatelessToStatefull pass to check if there is non kernel argument memory load/store. Change-Id: I0217a6a0d2e755cfe4b509664290ac67cc7974ab
1 parent d0a34ef commit 79e29f5

File tree

3 files changed

+8
-35
lines changed

3 files changed

+8
-35
lines changed

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,9 +1378,9 @@ namespace IGC
13781378
opcode == llvm_gradientYfine);
13791379
}
13801380

1381-
bool IsStatelessMemLoadIntrinsic(llvm::GenISAIntrinsic::ID id)
1381+
bool IsStatelessMemLoadIntrinsic(const llvm::GenIntrinsicInst& inst)
13821382
{
1383-
switch(id)
1383+
switch(inst.getIntrinsicID())
13841384
{
13851385
case GenISAIntrinsic::GenISA_simdBlockRead:
13861386
return true;
@@ -1390,9 +1390,9 @@ namespace IGC
13901390
return false;
13911391
}
13921392

1393-
bool IsStatelessMemStoreIntrinsic(llvm::GenISAIntrinsic::ID id)
1393+
bool IsStatelessMemStoreIntrinsic(const llvm::GenIntrinsicInst& inst)
13941394
{
1395-
switch (id) {
1395+
switch (inst.getIntrinsicID()) {
13961396
case GenISAIntrinsic::GenISA_simdBlockWrite:
13971397
return true;
13981398
default:
@@ -1401,7 +1401,7 @@ namespace IGC
14011401
return false;
14021402
}
14031403

1404-
bool IsStatelessMemAtomicIntrinsic(GenIntrinsicInst& inst, GenISAIntrinsic::ID id)
1404+
bool IsStatelessMemAtomicIntrinsic(const llvm::GenIntrinsicInst& inst)
14051405
{
14061406
// This includes:
14071407
// GenISA_intatomicraw

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ namespace IGC
175175
bool IsSIMDBlockIntrinsic(llvm::Instruction* inst);
176176
bool isSubGroupIntrinsic(const llvm::Instruction* I);
177177

178-
bool IsStatelessMemLoadIntrinsic(llvm::GenISAIntrinsic::ID id);
179-
bool IsStatelessMemStoreIntrinsic(llvm::GenISAIntrinsic::ID id);
180-
bool IsStatelessMemAtomicIntrinsic(llvm::GenIntrinsicInst& inst, llvm::GenISAIntrinsic::ID id);
178+
bool IsStatelessMemLoadIntrinsic(const llvm::GenIntrinsicInst& inst);
179+
bool IsStatelessMemStoreIntrinsic(const llvm::GenIntrinsicInst& inst);
180+
bool IsStatelessMemAtomicIntrinsic(const llvm::GenIntrinsicInst& inst);
181181

182182
bool isURBWriteIntrinsic(const llvm::Instruction* inst);
183183

IGC/Compiler/Optimizer/OpenCLPasses/StatelessToStatefull/StatelessToStatefull.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -604,22 +604,6 @@ void StatelessToStatefull::visitCallInst(CallInst& I)
604604
m_changed = true;
605605
}
606606
}
607-
// check if there's non-kernel-arg load/store
608-
if (IsStatelessMemStoreIntrinsic(intrinID) ||
609-
IsStatelessMemLoadIntrinsic(intrinID) ||
610-
IsStatelessMemAtomicIntrinsic(*Inst, intrinID)) {
611-
612-
Value* ptr = Inst->getOperand(0);
613-
if (!pointerIsFromKernelArgument(*ptr)) {
614-
CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
615-
if (IsStatelessMemStoreIntrinsic(intrinID))
616-
ctx->m_hasNonKernelArgStore = true;
617-
else if (IsStatelessMemLoadIntrinsic(intrinID))
618-
ctx->m_hasNonKernelArgLoad = true;
619-
else
620-
ctx->m_hasNonKernelArgAtomic = true;
621-
}
622-
}
623607
}
624608
}
625609

@@ -668,12 +652,6 @@ void StatelessToStatefull::visitLoadInst(LoadInst& I)
668652

669653
m_changed = true;
670654
}
671-
672-
// check if there's non-kernel-arg load/store
673-
if (!pointerIsFromKernelArgument(*ptr)) {
674-
CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
675-
ctx->m_hasNonKernelArgLoad = true;
676-
}
677655
}
678656

679657
void StatelessToStatefull::visitStoreInst(StoreInst& I)
@@ -715,11 +693,6 @@ void StatelessToStatefull::visitStoreInst(StoreInst& I)
715693
m_changed = true;
716694
}
717695
}
718-
719-
if (!pointerIsFromKernelArgument(*ptr)) {
720-
CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
721-
ctx->m_hasNonKernelArgStore = true;
722-
}
723696
}
724697

725698
CallInst* StatelessToStatefull::createBufferPtr(unsigned addrSpace, Constant* argNumber, Instruction* InsertBefore)

0 commit comments

Comments
 (0)