[llvm] [CodeGenPrepare] Split x/select(cond,y,C) to select(cond,x/y,x/C) (PR #215967)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 23:36:08 PDT 2026
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 -- llvm/lib/CodeGen/CodeGenPrepare.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/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index b4d16793d..da5ac4d88 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -597,7 +597,8 @@ static bool splitDivRemBySelectDivisor(Instruction *I,
return false;
// If the select has more than one use, there's probably a sibling rem
- // sharing this divisor and splitting them separately would duplicate the division
+ // sharing this divisor and splitting them separately would duplicate the
+ // division
auto *Sel = dyn_cast<SelectInst>(I->getOperand(1));
if (!Sel || !Sel->hasOneUse())
return false;
@@ -673,7 +674,8 @@ static bool optimizeDivRemBySelectDivisor(BasicBlock *BB,
bool MadeChange = false;
Instruction *Next = &*BB->begin();
while (Next != nullptr) {
- // We may add instructions immediately after I but we want to skip over them.
+ // We may add instructions immediately after I but we want to skip over
+ // them.
Instruction *I = Next;
Next = Next->getNextNode();
``````````
</details>
https://github.com/llvm/llvm-project/pull/215967
More information about the llvm-commits
mailing list