[llvm] AMDGPU: Remove redundant operand folding checks (PR #140587)
Changpeng Fang via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 12:12:26 PDT 2025
================
@@ -777,24 +777,6 @@ bool SIFoldOperandsImpl::tryAddToFoldList(
return true;
}
- // Check the case where we might introduce a second constant operand to a
- // scalar instruction
- if (TII->isSALU(MI->getOpcode())) {
- const MCInstrDesc &InstDesc = MI->getDesc();
- const MCOperandInfo &OpInfo = InstDesc.operands()[OpNo];
-
- // Fine if the operand can be encoded as an inline constant
- if (!OpToFold->isReg() && !TII->isInlineConstant(*OpToFold, OpInfo)) {
- // Otherwise check for another constant
- for (unsigned i = 0, e = InstDesc.getNumOperands(); i != e; ++i) {
- auto &Op = MI->getOperand(i);
- if (OpNo != i && !Op.isReg() &&
- !TII->isInlineConstant(Op, InstDesc.operands()[i]))
- return false;
- }
- }
- }
-
----------------
changpeng wrote:
> Because isOperandLegal is checked before the actual fold. This case is the special case with a frame index which we don't know the value of at this point which this avoids
So, should we put the pre-filtering code back, or fix something else?
https://github.com/llvm/llvm-project/pull/140587
More information about the llvm-commits
mailing list