Open
Description
let's take this function:
define i32 @f(ptr %0) {
%2 = load i32, ptr %0, align 4, !range !0
%3 = load i32, ptr %0, align 4
%4 = add i32 1206154280, %3
ret i32 %4
}
!0 = !{i32 1, i32 2, i32 3, i32 4}
both the risc64 and aarch64 backends lower it to something that does an or
instead of an add
:
f:
lw a0, 0(a0)
lui a1, 294471
addi a1, a1, 1064
or a0, a0, a1
ret
this would work fine if it was %2
that was getting added, but it's %3
. if the range invariant isn't respected by the data in memory %2
harmlessly gets poison, but this doesn't allow us to infer anything about %3
cc @nunoplopes