[llvm] [AMDGPU] Handle MachineOperandType global address in SIFoldOperands. (PR #135424)
    Akhilesh Moorthy via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Apr 27 22:15:36 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:
Got it, I have updated the patch based on the suggested structure, thanks a lot. Please let me know if I can improve it further.
https://github.com/llvm/llvm-project/pull/135424
    
    
More information about the llvm-commits
mailing list