llvm-project/llvm/lib
Nikita Popov 8db5143b1a [InstCombine] Optimize overflow check base on uadd.with.overflow result
Fix for https://bugs.llvm.org/show_bug.cgi?id=40846.

This adds a combine for cases where a (a + b) < a style overflow
check is performed, but with a + b being the result of
uadd.with.overflow, so the overflow result is also already available
and we can just use it. Subsequently GVN/CSE will deduplicate the extracts.

We can run into this situation if you have both a uadd.with.overflow
and a manual add + overflow check in the same function (on the same
operands), in which case GVN will rewrite the add to the with.overflow
result and leave you with this pattern.

The implementation is a bit ugly because I'm handling the various
canonicalization edge cases.

This does not yet handle the negated version of this pattern.

Differential Revision: https://reviews.llvm.org/D58644
2019-12-11 20:52:04 +01:00
..
Analysis [ValueTracking] Pointer is known nonnull after load/store 2019-12-11 20:32:29 +01:00
AsmParser [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
BinaryFormat [AIX] Emit TOC entries for ASM printing 2019-11-27 17:20:55 -05:00
Bitcode [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Bitstream [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CodeGen [SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpression() 2019-12-11 13:30:39 -05:00
DebugInfo [DebugInfo] Fix printing of DW_LNS_set_isa 2019-12-11 13:38:41 +00:00
Demangle Revert "Add some missing includes to MicrosoftDemangle.cpp (PR44217)" 2019-12-04 11:10:07 -08:00
ExecutionEngine [ORC] Remove the automagic Main JITDylib fram ExecutionSession. 2019-12-05 01:36:49 -08:00
Frontend [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h 2019-12-10 00:10:09 -06:00
FuzzMutate [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Fuzzer
IR Verifier: Check frame-pointer attribute values 2019-12-11 19:53:49 +05:30
IRReader [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
LTO [Remarks][ThinLTO] Use the correct file extension based on the format 2019-12-02 13:04:43 -08:00
LineEditor [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Linker [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
MC [BUG-FIX][XCOFF] fixed a bug of XCOFFObjectFile.cpp when there is padding at the last csect of a sections 2019-12-10 11:14:49 -05:00
MCA [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Object [Object][RISCV] Resolve R_RISCV_32_PCREL 2019-11-21 23:34:05 +00:00
ObjectYAML [ELF] Support for PT_GNU_PROPERTY in header and tools 2019-12-04 15:38:12 +00:00
Option [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Passes [SCEV] Make SCEV verification available from command line with new PM 2019-12-02 13:08:20 +07:00
ProfileData Revert "[Coverage] Revise format to reduce binary size" 2019-12-04 10:35:14 -08:00
Remarks [Remarks] Allow empty temporary remark files 2019-11-22 15:58:12 -08:00
Support [Support] Add TimeTraceScope constructor without detail arg 2019-12-11 14:32:21 +00:00
TableGen [TableGen] Add bang-operators !getop and !setop. 2019-12-11 12:05:22 +00:00
Target Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=Off builds after D65958 and D70450 2019-12-11 11:04:03 -08:00
Testing
TextAPI [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
ToolDrivers [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Transforms [InstCombine] Optimize overflow check base on uadd.with.overflow result 2019-12-11 20:52:04 +01:00
WindowsManifest Revert "Temporarily revert "build: avoid hardcoding the libxml2 library name"" 2019-12-03 09:27:14 -08:00
XRay [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CMakeLists.txt [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h 2019-12-10 00:10:09 -06:00
LLVMBuild.txt [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h 2019-12-10 00:10:09 -06:00