[PATCH] Fix instruction creation in scalarizePHI

Benjamin Kramer benny.kra at gmail.com
Fri May 24 05:13:54 PDT 2013


  Only minor nits, feel free to commit with them fixed.


================
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 ]
----------------
Maybe also check that the extractelement instruction is present?

================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.:151
@@ -151,1 +150,3 @@
+          B0->getOperand(opId), Elt, B0->getOperand(opId)->getName() + ".Elt",
+          B0);
       Value *newPHIUser = InsertNewInstWith(
----------------
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.


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



More information about the llvm-commits mailing list