I found an interesting regression in the function<eager-inv>(instcombine)
pass.
The code is checking for integer overflow on division and should look something like this after optimizing:
%cmp1.i = icmp eq i64 %b, -1
%cmp2.i = icmp eq i64 %a, -9223372036854775808
%overflow.i = and i1 %cmp2.i, %cmp1.i
br i1 %overflow.i, label %overflow-exit, label %divide
Instead, when using function<eager-inv>(instcombine)
I get this:
%cmp1.i = icmp ne i64 %b, -1
%cmp2.i = icmp ne i64 %a, -9223372036854775808
%0 = or i1 %cmp2.i, %cmp1.i
tail call void @llvm.assume(i1 %0)
Then when this code goes through the unit tests for this overflow, it breaks. I looked through some of the InstCombine code but it wasn’t immediately obvious where this was being changed. Anyone have any thoughts on how I could fix this?