1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/lib
Sanjay Patel 55ceba42f0 [InstCombine] Fold nuw left-shifts in ugt/ule comparisons.
This transforms

%a = shl nuw %x, c1
%b = icmp {ugt|ule} %a, c0

into

%b = icmp {ugt|ule} %x, (c0 >> c1)

z3:

(declare-const x (_ BitVec 64))
(declare-const c0 (_ BitVec 64))
(declare-const c1 (_ BitVec 64))

(push)
(assert (= x (bvlshr (bvshl x c1) c1)))  ; nuw
(assert (not (= (bvugt (bvshl x c1) c0)
                (bvugt x
                       (bvlshr c0 c1)))))
(check-sat)
(get-model)
(pop)

(push)
(assert (= x (bvlshr (bvshl x c1) c1)))  ; nuw
(assert (not (= (bvule (bvshl x c1) c0)
                (bvule x
                       (bvlshr c0 c1)))))
(check-sat)
(get-model)
(pop)

Patch by bryant!

Differential Revision: https://reviews.llvm.org/D25913

llvm-svn: 285729
2016-11-01 19:19:29 +00:00
..
Analysis [TBAA] Use wrapper objects instead of raw getOperand s; NFC 2016-11-01 02:58:30 +00:00
AsmParser DebugInfo: preparation to implement DW_AT_alignment 2016-10-20 00:13:12 +00:00
Bitcode Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface. 2016-11-01 01:18:57 +00:00
CodeGen BranchRelaxation: Expand unconditional branches first 2016-11-01 18:34:00 +00:00
DebugInfo Define DbiStreamBuilder::addSectionMap. 2016-10-31 17:38:56 +00:00
Demangle
ExecutionEngine Fix cross-endianness RuntimeDyld relocation for ARM 2016-10-20 22:15:56 +00:00
Fuzzer [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
IR DebugInfo: make DW_TAG_atomic_type valid 2016-10-31 19:09:38 +00:00
IRReader
LibDriver
LineEditor
Linker Typo: nomed struct -> named struct 2016-10-19 20:10:03 +00:00
LTO [ThinLTO] Disable importing and other cross-module optis at -O0 2016-10-31 22:12:21 +00:00
MC Reverting back r285355: "Update .debug_line section version information to match DWARF version", while I'm investigating a test failure. 2016-10-27 23:20:19 +00:00
Object [RISCV] Add RISC-V ELF defines 2016-11-01 16:59:37 +00:00
ObjectYAML [RISCV] Add RISC-V ELF defines 2016-11-01 16:59:37 +00:00
Option
Passes Conditionally eliminate library calls where the result value is not used 2016-10-18 21:36:27 +00:00
ProfileData Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 15:02:18 +00:00
Support [RISCV] Recognise riscv32 and riscv64 in triple parsing code 2016-11-01 16:47:54 +00:00
TableGen
Target [Hexagon] Rename operand/predicate names for unshifted integers 2016-11-01 19:02:10 +00:00
Transforms [InstCombine] Fold nuw left-shifts in ugt/ule comparisons. 2016-11-01 19:19:29 +00:00
CMakeLists.txt
LLVMBuild.txt