aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2024-12-04 10:53:04 +0000
committerGitHub <noreply@github.com>2024-12-04 10:53:04 +0000
commitecbe4d1e360e25c0634a3a62fbd01e8df5bb0c1b (patch)
treeac8568fcdcbbb3e430a3f552df8118170d94c87c /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parenta30f7e190b8a4b6cdb9d9c050be4af660f237931 (diff)
downloadllvm-ecbe4d1e360e25c0634a3a62fbd01e8df5bb0c1b.zip
llvm-ecbe4d1e360e25c0634a3a62fbd01e8df5bb0c1b.tar.gz
llvm-ecbe4d1e360e25c0634a3a62fbd01e8df5bb0c1b.tar.bz2
[IR] Allow fast math flags on fptrunc and fpext (#115894)
This consists of: * Make these instructions part of FPMathOperator. * Adjust bitcode/ir readers/writers to expect fast math flags on these instructions. * Make IRBuilder set the fast math flags on these instructions. * Update langref and release notes. * Update a bunch of tests. Some of these are due to InstCombineCasts incorrectly adding fast math flags to fptrunc, which will be fixed in a later patch.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index a585a24..85c6fad 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -5197,6 +5197,11 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
if (Record[OpNum] & (1 << bitc::TIO_NO_SIGNED_WRAP))
cast<TruncInst>(I)->setHasNoSignedWrap(true);
}
+ if (isa<FPMathOperator>(I)) {
+ FastMathFlags FMF = getDecodedFastMathFlags(Record[OpNum]);
+ if (FMF.any())
+ I->setFastMathFlags(FMF);
+ }
}
InstructionList.push_back(I);