[PATCH] Fix instruction creation in scalarizePHI

Joey Gouly joey.gouly at arm.com
Fri May 24 05:32:02 PDT 2013


  Thanks for the quick review Benjamin!

  Committed r182639.


================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.:151
@@ -151,1 +150,3 @@
+          B0->getOperand(opId), Elt, B0->getOperand(opId)->getName() + ".Elt",
+          B0);
       Value *newPHIUser = InsertNewInstWith(
----------------
Benjamin Kramer wrote:
> I think it would be better to also use InsertNewInstWith here. The IRBuilder and InsertNewInstWith add the new instruction to InstCombine's worklist so it becomes a candidate for further simplification, a plain Create doesn't.
Good point, changed.

================
Comment at: test/Transforms/InstCombine/vec_phi_extract.ll:33
@@ +32,3 @@
+for.cond:
+; CHECK: phi i32
+  %input_2.addr.0 = phi <3 x i32> [ %input_2, %entry ], [ %div45, %for.body ]
----------------
Benjamin Kramer wrote:
> Maybe also check that the extractelement instruction is present?
Done.


http://llvm-reviews.chandlerc.com/D857



More information about the llvm-commits mailing list