[PATCH] D28883: DAG: Recognize no-signed-zeros-fp-math attribute

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 18:20:59 PST 2017


jlebar added inline comments.


================
Comment at: include/llvm/Target/TargetOptions.h:161
 
+    /// NoSignedZerosFPMath - This flag is enabled when the
+    /// -enable-no-signed-zeros-fp-math is specified on the command line. This
----------------
"when the -foo flag is specified" or "when -foo is specified"


================
Comment at: lib/Target/TargetMachine.cpp:91
+  if (Options.UnsafeFPMath) {
+    // Should this imply the others?
+    Options.NoSignedZerosFPMath = true;
----------------
Personally I'd prefer to do this in a separate patch, and to make a reasonable attempt at updating our documentation to say that this implies the others.  It was only after working on these flags for a few weeks that I even realized that UnsafeFPMath implies the others in IR (and therefore that it should imply the others elsewhere).

I even went as far as to add a separate unsafe-fp-math flag to XLA separate from the fast-math flag.  Oops.  :)


================
Comment at: test/CodeGen/AMDGPU/fsub.ll:115
+; SI: v_subrev_f32_e32 [[SUB:v[0-9]+]], {{v[0-9]+}}, {{v[0-9]+}}
+; SI: v_xor_b32_e32 v{{[0-9]+}}, 0x80000000, [[SUB]]
+define void @v_fneg_fsub_nsz_false_attribute_f32(float addrspace(1)* %out, float addrspace(1)* %in) #1 {
----------------
Can we add a (brief ok) comment explaining why this one gets an xor but the others don't?


https://reviews.llvm.org/D28883





More information about the llvm-commits mailing list