Fix denormal-fp-math flag and attribute interaction
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 11 Mar 2020 21:12:20 +0000 (17:12 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 27 Mar 2020 19:48:58 +0000 (12:48 -0700)
commit0ab5b5b8581d9f2951575f7245824e6e4fc57dec
tree5334b5ee4a349e9250c036fbcbf2fb9468be0657
parentc579a5b1d92a9bc2046d00ee2d427832e0f5ddec
Fix denormal-fp-math flag and attribute interaction

Make these behave the same way unsafe-fp-math and co. The command line
flag should add the attribute to functions that do not already have
it, and leave existing attributes. The attribute is the actual
implementation, but the flag is useful in some testing situations.

AMDGPU has a variety of tests with denormals enabled/disabled that
would require a painful level of test duplication without a flag. This
doesn't expose setting the separate input/output modes, or add a flag
for the f32 version yet.

Tests will be included in future patch.
llvm/include/llvm/CodeGen/CommandFlags.h
llvm/include/llvm/Target/TargetOptions.h
llvm/lib/CodeGen/CommandFlags.cpp
llvm/lib/Target/ARM/ARMAsmPrinter.cpp