[llvm] r366562 - Don't update NoTrappingFPMath and FPDenormalMode in resetTargetOptions
Oliver Stannard via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 19 03:37:38 PDT 2019
Author: ostannard
Date: Fri Jul 19 03:37:37 2019
New Revision: 366562
URL: http://llvm.org/viewvc/llvm-project?rev=366562&view=rev
Log:
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
Modified:
llvm/trunk/lib/Target/TargetMachine.cpp
llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll
Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=366562&r1=366561&r2=366562&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Fri Jul 19 03:37:37 2019
@@ -63,18 +63,6 @@ void TargetMachine::resetTargetOptions(c
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,
Modified: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll?rev=366562&r1=366561&r2=366562&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll Fri Jul 19 03:37:37 2019
@@ -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
More information about the llvm-commits
mailing list