[PATCH] D65530: [InstCombine] foldXorOfICmps(): don't give up on non-single-use ICmp's if all users are freely invertible

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 10:30:58 PDT 2019


lebedev.ri updated this revision to Diff 214662.
lebedev.ri marked 5 inline comments as done.
lebedev.ri added a comment.

Addressed review notes, thanks for taking a look!

In D65530#1625426 <https://reviews.llvm.org/D65530#1625426>, @spatel wrote:

> In D65530#1625331 <https://reviews.llvm.org/D65530#1625331>, @lebedev.ri wrote:
>
> > In D65530#1625321 <https://reviews.llvm.org/D65530#1625321>, @spatel wrote:
> >
> > > Make sure I didn't typo this translation, but I think I'm seeing extra instructions for vectors with this transform on x86 and aarch64:
> > >  ...
> >
> >
> > Sure, but that is irrelevant. D65765 <https://reviews.llvm.org/D65765> improves upon both of them:
> >  https://godbolt.org/z/-UIddL
>
>
> Ok, but I wouldn't call it irrelevant if this patch is viewed/committed independently. For example, if D65765 <https://reviews.llvm.org/D65765> had to be reverted, we'd probably want to revert this too, so there's no perf regression potential.


Right.
What i meant is, every other variant of the pattern in `canonicalize-clamp-with-select-of-constant-threshold-pattern.ll`
is already 'folded'/bad, so so this only handles an edge-case, not generally worsens things.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65530

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/test/Transforms/InstCombine/canonicalize-clamp-with-select-of-constant-threshold-pattern.ll
  llvm/test/Transforms/InstCombine/xor-of-icmps-with-extra-uses.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65530.214662.patch
Type: text/x-patch
Size: 13922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190812/d1547f6f/attachment.bin>


More information about the llvm-commits mailing list