[llvm] [LegalizeDAG] Optimize CodeGen for `ISD::CTLZ_ZERO_UNDEF` (PR #83039)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 30 22:23:27 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 c0febca3a64530c1cc3f117aec6a28c37114e572 5b23ff17780a815c684e87950a4fdd05a47f2718 -- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.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 08db2c9b07..89f4cc6726 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -665,7 +665,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_CTLZ(SDNode *N) {
 
     // Op = Op << (sizeinbits(NVT) - sizeinbits(Old VT))
     unsigned SHLAmount = NVT.getSizeInBits() - OVT.getSizeInBits();
-    auto ShiftConst = DAG.getShiftAmountConstant(SHLAmount, Op.getValueType(), dl);
+    auto ShiftConst =
+        DAG.getShiftAmountConstant(SHLAmount, Op.getValueType(), dl);
     if (!N->isVPOpcode()) {
       Op = DAG.getNode(ISD::SHL, dl, NVT, Op, ShiftConst);
       return DAG.getNode(CtlzOpcode, dl, NVT, Op);

``````````

</details>


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


More information about the llvm-commits mailing list