[llvm] f0d7627 - [VPlan] Print result value for loads in VPWidenMemoryInst (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 06:02:49 PST 2020
Author: Florian Hahn
Date: 2020-11-09T14:01:29Z
New Revision: f0d76275cb15052d48f650c2f44221f46cd754a7
URL: https://github.com/llvm/llvm-project/commit/f0d76275cb15052d48f650c2f44221f46cd754a7
DIFF: https://github.com/llvm/llvm-project/commit/f0d76275cb15052d48f650c2f44221f46cd754a7.diff
LOG: [VPlan] Print result value for loads in VPWidenMemoryInst (NFC).
For loads, print the result value.
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 78e58c24f994..0656854c3b36 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -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);
}
diff --git a/llvm/test/Transforms/LoopVectorize/vplan-printing.ll b/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
index ce819d20e813..1331442efbb8 100644
--- a/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
+++ b/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
@@ -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"
More information about the llvm-commits
mailing list