summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2018-02-19 19:22:28 +0000
committerSteven Wu <stevenwu@apple.com>2018-02-19 19:22:28 +0000
commit545d34a2724ef158d79c5e37dc817ceea9fbd1d8 (patch)
tree4c9b275b7730412e6dc9f3fd60517647552a6d3f /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent65207923f66d2813e5170f4f90002ece718f133f (diff)
downloadbcm5719-llvm-545d34a2724ef158d79c5e37dc817ceea9fbd1d8.tar.gz
bcm5719-llvm-545d34a2724ef158d79c5e37dc817ceea9fbd1d8.zip
bitcode support change for fast flags compatibility
Summary: The discussion and as per need, each vendor needs a way to keep the old fast flags and the new fast flags in the auto upgrade path of the IR upgrader. This revision addresses that issue. Patched by Michael Berg Reviewers: qcolombet, hans, steven_wu Reviewed By: qcolombet, steven_wu Subscribers: dexonsmith, vsk, mehdi_amini, andrewrk, MatzeB, wristow, spatel Differential Revision: https://reviews.llvm.org/D43253 llvm-svn: 325525
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp16
1 files changed, 8 insertions, 8 deletions
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