Extended Description
See https://groups.google.com/forum/#!topic/llvm-dev/90lQByG6teg for the conversation.
Here's a minimum reproducing example:
define i32 @foo(i32*) {
entry:
%1 = load i32, i32* %0
%2 = icmp eq i32 %1, 3
call void @llvm.assume(i1 %2)
%3 = load i32, i32* %0
ret i32 %3
}
Both -early-cse and -gvn independently simplify this IR to:
define i32 @foo(i32*) {
entry:
%1 = load i32, i32* %0
ret i32 %1
}
Instead of:
define i32 @foo(i32*) {
entry:
ret i32 3
}