For the IR
define i32 @src(i32 noundef %x) {
%r = add i32 %x, -1
%17 = icmp sgt i32 %r, -1
tail call void @llvm.assume(i1 %17)
ret i32 %r
}
CorrelatedValuePropagationPass will fold %17 to true from the knowledge of llvm.assume, which should be inappropriate, because it drops the information from llvm.assume after optimization:
define i32 @src(i32 noundef %x) {
%r = add i32 %x, -1
ret i32 %r
}
Link: https://godbolt.org/z/6q3zWcbjn
For the IR
CorrelatedValuePropagationPasswill fold%17totruefrom the knowledge ofllvm.assume, which should be inappropriate, because it drops the information fromllvm.assumeafter optimization:Link: https://godbolt.org/z/6q3zWcbjn