[PATCH] D64929: Don't update NoTrappingFPMath and FPDenormalMode in resetTargetOptions

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 09:15:03 PDT 2019


ostannard created this revision.
ostannard added reviewers: MatzeB, SjoerdMeijer.
Herald added subscribers: hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64929

Files:
  llvm/lib/Target/TargetMachine.cpp
  llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll


Index: llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll
===================================================================
--- llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll
+++ llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll
@@ -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
 
Index: llvm/lib/Target/TargetMachine.cpp
===================================================================
--- llvm/lib/Target/TargetMachine.cpp
+++ llvm/lib/Target/TargetMachine.cpp
@@ -63,18 +63,6 @@
   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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64929.210596.patch
Type: text/x-patch
Size: 1467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190718/3954ef5a/attachment.bin>


More information about the llvm-commits mailing list