Test source: git
Source: <stdin> ---------------------------------------- define i16 @foo(i16 %x) { %0: %t1 = and i16 %x, 255 %t2 = zext i16 %t1 to i32 %t3 = icmp ult i32 %t2, 255 %t4 = select i1 %t3, i32 %t2, i32 255 %t5 = trunc i32 %t4 to i16 %t6 = and i16 %t5, 255 ret i16 %t6 } => define i16 @foo(i16 %x) { %0: %t1 = and i16 %x, 255 ret i16 %t1 } Transformation seems to be correct! ---------------------------------------- define i16 @min_max_clamp(i16 %x) { %0: %a = icmp sgt i16 %x, 63488 %b = select i1 %a, i16 %x, i16 63488 %c = icmp slt i16 %b, 2047 %d = select i1 %c, i16 %b, i16 2047 %e = add i16 %d, 1 ret i16 %e } => define i16 @min_max_clamp(i16 %x) { %0: %a = icmp sgt i16 %x, 63488 %b = select i1 %a, i16 %x, i16 63488 %c = icmp slt i16 %b, 2047 %d = select i1 %c, i16 %b, i16 2047 %e = add nsw i16 %d, 1 ret i16 %e } Transformation doesn't verify! ERROR: Target is more poisonous than source Example: i16 %x = undef Source: i1 %a = any i16 %b = any i1 %c = any i16 %d = any i16 %e = any Target: i1 %a = #x1 (1) i16 %b = #x0000 (0) i1 %c = #x1 (1) i16 %d = #x7fff (32767) i16 %e = poison Source value: any Target value: poison ------------------- SMT STATS ------------------- Num queries: 12 Num invalid: 0 Num skips: 0 Num trivial: 16 (57.1%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 3 (25.0%) Num UNSAT: 9 (75.0%) Alive2: Transform doesn't verify; aborting!
+ : 'RUN: at line 2' + /home/nlopes/alive2/build/opt-alive.sh -S -instcombine + /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/max_known_bits.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/max_known_bits.ll
NOTE: This test would pass if undef didn't exist!