[PATCH] D85929: [InstSimplify] Fold min/max intrinsic based on icmp of operands

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 13:17:31 PDT 2020


nikic created this revision.
nikic added reviewers: spatel, lebedev.ri, aqjune.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
nikic requested review of this revision.

This is a reboot of D84655 <https://reviews.llvm.org/D84655>, now performing the inner icmp simplification query without undef folds.

It should be possible to handle the current foldMinMaxSharedOp() fold based on this, by moving the logic into icmp of min/max instead, making it more general. We can't drop the folds for constant operands, because those also allow undef, which we exclude here.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85929

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/maxmin_intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85929.285481.patch
Type: text/x-patch
Size: 7346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200813/bce55e28/attachment.bin>


More information about the llvm-commits mailing list