File: test/Transforms/InstCombine/select-of-bittest.ll ``` define i32 @f_var2(i32 %arg, i32 %arg1) { %0: %tmp = and i32 %arg, 1 %tmp2 = icmp eq i32 %tmp, 0 %tmp3 = lshr i32 %arg, %arg1 %tmp4 = and i32 %tmp3, 1 %tmp5 = select i1 %tmp2, i32 %tmp4, i32 1 ret i32 %tmp5 } => define i32 @f_var2(i32 %arg, i32 %arg1) { %0: %1 = shl i32 1, %arg1 %2 = or i32 %1, 1 %3 = and i32 %2, %arg %4 = icmp ne i32 %3, 0 %tmp5 = zext i1 %4 to i32 ret i32 %tmp5 } Transformation doesn't verify! ERROR: Target is more poisonous than source Example: i32 %arg = #x00000001 (1) i32 %arg1 = poison Source: i32 %tmp = #x00000001 (1) i1 %tmp2 = #x0 (0) i32 %tmp3 = poison i32 %tmp4 = poison i32 %tmp5 = #x00000001 (1) Target: i32 %1 = poison i32 %2 = poison i32 %3 = poison i1 %4 = poison i32 %tmp5 = poison Source value: #x00000001 (1) Target value: poison ``` Relevant revision: https://reviews.llvm.org/D45108 The revision includes Alive proof, but its precondition wasn't encoded. I'll make a patch for this.
Made a patch here: https://reviews.llvm.org/D88432