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
Paths
| Differential D92102
[DAG] Legalize abs(x) -> umin(x,sub(0,x)) iff umin/sub are legal ClosedPublic Authored by RKSimon on Nov 25 2020, 7:40 AM.
Details
Summary 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
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Nov 25 2020, 8:28 AM Comment Actions Closed by rG9c86c5e8add23a29fb19f7c0ac366a2063a5073a - I just forgot to tag the commit message
Revision Contents
Diff 307612 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/X86/abs.ll
llvm/test/CodeGen/X86/combine-abs.ll
llvm/test/CodeGen/X86/viabs.ll
|