[llvm] [AMDGPU] Handle MachineOperandType global address in SIFoldOperands. (PR #135424)
Akhilesh Moorthy via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 24 21:05:04 PDT 2025
================
@@ -1161,6 +1161,10 @@ void SIFoldOperandsImpl::foldOperand(
if (OpToFold.isImm())
UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm());
+ else if (OpToFold.isGlobal())
+ UseMI->getOperand(1).ChangeToGA(OpToFold.getGlobal(),
+ OpToFold.getOffset(),
+ OpToFold.getTargetFlags());
else
UseMI->getOperand(1).ChangeToFrameIndex(OpToFold.getIndex());
----------------
isakhilesh wrote:
Hi @arsenm, I had initially considered handling isFI() in else if, but as @dhruvachak mentioned, UseMI->setDesc() has potentially made changes already, so I am keeping it in the else block since there might be modifications required with respect to setDesc() as well.
https://github.com/llvm/llvm-project/pull/135424
More information about the llvm-commits
mailing list