Skip to content

Commit 1b34deb

Browse files
committed
AMDGPU: Remove redundant operand folding checks
This was pre-filtering out a specific situation from being added to the fold candidate list. The operand legality will ultimately be checked with isOperandLegal before the fold is performed, so I don't see the plus in pre-filtering this one case.
1 parent 667ed2e commit 1b34deb

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -778,24 +778,6 @@ bool SIFoldOperandsImpl::tryAddToFoldList(
778778
return true;
779779
}
780780

781-
// Check the case where we might introduce a second constant operand to a
782-
// scalar instruction
783-
if (TII->isSALU(MI->getOpcode())) {
784-
const MCInstrDesc &InstDesc = MI->getDesc();
785-
const MCOperandInfo &OpInfo = InstDesc.operands()[OpNo];
786-
787-
// Fine if the operand can be encoded as an inline constant
788-
if (!OpToFold->isReg() && !TII->isInlineConstant(*OpToFold, OpInfo)) {
789-
// Otherwise check for another constant
790-
for (unsigned i = 0, e = InstDesc.getNumOperands(); i != e; ++i) {
791-
auto &Op = MI->getOperand(i);
792-
if (OpNo != i && !Op.isReg() &&
793-
!TII->isInlineConstant(Op, InstDesc.operands()[i]))
794-
return false;
795-
}
796-
}
797-
}
798-
799781
appendFoldCandidate(FoldList, MI, OpNo, OpToFold);
800782
return true;
801783
}

0 commit comments

Comments
 (0)