[llvm-branch-commits] [llvm] AMDGPU: Remove redundant operand folding checks (PR #140587)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon May 19 11:08:27 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/140587.diff
1 Files Affected:
- (modified) llvm/lib/Target/AMDGPU/SIFoldOperands.cpp (-18)
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index d94c2d8b03dff..3abc1be685e2e 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -778,24 +778,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;
- }
- }
- }
-
appendFoldCandidate(FoldList, MI, OpNo, OpToFold);
return true;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/140587
More information about the llvm-branch-commits
mailing list