[llvm] [LoopVectorize] Fix crash with GC statepoint in epilogue vectorization (PR #179459)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 05:42:26 PST 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/Transforms/Vectorize/LoopVectorize.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/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 07d083e0b..fd559600f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9370,12 +9370,13 @@ static void fixScalarResumeValuesFromBypass(BasicBlock *BypassBlock, Loop *L,
       // TODO: Directly add as extra operand to the VPResumePHI recipe.
       Inc->setIncomingValueForBlock(BypassBlock, V);
     } else {
-      // If the incoming value from preheader is not a PHI node (e.g., a constant
-      // in functions with GC statepoint), we need to create a PHI node in the
-      // preheader that merges the original value and the bypass value, then update
-      // IVPhi to use this new PHI node.
+      // If the incoming value from preheader is not a PHI node (e.g., a
+      // constant in functions with GC statepoint), we need to create a PHI node
+      // in the preheader that merges the original value and the bypass value,
+      // then update IVPhi to use this new PHI node.
       PHINode *NewPhi = PHINode::Create(IncomingFromPH->getType(), 2,
-                                        IVPhi->getName() + ".phi.merge", PH->getFirstNonPHIIt());
+                                        IVPhi->getName() + ".phi.merge",
+                                        PH->getFirstNonPHIIt());
       for (BasicBlock *Pred : predecessors(PH)) {
         if (Pred == BypassBlock)
           NewPhi->addIncoming(V, BypassBlock);

``````````

</details>


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


More information about the llvm-commits mailing list