summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-07 16:40:21 +0000
committerChris Lattner <sabre@nondot.org>2011-02-07 16:40:21 +0000
commita676c0fc77db9305ba4142e2d410a5bfd899017e (patch)
tree5f96a998c61efb7cad83735ee73f3cf37fb86a01 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent351762cda239e2bb90fb2084e546878fea90ebf6 (diff)
downloadbcm5719-llvm-a676c0fc77db9305ba4142e2d410a5bfd899017e.tar.gz
bcm5719-llvm-a676c0fc77db9305ba4142e2d410a5bfd899017e.zip
implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better. llvm-svn: 125006
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index a744d833026..d812a6d465c 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud