[llvm] [InstCombine] Allow folding cross-lane operations into PHIs/selects (PR #164388)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Oct 21 03:36:21 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 origin/main HEAD --extensions cpp,h -- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp llvm/lib/Transforms/InstCombine/InstCombineInternal.h llvm/lib/Transforms/InstCombine/InstructionCombining.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 4a9128a33..669d4f0f4 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -4015,7 +4015,8 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
           continue;
         // Don't replace a scalar select with a more expensive vector select if
         // we can't simplify both arms of the select.
-        bool SimplifyBothArms = !Op->getType()->isVectorTy() && II->getType()->isVectorTy();
+        bool SimplifyBothArms =
+            !Op->getType()->isVectorTy() && II->getType()->isVectorTy();
         if (Instruction *R = FoldOpIntoSelect(
                 *II, Sel, /*FoldWithMultiUse=*/false, SimplifyBothArms))
           return R;
``````````
</details>
https://github.com/llvm/llvm-project/pull/164388
    
    
More information about the llvm-commits
mailing list