Don't update NoTrappingFPMath and FPDenormalMode in resetTargetOptions

We'd like to remove this whole function, because these are properties of
functions, not the target as a whole. These two are easy to remove
because they are only used for emitting ARM build attributes, which
expects them to represent the defaults for the whole module, not just
the last function generated.

This is needed to get correct build attributes when using IPRA on ARM,
because IPRA causes resetTargetOptions to get called before
ARMAsmPrinter::emitAttributes.

Differential revision: https://reviews.llvm.org/D64929

llvm-svn: 366562
This commit is contained in:
Oliver Stannard 2019-07-19 10:37:37 +00:00
parent cf2aca0aae
commit 8780c0dda2
2 changed files with 1 additions and 12 deletions

View File

@ -63,18 +63,6 @@ void TargetMachine::resetTargetOptions(const Function &F) const {
RESET_OPTION(NoInfsFPMath, "no-infs-fp-math");
RESET_OPTION(NoNaNsFPMath, "no-nans-fp-math");
RESET_OPTION(NoSignedZerosFPMath, "no-signed-zeros-fp-math");
RESET_OPTION(NoTrappingFPMath, "no-trapping-math");
StringRef Denormal =
F.getFnAttribute("denormal-fp-math").getValueAsString();
if (Denormal == "ieee")
Options.FPDenormalMode = FPDenormal::IEEE;
else if (Denormal == "preserve-sign")
Options.FPDenormalMode = FPDenormal::PreserveSign;
else if (Denormal == "positive-zero")
Options.FPDenormalMode = FPDenormal::PositiveZero;
else
Options.FPDenormalMode = DefaultOptions.FPDenormalMode;
}
/// Returns the code generation relocation model. The choices are static, PIC,

View File

@ -5,6 +5,7 @@
; functions have inconsistent values, and that a default is returned.
; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s
; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 -enable-ipra | FileCheck %s
; CHECK: .eabi_attribute 20, 1