[llvm] [Codegen][LegalizeIntegerTypes] Improve shift through stack (PR #96151)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 00:37:39 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 7a80c86726f7c37128bfee3618707c1607f5014d 4506bf188042d40428f00b1206a94289a48a94ab --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 289123c578..00f4aa9cd8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -4653,11 +4653,11 @@ void DAGTypeLegalizer::ExpandIntRes_ShiftThroughStack(SDNode *N, SDValue &Lo,
 
   Flags.setExact(true);
   SDValue ByteOffset = DAG.getNode(ISD::SRL, dl, ShAmtVT, BitOffset,
-                               DAG.getConstant(3, dl, ShAmtVT), Flags);
+                                   DAG.getConstant(3, dl, ShAmtVT), Flags);
   // And clamp it, because OOB load is an immediate UB,
   // while shift overflow would have *just* been poison.
   ByteOffset = DAG.getNode(ISD::AND, dl, ShAmtVT, ByteOffset,
-                       DAG.getConstant(VTByteWidth - 1, dl, ShAmtVT));
+                           DAG.getConstant(VTByteWidth - 1, dl, ShAmtVT));
   // We have exactly two strategies on indexing into stack slot here:
   // 1. upwards starting from the beginning of the slot
   // 2. downwards starting from the middle of the slot

``````````

</details>


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


More information about the llvm-commits mailing list