[llvm] [RISCV] Use significant bits helpers in narrowing of build vectors [nfc] (PR #104511)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 15 14:28:30 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 d68d2172f9f1f0659b8b4bdbbeb1ccd290a614b5 4992557be0140c0aa4708f74fa8f9d072ee1397b --extensions cpp -- 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 515d7dbcd4..b76ebdf715 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -3815,11 +3815,12 @@ static SDValue lowerBuildVectorOfConstants(SDValue Op, SelectionDAG &DAG,
if (EltBitSize > 8 && VT.isInteger() &&
(NumElts <= 4 || VT.getSizeInBits() > Subtarget.getRealMinVLen()) &&
DAG.ComputeMaxSignificantBits(Op) <= 8) {
- SDValue Source = DAG.getBuildVector(VT.changeVectorElementType(MVT::i8),
- DL, Op->ops());
- Source = convertToScalableVector(ContainerVT.changeVectorElementType(MVT::i8),
- Source, DAG, Subtarget);
- SDValue Res = DAG.getNode(RISCVISD::VSEXT_VL, DL, ContainerVT, Source, Mask, VL);
+ SDValue Source =
+ DAG.getBuildVector(VT.changeVectorElementType(MVT::i8), DL, Op->ops());
+ Source = convertToScalableVector(
+ ContainerVT.changeVectorElementType(MVT::i8), Source, DAG, Subtarget);
+ SDValue Res =
+ DAG.getNode(RISCVISD::VSEXT_VL, DL, ContainerVT, Source, Mask, VL);
return convertFromScalableVector(VT, Res, DAG, Subtarget);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/104511
More information about the llvm-commits
mailing list