[PATCH] D21899: [InstCombine] extend (select X, C1, C2 --> ext X) to vectors

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 2 11:20:05 PDT 2016


eli.friedman added a comment.

Generally looks fine.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:965
@@ +964,3 @@
+      (CondVal->getType()->isVectorTy() == SI.getType()->isVectorTy())) {
+
+    // select C, 1, 0 -> zext C to int
----------------
Extra newline.

================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:968
@@ +967,3 @@
+    if (*FalseC == 0 && *TrueC == 1)
+      return new ZExtInst(CondVal, SI.getType());
+
----------------
Won't this crash if SI.getType() is `<4 x i1>`?


http://reviews.llvm.org/D21899





More information about the llvm-commits mailing list