llvm-project/llvm/lib
Sanjay Patel e8bf0f79bd [InstCombine] canonicalize more unsigned saturated add with 'not'
Yet another pattern variation suggested by:
https://bugs.llvm.org/show_bug.cgi?id=14613

There are 8 more potential commuted patterns here on top of the
8 that were already handled (rL354221, rL354276, rL354393).
We have the obvious commute of the 'add' + commute of the cmp
predicate/operands (ugt/ult) + commute of the select operands:

Name: base
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %x, %y
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: ugt
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %y, %x
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %y, %x
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: ugt + commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %x, %y
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/den

llvm-svn: 354887
2019-02-26 15:18:49 +00:00
..
Analysis [Vectorizer] Add vectorization support for fixed smul/umul intrinsics 2019-02-25 15:42:02 +00:00
AsmParser Implementation of asm-goto support in LLVM 2019-02-08 20:48:56 +00:00
BinaryFormat [WebAssembly] clang-tidy (NFC) 2019-02-04 19:13:39 +00:00
Bitcode Implementation of asm-goto support in LLVM 2019-02-08 20:48:56 +00:00
CodeGen [DAG] Fix constant store folding to handle non-byte sizes. 2019-02-26 15:02:32 +00:00
DebugInfo [DebugInfo] Prep llvm-dwarfdump for typed DW5 ops. 2019-02-21 08:20:24 +00:00
Demangle Add missing include (cstdlib) to Demangle.h 2019-01-22 19:18:18 +00:00
ExecutionEngine [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
FuzzMutate [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
Fuzzer
IR [ThinLTO] Use defined node and edge order when dumping DOT file 2019-02-26 07:38:21 +00:00
IRReader [IRReader] Expose getLazyIRModule 2019-02-11 22:01:13 +00:00
LTO [ThinLTO] Detect partially split modules during the thin link 2019-02-14 21:22:50 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MC Fix "enumeral and non-enumeral type in conditional expression" gcc7 warning. NFCI. 2019-02-24 13:31:52 +00:00
MCA [MCA] Always check if scheduler resources are unavailable when reporting dispatch stalls. 2019-02-26 14:19:00 +00:00
Object Revert "Improve "llvm-nm -f sysv" output for Elf files" 2019-02-26 07:04:56 +00:00
ObjectYAML [yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags. 2019-02-26 14:14:49 +00:00
OptRemarks Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
Option Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Passes [HotColdSplit] Schedule splitting late to fix perf regression 2019-02-15 18:46:44 +00:00
ProfileData [llvm-cov] Fix llvm-cov on Windows and un-XFAIL test 2019-02-26 02:30:00 +00:00
Support VFS: Avoid some unnecessary std::string copies 2019-02-23 23:48:47 +00:00
TableGen [TblGen] Extend !if semantics through new feature !cond 2019-01-25 10:25:25 +00:00
Target [mips] Emit `.module softfloat` directive 2019-02-26 14:45:17 +00:00
Testing Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TextAPI Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ToolDrivers [llvm-ar][libObject] Fix relative paths when nesting thin archives. 2019-02-13 23:39:41 +00:00
Transforms [InstCombine] canonicalize more unsigned saturated add with 'not' 2019-02-26 15:18:49 +00:00
WindowsManifest Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
XRay Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00