HomePhabricator

[DAG] Legalize abs(x) -> umin(x,sub(0,x)) iff umin/sub are legal

Authored by RKSimon on Nov 25 2020, 10:05 AM.

Description

[DAG] Legalize abs(x) -> umin(x,sub(0,x)) iff umin/sub are legal

If umin() is legal, this is likely to result in smaller codegen expansion for abs(x) than the xor(add,ashr) method.

Followup to D92095

Alive2: https://alive2.llvm.org/ce/z/8nuX6s https://alive2.llvm.org/ce/z/q2hB9w

Details

Committed
RKSimonNov 25 2020, 10:06 AM
Parents
rGcf1c774d6ace: [FastISel] Flush local value map on ever instruction
Branches
Unknown
Tags
Unknown