[llvm] [RISCV] Introduce local peephole to reduce VLs based on demanded VL (PR #104689)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 17 18:20:32 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff f668708796b981733a5816f2efed0d5195af923d 4f8744fd24f9778140aa2567c0358cefbfe3971e --extensions cpp -- llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp b/llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
index b2891376ea..4165974f15 100644
--- a/llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
+++ b/llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
@@ -82,7 +82,6 @@ char RISCVVectorPeephole::ID = 0;
INITIALIZE_PASS(RISCVVectorPeephole, DEBUG_TYPE, "RISC-V Fold Masks", false,
false)
-
/// Given two VL operands, returns the one known to be the smallest or nullptr
/// if unknown.
static const MachineOperand *getKnownMinVL(const MachineOperand *LHS,
@@ -161,8 +160,7 @@ bool RISCVVectorPeephole::tryToReduceVL(MachineInstr &MI) const {
if (ActiveElementsAffectResult || Src->mayRaiseFPException())
return false;
- MachineOperand &SrcVL =
- Src->getOperand(RISCVII::getVLOpNum(Src->getDesc()));
+ MachineOperand &SrcVL = Src->getOperand(RISCVII::getVLOpNum(Src->getDesc()));
const MachineOperand *MinVL = getKnownMinVL(&VL, &SrcVL);
if (!MinVL || MinVL == &SrcVL)
return false;
``````````
</details>
https://github.com/llvm/llvm-project/pull/104689
More information about the llvm-commits
mailing list