[RISCV][NFC] Remove duplicate setTargetDAGCombine registrations#186928
Merged
[RISCV][NFC] Remove duplicate setTargetDAGCombine registrations#186928
Conversation
ISD::SRA and ISD::MUL are already registered unconditionally in the constructor, so remove the redundant registrations from the hasVInstructions() block. Fold the standalone SRA call into the existing brace-initializer list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
@llvm/pr-subscribers-backend-risc-v Author: Jim Lin (tclin914) ChangesISD::SRA and ISD::MUL are already registered unconditionally in the constructor, so remove the redundant registrations from the hasVInstructions() block. Fold the standalone SRA call into the existing brace-initializer list. Full diff: https://github.com/llvm/llvm-project/pull/186928.diff 1 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 7e0c6a6aedfcc..d76a251248f2e 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -1885,8 +1885,8 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
setTargetDAGCombine({ISD::INTRINSIC_VOID, ISD::INTRINSIC_W_CHAIN,
ISD::INTRINSIC_WO_CHAIN, ISD::ADD, ISD::SUB, ISD::MUL,
- ISD::AND, ISD::OR, ISD::XOR, ISD::SETCC, ISD::SELECT});
- setTargetDAGCombine(ISD::SRA);
+ ISD::AND, ISD::OR, ISD::XOR, ISD::SETCC, ISD::SELECT,
+ ISD::SRA});
setTargetDAGCombine(ISD::SIGN_EXTEND_INREG);
if (Subtarget.hasStdExtFOrZfinx())
@@ -1908,12 +1908,12 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
if (Subtarget.hasVInstructions())
setTargetDAGCombine(
{ISD::FCOPYSIGN, ISD::MGATHER, ISD::MSCATTER,
- ISD::VP_GATHER, ISD::VP_SCATTER, ISD::SRA,
- ISD::SRL, ISD::SHL, ISD::STORE,
- ISD::SPLAT_VECTOR, ISD::BUILD_VECTOR, ISD::CONCAT_VECTORS,
+ ISD::VP_GATHER, ISD::VP_SCATTER, ISD::SRL,
+ ISD::SHL, ISD::STORE, ISD::SPLAT_VECTOR,
+ ISD::BUILD_VECTOR, ISD::CONCAT_VECTORS,
ISD::VP_STORE, ISD::VP_TRUNCATE, ISD::EXPERIMENTAL_VP_REVERSE,
- ISD::MUL, ISD::SDIV, ISD::UDIV,
- ISD::SREM, ISD::UREM, ISD::INSERT_VECTOR_ELT,
+ ISD::SDIV, ISD::UDIV, ISD::SREM,
+ ISD::UREM, ISD::INSERT_VECTOR_ELT,
ISD::ABS, ISD::CTPOP, ISD::VECTOR_SHUFFLE,
ISD::FMA, ISD::VSELECT, ISD::VECREDUCE_ADD});
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ISD::SRA and ISD::MUL are already registered unconditionally in the constructor, so remove the redundant registrations from the hasVInstructions() block. Fold the standalone SRA call into the existing brace-initializer list.