[PATCH] D46237: [DAGCombiner] rename function attribute for disabling ftrunc transform

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 11:26:56 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL331210: [DAGCombiner] rename function attribute for disabling ftrunc transform (authored by spatel, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D46237?vs=144482&id=144601#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46237

Files:
  llvm/trunk/docs/ReleaseNotes.rst
  llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/trunk/test/CodeGen/X86/ftrunc.ll


Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -10915,8 +10915,8 @@
   // unexpected results. Ie, programs may be relying on the platform-specific
   // undefined behavior when the float-to-int conversion overflows.
   const Function &F = DAG.getMachineFunction().getFunction();
-  Attribute CastWorkaround = F.getFnAttribute("fp-cast-overflow-workaround");
-  if (CastWorkaround.getValueAsString().equals("true"))
+  Attribute StrictOverflow = F.getFnAttribute("strict-float-cast-overflow");
+  if (StrictOverflow.getValueAsString().equals("false"))
     return SDValue();
 
   // We only do this if the target has legal ftrunc. Otherwise, we'd likely be
Index: llvm/trunk/docs/ReleaseNotes.rst
===================================================================
--- llvm/trunk/docs/ReleaseNotes.rst
+++ llvm/trunk/docs/ReleaseNotes.rst
@@ -64,8 +64,8 @@
 * Optimization of floating-point casts is improved. This may cause surprising
   results for code that is relying on the undefined behavior of overflowing 
   casts. The optimization can be disabled by specifying a function attribute:
-  "fp-cast-overflow-workaround"="true". This attribute may be created by the
-  clang option :option:`-ffp-cast-overflow-workaround`.
+  "strict-float-cast-overflow"="false". This attribute may be created by the
+  clang option :option:`-fno-strict-float-cast-overflow`.
   Code sanitizers can be used to detect affected patterns. The option for
   detecting this problem alone is "-fsanitize=float-cast-overflow":
 
Index: llvm/trunk/test/CodeGen/X86/ftrunc.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/ftrunc.ll
+++ llvm/trunk/test/CodeGen/X86/ftrunc.ll
@@ -356,9 +356,8 @@
   ret <4 x double> %r
 }
 
-; The attribute name is subject to change, but the fold may be
-; guarded to allow existing code to continue working based on its
-; assumptions of float->int overflow.
+; The fold may be guarded to allow existing code to continue 
+; working based on its assumptions of float->int overflow.
 
 define float @trunc_unsigned_f32_disable_via_attr(float %x) #1 {
 ; SSE2-LABEL: trunc_unsigned_f32_disable_via_attr:
@@ -413,5 +412,5 @@
   ret double %r
 }
 
-attributes #1 = { nounwind "fp-cast-overflow-workaround"="true" }
+attributes #1 = { nounwind "strict-float-cast-overflow"="false" }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46237.144601.patch
Type: text/x-patch
Size: 2541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/64544601/attachment.bin>


More information about the llvm-commits mailing list