[PATCH] Fix shl folding in DAG combiner.

Andrea Di Biagio Andrea_DiBiagio at sn.scee.net
Mon Jun 22 08:39:37 PDT 2015


Hi Pawel,

The change looks good to me.
You can simplify the test case (see comment below).

Thanks,
Andrea


================
Comment at: test/CodeGen/X86/fold-vector-shl-crash.ll:4-8
@@ +3,7 @@
+;CHECK-LABEL: test
+define void @test() {
+  %S = shufflevector <2 x i256> zeroinitializer, <2 x i256> <i256 -1, i256 -1>, <2 x i32> <i32 0, i32 2>
+  %B = shl <2 x i256> %S, <i256 -1, i256 -1> ; DAG Combiner crashes here
+  br label %Loop
+
+Loop:                                             ; preds = %Loop, %0
----------------
if you define @test as a function returning a <2 x i256> vector value, then you can get rid of basic block 'Loop' and simply return %B.
Basically, the loop is not needed to reproduce the crash in the dag combiner.

http://reviews.llvm.org/D10602

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list