summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp16
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp16
2 files changed, 17 insertions, 15 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index f38f7df0803..582298136ae 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1047,19 +1047,21 @@ static Comdat::SelectionKind getDecodedComdatSelectionKind(unsigned Val) {
static FastMathFlags getDecodedFastMathFlags(unsigned Val) {
FastMathFlags FMF;
- if (0 != (Val & FastMathFlags::AllowReassoc))
+ if (0 != (Val & bitc::UnsafeAlgebra))
+ FMF.setFast();
+ if (0 != (Val & bitc::AllowReassoc))
FMF.setAllowReassoc();
- if (0 != (Val & FastMathFlags::NoNaNs))
+ if (0 != (Val & bitc::NoNaNs))
FMF.setNoNaNs();
- if (0 != (Val & FastMathFlags::NoInfs))
+ if (0 != (Val & bitc::NoInfs))
FMF.setNoInfs();
- if (0 != (Val & FastMathFlags::NoSignedZeros))
+ if (0 != (Val & bitc::NoSignedZeros))
FMF.setNoSignedZeros();
- if (0 != (Val & FastMathFlags::AllowReciprocal))
+ if (0 != (Val & bitc::AllowReciprocal))
FMF.setAllowReciprocal();
- if (0 != (Val & FastMathFlags::AllowContract))
+ if (0 != (Val & bitc::AllowContract))
FMF.setAllowContract(true);
- if (0 != (Val & FastMathFlags::ApproxFunc))
+ if (0 != (Val & bitc::ApproxFunc))
FMF.setApproxFunc();
return FMF;
}
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 15c06f5506a..832f494bc77 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1334,19 +1334,19 @@ static uint64_t getOptimizationFlags(const Value *V) {
Flags |= 1 << bitc::PEO_EXACT;
} else if (const auto *FPMO = dyn_cast<FPMathOperator>(V)) {
if (FPMO->hasAllowReassoc())
- Flags |= FastMathFlags::AllowReassoc;
+ Flags |= bitc::AllowReassoc;
if (FPMO->hasNoNaNs())
- Flags |= FastMathFlags::NoNaNs;
+ Flags |= bitc::NoNaNs;
if (FPMO->hasNoInfs())
- Flags |= FastMathFlags::NoInfs;
+ Flags |= bitc::NoInfs;
if (FPMO->hasNoSignedZeros())
- Flags |= FastMathFlags::NoSignedZeros;
+ Flags |= bitc::NoSignedZeros;
if (FPMO->hasAllowReciprocal())
- Flags |= FastMathFlags::AllowReciprocal;
+ Flags |= bitc::AllowReciprocal;
if (FPMO->hasAllowContract())
- Flags |= FastMathFlags::AllowContract;
+ Flags |= bitc::AllowContract;
if (FPMO->hasApproxFunc())
- Flags |= FastMathFlags::ApproxFunc;
+ Flags |= bitc::ApproxFunc;
}
return Flags;
@@ -3196,7 +3196,7 @@ void ModuleBitcodeWriter::writeBlockInfo() {
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LHS
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // RHS
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // opc
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); // flags
+ Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); // flags
if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID, Abbv) !=
FUNCTION_INST_BINOP_FLAGS_ABBREV)
llvm_unreachable("Unexpected abbrev ordering!");
OpenPOWER on IntegriCloud