aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-03-28 20:11:52 +0000
committerAdam Nemet <anemet@apple.com>2017-03-28 20:11:52 +0000
commitcd847a8f3059d87cc6c5343d2dae7b25aacac322 (patch)
treef36fad6a6759edb3ee14c09c9defdf0e05be25c4 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent16af53a3955e8e8b93ccc1d4674e0e5613835961 (diff)
downloadllvm-cd847a8f3059d87cc6c5343d2dae7b25aacac322.zip
llvm-cd847a8f3059d87cc6c5343d2dae7b25aacac322.tar.gz
llvm-cd847a8f3059d87cc6c5343d2dae7b25aacac322.tar.bz2
[IR] Add AllowContract to FastMathFlags
-ffp-contract=fast does not currently work with LTO because it's passed as a TargetOption to the backend rather than in the IR. This adds it to FastMathFlags. This is toward fixing PR25721 Differential Revision: https://reviews.llvm.org/D31164 llvm-svn: 298939
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 4bb0e9f..4198d8f 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -971,6 +971,8 @@ static FastMathFlags getDecodedFastMathFlags(unsigned Val) {
FMF.setNoSignedZeros();
if (0 != (Val & FastMathFlags::AllowReciprocal))
FMF.setAllowReciprocal();
+ if (0 != (Val & FastMathFlags::AllowContract))
+ FMF.setAllowContract(true);
return FMF;
}