Closed
Description
here's a function:
define i3 @f(i3 %0) {
%2 = mul i3 %0, %0
%3 = mul i3 %2, %0
%4 = mul i3 %3, %0
%5 = mul nsw i3 %4, %0
ret i3 %5
}
reassociate seems to be getting it wrong:
Johns-MacBook-Pro:reduce regehr$ ~/alive2-regehr/build/alive-tv reduced.ll -passes=reassociate
----------------------------------------
define i3 @f(i3 %#0) {
#1:
%#2 = mul i3 %#0, %#0
%#3 = mul i3 %#2, %#0
%#4 = mul i3 %#3, %#0
%#5 = mul nsw i3 %#4, %#0
ret i3 %#5
}
=>
define i3 @f(i3 %#0) {
#1:
%#2 = mul i3 %#0, %#0
%#3 = mul nsw i3 %#2, %#0
ret i3 %#3
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
i3 %#0 = #x6 (6, -2)
Source:
i3 %#2 = #x4 (4, -4)
i3 %#3 = #x0 (0)
i3 %#4 = #x0 (0)
i3 %#5 = #x0 (0)
Target:
i3 %#2 = #x4 (4, -4)
i3 %#3 = poison
Source value: #x0 (0)
Target value: poison
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
Johns-MacBook-Pro:reduce regehr$
cc @nunoplopes