[PATCH] D68408: [InstCombine] Negator - sink sinkable negations

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 12 09:04:48 PDT 2020


lebedev.ri added a comment.

In D68408#1976790 <https://reviews.llvm.org/D68408#1976790>, @spatel wrote:

> In D68408#1976039 <https://reviews.llvm.org/D68408#1976039>, @lebedev.ri wrote:
>
> > 1. add `Abs` IR instruction (i think not)
>
>
> Is the answer the same for an intrinsic?


Ack, i meant instruction/intrinsic interchangeably here.

> The more we see these kinds of problems, the more I wish we had created intrinsics for abs/smin/smax/umin/umax long ago. We keep trying to work around this limitation in IR, but it doesn't seem worth it. We have abs() functions in source and an abs node in codegen, so we're creating intermediate ops that don't exist on either side of IR.

Note that we similarly don't have saturating multiplication, overflowing/saturating left-shift.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68408/new/

https://reviews.llvm.org/D68408





More information about the llvm-commits mailing list