1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test
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 Improved cost model for FDIV and FSQRT, by Andrew Tischenko 2016-10-31 12:10:53 +00:00
Assembler
Bindings
Bitcode
BugPoint
CodeGen [AMDGPU] Check if type transforms to i16 (VI+) when getting AMDGPUISD::FFBH_U32 2016-11-01 17:49:33 +00:00
DebugInfo DebugInfo: make DW_TAG_atomic_type valid 2016-10-31 19:09:38 +00:00
Demangle
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation [asan] Move instrumented null-terminated strings to a special section, LLVM part 2016-10-31 18:51:58 +00:00
Integer
JitListener
LibDriver
Linker
LTO
MC [PPC] add absolute difference altivec instructions and matching intrinsics 2016-10-31 19:47:52 +00:00
Object More additional error checks for invalid Mach-O files when 2016-10-31 20:29:48 +00:00
ObjectYAML
Other
SymbolRewriter
TableGen
ThinLTO/X86 [ThinLTO] Disable importing and other cross-module optis at -O0 2016-10-31 22:12:21 +00:00
tools [ThinLTO] Disable importing and other cross-module optis at -O0 2016-10-31 22:12:21 +00:00
Transforms [InstCombine] Fold nuw left-shifts in ugt/ule comparisons. 2016-11-01 19:19:29 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
TestRunner.sh