[llvm] 906d3ff - [AMDGPU] Remove legality checks from imm folding in shrink. NFCI. (#69539)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 19 03:52:32 PDT 2023
Author: Stanislav Mekhanoshin
Date: 2023-10-19T03:52:28-07:00
New Revision: 906d3ff054b0ca6439521e8871bac54843cc73a2
URL: https://github.com/llvm/llvm-project/commit/906d3ff054b0ca6439521e8871bac54843cc73a2
DIFF: https://github.com/llvm/llvm-project/commit/906d3ff054b0ca6439521e8871bac54843cc73a2.diff
LOG: [AMDGPU] Remove legality checks from imm folding in shrink. NFCI. (#69539)
The immediate legality checks are now embedded into the
isOperandLegal(). It is not needed to check it again.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
index 4159dc694c1e037..88c75a0f86a6c13 100644
--- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
@@ -104,8 +104,7 @@ bool SIShrinkInstructions::foldImmediates(MachineInstr &MI,
bool ConstantFolded = false;
if (TII->isOperandLegal(MI, Src0Idx, &MovSrc)) {
- if (MovSrc.isImm() &&
- (isInt<32>(MovSrc.getImm()) || isUInt<32>(MovSrc.getImm()))) {
+ if (MovSrc.isImm()) {
Src0.ChangeToImmediate(MovSrc.getImm());
ConstantFolded = true;
} else if (MovSrc.isFI()) {
More information about the llvm-commits
mailing list