Test source: git
Source: <stdin> ---------------------------------------- define i1 @test1(i32 %lhs, i32 %rhs) { %0: %xor = xor i32 %lhs, 5 %cmp1 = icmp eq i32 %xor, 10 %cmp2 = icmp eq i32 %xor, %rhs %sel = or i1 %cmp1, %cmp2 ret i1 %sel } => define i1 @test1(i32 %lhs, i32 %rhs) { %0: %xor = xor i32 %lhs, 5 %cmp1 = icmp eq i32 %xor, 10 %cmp2 = icmp eq i32 %xor, %rhs %sel = or i1 %cmp1, %cmp2 ret i1 %sel } Transformation seems to be correct! ---------------------------------------- define i1 @test1_logical(i32 %lhs, i32 %rhs) { %0: %xor = xor i32 %lhs, 5 %cmp1 = icmp eq i32 %xor, 10 %cmp2 = icmp eq i32 %xor, %rhs %sel = select i1 %cmp1, i1 1, i1 %cmp2 ret i1 %sel } => define i1 @test1_logical(i32 %lhs, i32 %rhs) { %0: %xor = xor i32 %lhs, 5 %cmp1 = icmp eq i32 %xor, 10 %cmp2 = icmp eq i32 %xor, %rhs %sel = or i1 %cmp1, %cmp2 ret i1 %sel } Transformation doesn't verify! ERROR: Target is more poisonous than source Example: i32 %lhs = #x0000000f (15) i32 %rhs = poison Source: i32 %xor = #x0000000a (10) i1 %cmp1 = #x1 (1) i1 %cmp2 = poison i1 %sel = #x1 (1) Target: i32 %xor = #x0000000a (10) i1 %cmp1 = #x1 (1) i1 %cmp2 = poison i1 %sel = poison Source value: #x1 (1) Target value: poison ------------------- SMT STATS ------------------- Num queries: 5 Num invalid: 0 Num skips: 0 Num trivial: 6 (54.5%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 3 (60.0%) Num UNSAT: 2 (40.0%)
+ : 'RUN: at line 2' + /home/nlopes/alive2/build/opt-alive.sh -instcombine -S + /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/prevent-cmp-merge.ll Alive2: Transform doesn't verify; aborting! FileCheck error: '<stdin>' is empty. FileCheck command line: /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/prevent-cmp-merge.ll