[InstSimplify] Simplify comparison between zext(x) and sext(x)
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 2 Jul 2020 19:35:40 +0000 (21:35 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 4 Jul 2020 09:03:00 +0000 (11:03 +0200)
commit3b671022e4518166fc5a72e88786db037fb7708c
treebb0583dc4255afebe7d2ef1cf8272d8760a2e1b7
parent93ccb8eb52f7e7474afaa782fcc6c52bd8c1494b
[InstSimplify] Simplify comparison between zext(x) and sext(x)

This is picking up a loose thread from 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.

Differential Revision: https://reviews.llvm.org/D83081
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/cmp_ext.ll