From 07f335128410ca2dbb4b78050132ecd070e2e425 Mon Sep 17 00:00:00 2001 From: "Kevin P. Neal" Date: Thu, 14 May 2020 11:57:19 -0700 Subject: [strictfp] Replace dangling strictfp attrs with nobuiltin In preparation for a patch that will enforce new rules for the usage of the strictfp attribute, this patch introduces auto-upgrade behavior that will replace the strictfp attribute on callsites with nobuiltin if the enclosing function declaration doesn't also have the strictfp attribute. This auto-upgrade isn't being performed on .ll files because that would prevent us from writing a test for the forthcoming verifier behavior. Differential Revision: https://reviews.llvm.org/D70096 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 2f9331e..a428416 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3002,6 +3002,7 @@ Error BitcodeReader::globalCleanup() { return error("Malformed global initializer set"); // Look for intrinsic functions which need to be upgraded at some point + // and functions that need to have their function attributes upgraded. for (Function &F : *TheModule) { MDLoader->upgradeDebugIntrinsics(F); Function *NewFn; @@ -3012,6 +3013,8 @@ Error BitcodeReader::globalCleanup() { // loaded in the same LLVMContext (LTO scenario). In this case we should // remangle intrinsics names as well. RemangledIntrinsics[&F] = Remangled.getValue(); + // Look for functions that rely on old function attribute behavior. + UpgradeFunctionAttributes(F); } // Look for global variables which need to be renamed. @@ -5376,6 +5379,9 @@ Error BitcodeReader::materialize(GlobalValue *GV) { } } + // Look for functions that rely on old function attribute behavior. + UpgradeFunctionAttributes(*F); + // Bring in any functions that this function forward-referenced via // blockaddresses. return materializeForwardReferencedFunctions(); -- cgit v1.1