-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes
Description
In this playground the ternary_and
example (roughly x < 3 ? 0 : x & 2
) causes two redundant cmovx to be emitted. (They're redundant, as high bits of eax are already zeroed). The real world case I initially noticed this behaviour was using sub nuw
instead of and
. Here also high bits of eax should be zeroed (although opt
turns this sub nuw
into add
, losing nuw
annotation). This particular case is especially bad, since it uses movzx
within same register (which I've read is not eligible to mov-elimination).
Perhaps related: #56498
edit: Removed the cast
example and added zeroext
attribute to arguments.
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes