diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-07 16:40:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-07 16:40:21 +0000 |
commit | f067d584a81ae771d301304ea885e55e2de8ee9a (patch) | |
tree | 9e3fa2842b0884048e3cf0937db440d77d115168 /lib/Bitcode | |
parent | 163a84bbce69947aa314760e6068c704fc0df7a0 (diff) | |
download | external_llvm-f067d584a81ae771d301304ea885e55e2de8ee9a.zip external_llvm-f067d584a81ae771d301304ea885e55e2de8ee9a.tar.gz external_llvm-f067d584a81ae771d301304ea885e55e2de8ee9a.tar.bz2 |
implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index a744d83..d812a6d 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1085,13 +1085,16 @@ bool BitcodeReader::ParseConstants() { if (Record.size() >= 4) { if (Opc == Instruction::Add || Opc == Instruction::Sub || - Opc == Instruction::Mul) { + Opc == Instruction::Mul || + Opc == Instruction::Shl) { if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP)) Flags |= OverflowingBinaryOperator::NoSignedWrap; if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) Flags |= OverflowingBinaryOperator::NoUnsignedWrap; } else if (Opc == Instruction::SDiv || - Opc == Instruction::UDiv) { + Opc == Instruction::UDiv || + Opc == Instruction::LShr || + Opc == Instruction::AShr) { if (Record[3] & (1 << bitc::PEO_EXACT)) Flags |= SDivOperator::IsExact; } @@ -1901,13 +1904,16 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { if (OpNum < Record.size()) { if (Opc == Instruction::Add || Opc == Instruction::Sub || - Opc == Instruction::Mul) { + Opc == Instruction::Mul || + Opc == Instruction::Shl) { if (Record[OpNum] & (1 << bitc::OBO_NO_SIGNED_WRAP)) cast<BinaryOperator>(I)->setHasNoSignedWrap(true); if (Record[OpNum] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) cast<BinaryOperator>(I)->setHasNoUnsignedWrap(true); } else if (Opc == Instruction::SDiv || - Opc == Instruction::UDiv) { + Opc == Instruction::UDiv || + Opc == Instruction::LShr || + Opc == Instruction::AShr) { if (Record[OpNum] & (1 << bitc::PEO_EXACT)) cast<BinaryOperator>(I)->setIsExact(true); } |