Test source: git
Source: <stdin> ---------------------------------------- define i32 @foo(i32 %0) { %1: %2 = icmp sgt i32 %0, 2 %3 = add nsw i32 %0, 20 %4 = add i32 %0, 4294967276 %5 = select i1 %2, i32 %3, i32 %4 ret i32 %5 } => define i32 @foo(i32 %0) { %1: %2 = icmp sgt i32 %0, 2 %.v = select i1 %2, i32 20, i32 4294967276 %3 = add i32 %.v, %0 ret i32 %3 } Transformation seems to be correct! ---------------------------------------- define i8 @shrink_select(i1 %cond, i32 %x) { %0: %sel = select i1 %cond, i32 %x, i32 42 %trunc = trunc i32 %sel to i8 ret i8 %trunc } => define i8 @shrink_select(i1 %cond, i32 %x) { %0: %1 = trunc i32 %x to i8 %trunc = select i1 %cond, i8 %1, i8 42 ret i8 %trunc } Transformation seems to be correct! ---------------------------------------- define void @min_max_bitcast(<4 x float> %a, <4 x float> %b, * %ptr1, * %ptr2) { %0: %cmp = fcmp olt <4 x float> %a, %b %bc1 = bitcast <4 x float> %a to <4 x i32> %bc2 = bitcast <4 x float> %b to <4 x i32> %sel1 = select <4 x i1> %cmp, <4 x i32> %bc1, <4 x i32> %bc2 %sel2 = select <4 x i1> %cmp, <4 x i32> %bc2, <4 x i32> %bc1 store <4 x i32> %sel1, * %ptr1, align 16 store <4 x i32> %sel2, * %ptr2, align 16 ret void } => define void @min_max_bitcast(<4 x float> %a, <4 x float> %b, * %ptr1, * %ptr2) { %0: %cmp = fcmp olt <4 x float> %a, %b %sel1.v = select <4 x i1> %cmp, <4 x float> %a, <4 x float> %b %sel2.v = select <4 x i1> %cmp, <4 x float> %b, <4 x float> %a %1 = bitcast * %ptr1 to * store <4 x float> %sel1.v, * %1, align 16 %2 = bitcast * %ptr2 to * store <4 x float> %sel2.v, * %2, align 16 ret void } Transformation doesn't verify! ERROR: Timeout ---------------------------------------- define i32 @foo2(i32 %0, i32 %1) { %2: %3 = icmp sgt i32 %0, 2 %4 = add nsw i32 %0, %1 %5 = sub nsw i32 %0, %1 %6 = select i1 %3, i32 %4, i32 %5 ret i32 %6 } => define i32 @foo2(i32 %0, i32 %1) { %2: %3 = icmp sgt i32 %0, 2 %4 = sub i32 0, %1 %.p = select i1 %3, i32 %1, i32 %4 %5 = add i32 %.p, %0 ret i32 %5 } Transformation doesn't verify! ERROR: Timeout ---------------------------------------- define i64 @test43(i32 %a) { %0: %a_ext = sext i32 %a to i64 %is_a_nonnegative = icmp sgt i32 %a, 4294967295 %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 0 ret i64 %max } => define i64 @test43(i32 %a) { %0: %a_ext = sext i32 %a to i64 %1 = icmp sgt i64 %a_ext, 0 %max = select i1 %1, i64 %a_ext, i64 0 ret i64 %max } Transformation seems to be correct! ---------------------------------------- define <2 x i32> @scalar_select_of_vectors_sext(<2 x i1> %cca, i1 %ccb) { %0: %ccax = sext <2 x i1> %cca to <2 x i32> %r = select i1 %ccb, <2 x i32> %ccax, <2 x i32> { 0, 0 } ret <2 x i32> %r } => define <2 x i32> @scalar_select_of_vectors_sext(<2 x i1> %cca, i1 %ccb) { %0: %narrow = select i1 %ccb, <2 x i1> %cca, <2 x i1> { 0, 0 } %r = sext <2 x i1> %narrow to <2 x i32> ret <2 x i32> %r } Transformation seems to be correct! ---------------------------------------- define i16 @t7(i32 %a) { %0: %1 = icmp slt i32 %a, 4294934528 %2 = trunc i32 %a to i16 %3 = select i1 %1, i16 %2, i16 32768 ret i16 %3 } => define i16 @t7(i32 %a) { %0: %1 = icmp slt i32 %a, 4294934528 %2 = select i1 %1, i32 %a, i32 4294934528 %3 = trunc i32 %2 to i16 ret i16 %3 } Transformation doesn't verify! ERROR: Timeout ---------------------------------------- define i32 @abs_nabs_x01(i32 %x) { %0: %cmp = icmp sgt i32 %x, 4294967295 %sub = sub nsw i32 0, %x %cond = select i1 %cmp, i32 %sub, i32 %x %cmp1 = icmp sgt i32 %cond, 4294967295 %sub16 = sub nsw i32 0, %cond %cond18 = select i1 %cmp1, i32 %cond, i32 %sub16 ret i32 %cond18 } => define i32 @abs_nabs_x01(i32 %x) { %0: %1 = abs i32 %x, 0 ret i32 %1 } Transformation seems to be correct! ---------------------------------------- define <2 x i32> @abs_nabs_x01_vec(<2 x i32> %x) { %0: %cmp = icmp sgt <2 x i32> %x, { 4294967295, 4294967295 } %sub = sub nsw <2 x i32> { 0, 0 }, %x %cond = select <2 x i1> %cmp, <2 x i32> %sub, <2 x i32> %x %cmp1 = icmp sgt <2 x i32> %cond, { 4294967295, 4294967295 } %sub16 = sub nsw <2 x i32> { 0, 0 }, %cond %cond18 = select <2 x i1> %cmp1, <2 x i32> %cond, <2 x i32> %sub16 ret <2 x i32> %cond18 } => define <2 x i32> @abs_nabs_x01_vec(<2 x i32> %x) { %0: %1 = abs <2 x i32> %x, 0 ret <2 x i32> %1 } Transformation seems to be correct! ---------------------------------------- define i32 @test30(i32 %x, i32 %y) { %0: %cmp = icmp sgt i32 %x, %y %cond = select i1 %cmp, i32 %x, i32 %y %cmp5 = icmp sgt i32 %cond, %x %retval = select i1 %cmp5, i32 %cond, i32 %x ret i32 %retval } => define i32 @test30(i32 %x, i32 %y) { %0: %cmp = icmp sgt i32 %x, %y %cond = select i1 %cmp, i32 %x, i32 %y ret i32 %cond } Transformation doesn't verify! ERROR: Target's return value is more undefined Example: i32 %x = #x7fffffff (2147483647) i32 %y = undef Source: i1 %cmp = any i32 %cond = any i1 %cmp5 = #x0 (0) i32 %retval = #x7fffffff (2147483647) Target: i1 %cmp = #x0 (0) i32 %cond = #x00000400 (1024) Source value: #x7fffffff (2147483647) Target value: #x00000400 (1024) ------------------- SMT STATS ------------------- Num queries: 40 Num invalid: 0 Num skips: 0 Num trivial: 38 (48.7%) Num timeout: 3 (7.5%) Num errors: 0 (0.0%) Num SAT: 11 (27.5%) Num UNSAT: 26 (65.0%) Alive2: Transform doesn't verify; aborting!
+ : 'RUN: at line 4' + /home/nlopes/alive2/build/opt-alive.sh -instcombine -S + /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/select_meta.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/select_meta.ll
NOTE: This test would pass if undef didn't exist!