[llvm-branch-commits] [llvm] 4bc9b90 - [VPlan] Use VPValue and VPUser ops to print VPReplicateRecipe.

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Nov 29 10:39:14 PST 2020


Author: Florian Hahn
Date: 2020-11-29T18:28:27Z
New Revision: 4bc9b909d715157a2d04f32c32b828c23c1d4359

URL: https://github.com/llvm/llvm-project/commit/4bc9b909d715157a2d04f32c32b828c23c1d4359
DIFF: https://github.com/llvm/llvm-project/commit/4bc9b909d715157a2d04f32c32b828c23c1d4359.diff

LOG: [VPlan] Use VPValue and VPUser ops to print VPReplicateRecipe.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.cpp
    llvm/test/Transforms/LoopVectorize/vplan-printing.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 3b26d6b52efd..c51ed5e3e7db 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -966,8 +966,15 @@ void VPReductionRecipe::print(raw_ostream &O, const Twine &Indent,
 
 void VPReplicateRecipe::print(raw_ostream &O, const Twine &Indent,
                               VPSlotTracker &SlotTracker) const {
-  O << "\"" << (IsUniform ? "CLONE " : "REPLICATE ")
-    << VPlanIngredient(getUnderlyingInstr());
+  O << "\"" << (IsUniform ? "CLONE " : "REPLICATE ");
+
+  if (!getUnderlyingInstr()->getType()->isVoidTy()) {
+    printAsOperand(O, SlotTracker);
+    O << " = ";
+  }
+  O << Instruction::getOpcodeName(getUnderlyingInstr()->getOpcode()) << " ";
+  printOperands(O, SlotTracker);
+
   if (AlsoPack)
     O << " (S->V)";
 }

diff  --git a/llvm/test/Transforms/LoopVectorize/vplan-printing.ll b/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
index 21d236ac76b2..370fe8eee0f4 100644
--- a/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
+++ b/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
@@ -10,10 +10,10 @@ define void @print_call_and_memory(i64 %n, float* noalias %y, float* noalias %x)
 ; CHECK: N0 [label =
 ; CHECK-NEXT: "for.body:\n" +
 ; CHECK-NEXT:       "WIDEN-INDUCTION %iv = phi %iv.next, 0\l" +
-; CHECK-NEXT:       "CLONE %arrayidx = getelementptr %y, %iv\l" +
+; CHECK-NEXT:       "CLONE ir<%arrayidx> = getelementptr ir<%y>, ir<%iv>\l" +
 ; CHECK-NEXT:       "WIDEN ir<%lv> = load ir<%arrayidx>\l" +
 ; CHECK-NEXT:       "WIDEN-CALL ir<%call> = call @llvm.sqrt.f32(ir<%lv>)\l" +
-; CHECK-NEXT:       "CLONE %arrayidx2 = getelementptr %x, %iv\l" +
+; CHECK-NEXT:       "CLONE ir<%arrayidx2> = getelementptr ir<%x>, ir<%iv>\l" +
 ; CHECK-NEXT:       "WIDEN store ir<%arrayidx2>, ir<%call>\l"
 ; CHECK-NEXT:   ]
 
@@ -45,7 +45,7 @@ define void @print_widen_gep_and_select(i64 %n, float* noalias %y, float* noalia
 ; CHECK-NEXT:      "WIDEN ir<%cmp> = icmp ir<%arrayidx>, ir<%z>\l" +
 ; CHECK-NEXT:      "WIDEN-SELECT ir<%sel> = select ir<%cmp>, ir<1.000000e+01>, ir<2.000000e+01>\l" +
 ; CHECK-NEXT:      "WIDEN ir<%add> = fadd ir<%lv>, ir<%sel>\l" +
-; CHECK-NEXT:      "CLONE %arrayidx2 = getelementptr %x, %iv\l" +
+; CHECK-NEXT:      "CLONE ir<%arrayidx2> = getelementptr ir<%x>, ir<%iv>\l" +
 ; CHECK-NEXT:      "WIDEN store ir<%arrayidx2>, ir<%add>\l"
 ; CHECK-NEXT:   ]
 
@@ -75,7 +75,7 @@ define float @print_reduction(i64 %n, float* noalias %y) {
 ; CHECK-NEXT: "for.body:\n" +
 ; CHECK-NEXT:       "WIDEN-INDUCTION %iv = phi %iv.next, 0\l" +
 ; CHECK-NEXT:       "WIDEN-PHI %red = phi %red.next, 0.000000e+00\l" +
-; CHECK-NEXT:       "CLONE %arrayidx = getelementptr %y, %iv\l" +
+; CHECK-NEXT:       "CLONE ir<%arrayidx> = getelementptr ir<%y>, ir<%iv>\l" +
 ; CHECK-NEXT:       "WIDEN ir<%lv> = load ir<%arrayidx>\l" +
 ; CHECK-NEXT:       "REDUCE ir<%red.next> = ir<%red> + reduce.fadd (ir<%lv>)\l"
 ; CHECK-NEXT:   ]


        


More information about the llvm-branch-commits mailing list