Skip to content

Commit 6a360b3

Browse files
authored
AMDGPU: Remove redundant inline constant check (#127582)
We don't really care of this is an inline constant, only if it will be legal.
1 parent 03cb46d commit 6a360b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,7 @@ bool SIFoldOperandsImpl::tryToFoldACImm(
824824
return false;
825825

826826
uint8_t OpTy = Desc.operands()[UseOpIdx].OperandType;
827-
if (OpToFold.isImm() && TII->isInlineConstant(OpToFold, OpTy) &&
828-
TII->isOperandLegal(*UseMI, UseOpIdx, &OpToFold)) {
827+
if (OpToFold.isImm() && TII->isOperandLegal(*UseMI, UseOpIdx, &OpToFold)) {
829828
UseMI->getOperand(UseOpIdx).ChangeToImmediate(OpToFold.getImm());
830829
return true;
831830
}
@@ -845,8 +844,7 @@ bool SIFoldOperandsImpl::tryToFoldACImm(
845844
MachineOperand &UseOp = UseMI->getOperand(UseOpIdx);
846845
if (!UseOp.getSubReg() && Def && TII->isFoldableCopy(*Def)) {
847846
MachineOperand &DefOp = Def->getOperand(1);
848-
if (DefOp.isImm() && TII->isInlineConstant(DefOp, OpTy) &&
849-
TII->isOperandLegal(*UseMI, UseOpIdx, &DefOp)) {
847+
if (DefOp.isImm() && TII->isOperandLegal(*UseMI, UseOpIdx, &DefOp)) {
850848
UseMI->getOperand(UseOpIdx).ChangeToImmediate(DefOp.getImm());
851849
return true;
852850
}

0 commit comments

Comments
 (0)