[VPlan] Print result value for loads in VPWidenMemoryInst (NFC).
authorFlorian Hahn <flo@fhahn.com>
Mon, 9 Nov 2020 13:52:54 +0000 (13:52 +0000)
committerFlorian Hahn <flo@fhahn.com>
Mon, 9 Nov 2020 14:01:29 +0000 (14:01 +0000)
For loads, print the result value.

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

index 78e58c2..0656854 100644 (file)
@@ -928,8 +928,13 @@ void VPPredInstPHIRecipe::print(raw_ostream &O, const Twine &Indent,
 
 void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent,
                                            VPSlotTracker &SlotTracker) const {
-  O << "\"WIDEN "
-    << Instruction::getOpcodeName(getUnderlyingInstr()->getOpcode()) << " ";
+  O << "\"WIDEN ";
+
+  if (!isStore()) {
+    printAsOperand(O, SlotTracker);
+    O << " = ";
+  }
+  O << Instruction::getOpcodeName(getUnderlyingInstr()->getOpcode()) << " ";
 
   printOperands(O, SlotTracker);
 }
index ce819d2..1331442 100644 (file)
@@ -11,7 +11,7 @@ define void @print_call_and_memory(i64 %n, float* noalias %y, float* noalias %x)
 ; 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:       "WIDEN load ir<%arrayidx>\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:       "WIDEN store ir<%arrayidx2>, ir<%call>\l"