[llvm] [VPlan] Introduce ExitPhi VPInstruction, use to create phi for FOR. (PR #94760)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 05:27:34 PDT 2024


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 c16e37867ca838621ff9233f4d1a58207c3e99db 09411edf9ec9e0c0a4a95060dd057bf128f3ac02 -- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/VPlan.h llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index ecd6da11b7..241676a535 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -608,13 +608,15 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
         State.get(getOperand(0), Part, /* IsScalar */ true);
     Value *IncomingFromOtherPreds =
         State.get(getOperand(1), Part, /* IsScalar */ true);
-    auto *NewPhi = Builder.CreatePHI(IncomingFromOtherPreds->getType(), 2, Name);
+    auto *NewPhi =
+        Builder.CreatePHI(IncomingFromOtherPreds->getType(), 2, Name);
     BasicBlock *VPlanPred =
         State.CFG
             .VPBB2IRBB[cast<VPBasicBlock>(getParent()->getSinglePredecessor())];
     NewPhi->addIncoming(IncomingFromVPlanPred, VPlanPred);
-    for (auto *OtherPred: predecessors(Builder.GetInsertBlock())) {
-      assert(OtherPred != VPlanPred && "VPlan predecessors should not be connected yet");
+    for (auto *OtherPred : predecessors(Builder.GetInsertBlock())) {
+      assert(OtherPred != VPlanPred &&
+             "VPlan predecessors should not be connected yet");
       NewPhi->addIncoming(IncomingFromOtherPreds, OtherPred);
     }
     return NewPhi;

``````````

</details>


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


More information about the llvm-commits mailing list