[llvm] [DAG] Fold trunc(srl(extract_elt(vec,c1),c2)) -> extract_elt(bitcast(vec),c3) (PR #107987)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 01:51:40 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 7e07c1df678825c6a57d5fb1d36cdfc1584de9dc cc28b673d34974baf239ec1c0ac9d8cc314e59a2 --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 720165e1fb..e6084341ee 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -15173,7 +15173,8 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
       SDValue EltNo = Src->getOperand(1);
       if (isa<ConstantSDNode>(EltNo) && isTypeLegal(NVT)) {
         int Elt = EltNo->getAsZExtVal();
-        int Index = isLE ? (Elt*SizeRatio) : (Elt*SizeRatio + (SizeRatio-1));
+        int Index =
+            isLE ? (Elt * SizeRatio) : (Elt * SizeRatio + (SizeRatio - 1));
         Index += EltOffset;
         return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, TrTy,
                            DAG.getBitcast(NVT, Src.getOperand(0)),

``````````

</details>


https://github.com/llvm/llvm-project/pull/107987


More information about the llvm-commits mailing list