[PATCH] D83081: [InstSimplify] Simplify comparison between zext(x) and sext(x)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 13:31:10 PDT 2020


nikic created this revision.
nikic added reviewers: spatel, lebedev.ri, xbolva00.
Herald added subscribers: llvm-commits, javed.absar, hiraditya.
Herald added a project: LLVM.

This is picking up a loose thread from D69006 <https://reviews.llvm.org/D69006>: We can simplify `(zext x) ule (sext x)` and `(zext x) sge (sext x)` to true, with various permutations. Oddly, SCEV knows about this identity, but nothing on the IR level does.

Alive is happy: https://gist.github.com/nikic/7bd5e2ce0dda5ef4c3e712a707f5d0f7


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83081

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83081.275216.patch
Type: text/x-patch
Size: 5109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200702/f4946f70/attachment.bin>


More information about the llvm-commits mailing list