[PATCH] D91120: [DAGCombine][PowerPC] Convert negated abs to trivial arithmetic ops
Jonas Paulsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 04:07:51 PST 2020
jonpa added a comment.
In D91120#2399901 <https://reviews.llvm.org/D91120#2399901>, @uweigand wrote:
> In D91120#2399776 <https://reviews.llvm.org/D91120#2399776>, @spatel wrote:
>
>> It seems strange that we would need to add a TLI hook to avoid regressing a target that has abs/nabs support in the ISA.
>> If I'm seeing it correctly, SystemZ relies on ISD::ABS being expanded and then pattern-matching the expansion back to `lpgr` for example. Could we change that target to declare ISD::ABS as legal and adjust the tablegen matching for it?
>
> That SystemZ code pre-dates the existence of the common ISD::ABS code by four years or so. I guess now that common code support ISD::ABS, we can change our back-end to use it instead of our own. @jonpa , can you have a look?
Yes, this seems to work: https://reviews.llvm.org/D91697. The new TLI hook is then not needed...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91120/new/
https://reviews.llvm.org/D91120
More information about the llvm-commits
mailing list