[PATCH] D92095: [DAG] Legalize abs(x) -> smax(x,sub(0,x)) iff smax/sub are legal
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 25 05:37:12 PST 2020
RKSimon created this revision.
RKSimon added reviewers: spatel, lebedev.ri, nemanjai, craig.topper.
Herald added subscribers: steven.zhang, pengfei, kbarton, hiraditya.
Herald added a project: LLVM.
RKSimon requested review of this revision.
If smax() is legal, this is likely to result in smaller codegen expansion for abs(x) than the xor(add,ashr) method.
This is also what powerpc has been doing for its abs implementation, so it lets us get rid of a load of custom lowering code there (and which was never updated when they added smax lowering).
Alive2 check : https://alive2.llvm.org/ce/z/xRk3cD
rG LLVM Github Monorepo
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8290 bytes
Desc: not available
More information about the llvm-commits