[llvm-branch-commits] [llvm] AMDGPU: Remove redundant operand folding checks (PR #140587)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon May 19 13:06:22 PDT 2025
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/140587
>From 04c0bfd8afd6d0c22177ab74fcd563911b628de8 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Mon, 19 May 2025 20:02:54 +0200
Subject: [PATCH] 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.
---
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index b62230d4dc28c..9bbc8e75fd31b 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;
}
More information about the llvm-branch-commits
mailing list