diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-26 11:43:37 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-26 11:43:37 +0000 |
commit | 39f2bebf415d2e8c8cc439aeb40fff5c23e9c8c1 (patch) | |
tree | ecedb67b42786e2c7debe8e53aec9e641423f3ce /llvm/lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | 352f59879522c059f98c853e04f50fd7e46acee5 (diff) | |
download | bcm5719-llvm-39f2bebf415d2e8c8cc439aeb40fff5c23e9c8c1.tar.gz bcm5719-llvm-39f2bebf415d2e8c8cc439aeb40fff5c23e9c8c1.zip |
[InstCombine] Refactor OptimizeOverflowCheck; NFCI
Extract method to compute overflow based on binop and signedness,
and then make the result handling code generic. This extends the
always-overflow handling to signed muls, but has currently no effect,
as we don't compute always overflow for them (thus NFC).
llvm-svn: 361721
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 123025bbccf..434b0d59121 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -692,7 +692,7 @@ public: } OverflowResult computeOverflowForSignedMul(const Value *LHS, - const Value *RHS, + const Value *RHS, const Instruction *CxtI) const { return llvm::computeOverflowForSignedMul(LHS, RHS, DL, &AC, CxtI, &DT); } @@ -720,6 +720,10 @@ public: return llvm::computeOverflowForSignedSub(LHS, RHS, DL, &AC, CxtI, &DT); } + OverflowResult computeOverflow( + Instruction::BinaryOps BinaryOp, bool IsSigned, + Value *LHS, Value *RHS, Instruction *CxtI) const; + /// Maximum size of array considered when transforming. uint64_t MaxArraySizeForCombine; |