[llvm] [InstCombine] Infer exact for lshr by cttz (PR #136696)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 08:58:06 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
index c39b7dae4..4faa719fa 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
@@ -994,12 +994,12 @@ static bool setShiftFlags(BinaryOperator &I, const SimplifyQuery &Q) {
       I.setIsExact();
       return true;
     }
-    //Fix #131444
+    // Fix #131444
     if (auto *Cttz = dyn_cast<IntrinsicInst>(I.getOperand(1))) {
       if (Cttz->getIntrinsicID() == Intrinsic::cttz &&
           Cttz->getOperand(0) == I.getOperand(0)) {
         if (auto *Const = dyn_cast<ConstantInt>(Cttz->getOperand(1))) {
-          if (Const->isOne()) {  
+          if (Const->isOne()) {
             I.setIsExact();
             return true;
           }

``````````

</details>


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


More information about the llvm-commits mailing list