[llvm] [DAG] SimplifyDemandedBits - ensure we demand the high bits for shl nsw/nuw ops (PR #70041)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 06:36:59 PDT 2023


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 cdaaa4d7fb26e3790ef022e3501820d4ba0f7728 fd8d5939bae153f0d4a48789643533688c856db1 -- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 826f77340..946ac3e07 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1797,10 +1797,10 @@ bool TargetLowering::SimplifyDemandedBits(
         return true;
       assert(!Known.hasConflict() && "Bits known to be one AND zero?");
 
-      Known = KnownBits::shl(Known,
-                             KnownBits::makeConstant(APInt(BitWidth, ShAmt)),
-                             /* NUW */ Op->getFlags().hasNoUnsignedWrap(),
-                             /* NSW */ Op->getFlags().hasNoSignedWrap());
+      Known =
+          KnownBits::shl(Known, KnownBits::makeConstant(APInt(BitWidth, ShAmt)),
+                         /* NUW */ Op->getFlags().hasNoUnsignedWrap(),
+                         /* NSW */ Op->getFlags().hasNoSignedWrap());
 
       // Attempt to avoid multi-use ops if we don't need anything from them.
       if (!InDemandedMask.isAllOnes() || !DemandedElts.isAllOnes()) {

``````````

</details>


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


More information about the llvm-commits mailing list