-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
Description
Alive newsema accepts this optimization:
Pre: isPowerOf2(%a)
%a = shl i4 1, %x
%b = select 1, %x, %a
%c = icmp ult %b, 4
=>
%c = true
See also http://rise4fun.com/Alive/U4o
LLVM's isKnownToBeAPowerOfTwo analysis is always true for %a, no matter what is known about %x. In other words, the precondition should not constrain %x at all. This is allowed by LLVM because the analysis is not required to be accurate when its input is poison, which it will be in any case where the optimization is not a refinement.
Reactions are currently unavailable