[InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 10 Apr 2015 21:07:09 +0000 (21:07 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 10 Apr 2015 21:07:09 +0000 (21:07 +0000)
commit8aca90e5b6322f60c631e635083e877caac4c590
tree085d19c5c4c2564cbf5aa67ef738b1871202eb53
parent79db0a6fd9cb86475e560a177729ad8bf2b45714
[InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.

Summary:
This change moves creating calls to `llvm.uadd.with.overflow` from
InstCombine to CodeGenPrep.  Combining overflow check patterns into
calls to the said intrinsic in InstCombine inhibits optimization because
it introduces an intrinsic call that not all other transforms and
analyses understand.

Depends on D8888.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8889

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234638 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/PatternMatch.h
lib/CodeGen/CodeGenPrepare.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/CodeGen/X86/add-of-carry.ll
test/Transforms/CodeGenPrepare/overflow-intrinsics.ll [new file with mode: 0644]
test/Transforms/InstCombine/overflow.ll