llvm/lib
Sanjay Patel 3d039197d7 [InstCombine] optimize unsigned icmp of increment
Allows LLVM to optimize sequences like the following:

%add = add nuw i32 %x, 1
%cmp = icmp ugt i32 %add, %y

Into:

%cmp = icmp uge i32 %x, %y

Previously, only signed comparisons were being handled.

Decrements could also be handled, but 'sub nuw %x, 1' is currently canonicalized to
'add %x, -1' in InstCombineAddSub, losing the nuw flag. Removing that canonicalization
seems like it might have far-reaching ramifications so I kept this simple for now.

Patch by Matti Niemenmaa!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:25:46 +00:00
..
Analysis [SCEV] Limit recursion depth of constant evolving. 2017-01-13 18:28:30 +00:00
AsmParser ASMParser: use range-based for loops (NFC) 2016-12-27 18:35:22 +00:00
Bitcode Remove unused lambda captures. NFC 2017-01-13 17:12:16 +00:00
CodeGen [GlobalISel] track predecessor mapping during switch lowering. 2017-01-13 23:11:37 +00:00
DebugInfo Add a variant of DWARFDie::find() and DWARFDie::findRecursively() that takes a llvm::ArrayRef<dwarf::Attribute>. 2017-01-13 22:32:12 +00:00
Demangle
ExecutionEngine RuntimeDyldELF: implement R_AARCH64_PREL64 reloc 2017-01-10 11:05:30 +00:00
Fuzzer [libFuzzer] remove dead code, NFC 2017-01-06 00:09:40 +00:00
IR [IR] Don't call assertModuleIsMaterialized in release builds 2017-01-13 06:26:18 +00:00
IRReader
LibDriver LibDriver: Allow resource files to be archive members. 2016-12-15 19:37:46 +00:00
LineEditor
Linker [ThinLTO] Import only necessary DICompileUnit fields 2016-12-12 16:09:30 +00:00
LTO Apply clang-tidy's performance-unnecessary-value-param to LLVM. 2017-01-13 14:39:03 +00:00
MC Apply clang-tidy's performance-unnecessary-value-param to LLVM. 2017-01-13 14:39:03 +00:00
Object Revert r291903 and r291898. Reason: they break check-lld on the bots. 2017-01-13 16:45:15 +00:00
ObjectYAML [ObjectYAML] Pull yaml2dwarf out of yaml2obj for reuse 2017-01-12 21:35:21 +00:00
Option
Passes [PM] Separate the LoopAnalysisManager from the LoopPassManager and move 2017-01-11 09:43:56 +00:00
ProfileData Resubmit "[PGO] Turn off comdat renaming in IR PGO by default" 2017-01-11 20:19:41 +00:00
Support Revert r291903 and r291898. Reason: they break check-lld on the bots. 2017-01-13 16:45:15 +00:00
TableGen [Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-04 02:02:05 +00:00
Target "Use" lambda captures which are otherwise only used in asserts. NFC 2017-01-13 21:02:41 +00:00
Transforms [InstCombine] optimize unsigned icmp of increment 2017-01-13 23:25:46 +00:00
XRay Avoid std::errc::protocol_* to appease mingw 2017-01-12 18:33:14 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt