Skip to content

Commit 686a2b5

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 686a2b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,10 @@ void SIFoldOperandsImpl::foldOperand(
11611161

11621162
if (OpToFold.isImm())
11631163
UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm());
1164-
else
1164+
else if (OpToFold.isFI())
11651165
UseMI->getOperand(1).ChangeToFrameIndex(OpToFold.getIndex());
1166+
else if (OpToFold.isGlobal())
1167+
return;
11661168
UseMI->removeOperand(2); // Remove exec read (or src1 for readlane)
11671169
return;
11681170
}

0 commit comments

Comments
 (0)