[llvm] [RISCV] Exploit register boundaries when lowering shuffle with exact vlen (PR #79072)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 14:45:54 PST 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 8675952583b1c639e6bcbe2869aecda1d01320f2 2a0db725b207c4933c790790b99080738effc585 -- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index c8aaacaf6a..35e93ec26a 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -4667,8 +4667,7 @@ static SDValue lowerShuffleViaVRegSplitting(ShuffleVectorSDNode *SVN,
// is already m1 or smaller, no point in splitting further.
const unsigned MinVLen = Subtarget.getRealMinVLen();
const unsigned MaxVLen = Subtarget.getRealMaxVLen();
- if (MinVLen != MaxVLen ||
- VT.getSizeInBits().getKnownMinValue() <= MinVLen)
+ if (MinVLen != MaxVLen || VT.getSizeInBits().getKnownMinValue() <= MinVLen)
return SDValue();
MVT ElemVT = VT.getVectorElementType();
@@ -4714,7 +4713,7 @@ static SDValue lowerShuffleViaVRegSplitting(ShuffleVectorSDNode *SVN,
// to avoid DAG combining it back to a large shuffle_vector again.
V1 = convertToScalableVector(ContainerVT, V1, DAG, Subtarget);
V2 = convertToScalableVector(ContainerVT, V2, DAG, Subtarget);
- for (unsigned DstVecIdx = 0 ; DstVecIdx < OutMasks.size(); DstVecIdx++) {
+ for (unsigned DstVecIdx = 0; DstVecIdx < OutMasks.size(); DstVecIdx++) {
auto &[SrcVecIdx, SrcSubMask] = OutMasks[DstVecIdx];
if (SrcVecIdx == -1)
continue;
``````````
</details>
https://github.com/llvm/llvm-project/pull/79072
More information about the llvm-commits
mailing list