Skip to content

Commit dfac18b

Browse files
jhananitigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 707ef15
Adding support to detect Bindless Constant Address Adding support to get bindless constant Address
1 parent f3ef0ff commit dfac18b

File tree

4 files changed

+6
-27
lines changed

4 files changed

+6
-27
lines changed

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ namespace IGC
800800
}
801801

802802
// Get constant address from load/ldraw instruction
803-
bool getConstantAddress(llvm::Instruction& I, ConstantAddress& cl, CodeGenContext* pContext, bool& directBuf, bool& statelessBuf, bool& bindlessBuf, unsigned int& TableOffset)
803+
bool getConstantAddress(llvm::Instruction& I, ConstantAddress& cl, CodeGenContext* pContext, bool& directBuf, bool& statelessBuf, bool& bindlessBuf)
804804
{
805805
// Check if the load instruction is with constant buffer address
806806
unsigned as;
@@ -828,20 +828,7 @@ namespace IGC
828828
as = ldRaw->getResourceValue()->getType()->getPointerAddressSpace();
829829
ptrVal = ldRaw->getResourceValue();
830830
offsetVal = ldRaw->getOffsetValue();
831-
bindlessBuf = (DecodeBufferType(as) == SSH_BINDLESS_CONSTANT_BUFFER) ||
832-
(DecodeBufferType(as) == BINDLESS_CONSTANT_BUFFER);
833-
if (IntToPtrInst* ptrToInt = dyn_cast<IntToPtrInst>(ptrVal))
834-
{
835-
if (Instruction* instr = dyn_cast<Instruction>(ptrToInt->getOperand(0)))
836-
{
837-
if (instr->getOpcode() == Instruction::Add &&
838-
isa<ConstantInt>(instr->getOperand(1)))
839-
{
840-
ConstantInt* src1 = cast<ConstantInt>(instr->getOperand(1));
841-
TableOffset = int_cast<unsigned int>(src1->getZExtValue()) >> pContext->platform.getBSOLocInExtDescriptor();
842-
}
843-
}
844-
}
831+
bindlessBuf = (DecodeBufferType(as) == SSH_BINDLESS_CONSTANT_BUFFER);
845832
}
846833
else
847834
return false;
@@ -871,14 +858,6 @@ namespace IGC
871858
break;
872859
}
873860
}
874-
for (unsigned int& runtimeValueIndex : pushInfo.bindlessPushInfo)
875-
{
876-
if (bufIdOrGRFOffset == runtimeValueIndex)
877-
{
878-
isPushableAddr = true;
879-
break;
880-
}
881-
}
882861
}
883862
}
884863
else

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ namespace IGC
162162
bool GetStatelessBufferInfo(llvm::Value* pointer, unsigned& bufIdOrGRFOffset, IGC::BufferType& bufferTy, llvm::Value*& bufferSrcPtr, bool& isDirectBuf);
163163
// try to evaluate the address if it is constant.
164164
bool EvalConstantAddress(llvm::Value* address, unsigned int& offset, const llvm::DataLayout* pDL, llvm::Value* ptrSrc = nullptr);
165-
bool getConstantAddress(llvm::Instruction& I, ConstantAddress& cl, CodeGenContext* pContext, bool& directBuf, bool& statelessBuf, bool& bindlessBuf, unsigned int& TableOffset);
165+
bool getConstantAddress(llvm::Instruction& I, ConstantAddress& cl, CodeGenContext* pContext, bool& directBuf, bool& statelessBuf, bool& bindlessBuf);
166166

167167

168168
bool isSampleLoadGather4InfoInstruction(llvm::Instruction* inst);

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3113,8 +3113,8 @@ Constant* IGCConstProp::replaceShaderConstant(Instruction* inst)
31133113
bool directBuf = false;
31143114
bool statelessBuf = false;
31153115
bool bindlessBuf = false;
3116-
unsigned int tableOffset = 0;
3117-
if (getConstantAddress(*inst, cl, ctx, directBuf, statelessBuf, bindlessBuf, tableOffset))
3116+
3117+
if (getConstantAddress(*inst, cl, ctx, directBuf, statelessBuf, bindlessBuf))
31183118
{
31193119
if (size_in_bytes)
31203120
{

IGC/common/MDFrameWork.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ namespace IGC
386386
std::vector<StatelessPushInfo> pushableAddresses;
387387

388388
// Indices of RuntimeValues that can be used to compute surface state
389-
// offsets for the bindless push along with the Descriptor Table Offset.
389+
// offsets for the bindless push.
390390
std::vector<unsigned int> bindlessPushInfo;
391391

392392
// Dynamic buffer offsets info.

0 commit comments

Comments
 (0)