Skip to content

Commit 69c3465

Browse files
committed
[AMDGPU] Handle MachineOperandType global address in SIFoldOperands.
While FoldingImmLike accepts : MO_Immediate, MO_FrameIndex and MO_GlobalAddress. The conditional block after it only covers the first 2. So I have added a case for the global value as well.
1 parent db4ad46 commit 69c3465

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,8 @@ void SIFoldOperandsImpl::foldOperand(
11591159

11601160
UseMI->setDesc(TII->get(AMDGPU::S_MOV_B32));
11611161

1162+
if (OpToFold.isGlobal())
1163+
return;
11621164
if (OpToFold.isImm())
11631165
UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm());
11641166
else

0 commit comments

Comments
 (0)