clang/AMDGPU: Assume denormals are enabled for the default target.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 13 Apr 2020 13:15:48 +0000 (09:15 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 15 Apr 2020 13:17:26 +0000 (09:17 -0400)
commit3a612450508b314b7a6f4db142d0c619031d760e
tree9435131217c543f4590c5200c98f6c02d7cac2fc
parent9289f34390daa07b60af07fdd0576ad52001e0a5
clang/AMDGPU: Assume denormals are enabled for the default target.

Since the default logic was based on having fast denormal/fma
features, and the default target has no features, we assumed flushing
by default. This fixes incorrectly assuming flushing in builds for
"generic" IR libraries.

The handling for no specified --cuda-gpu-arch in HIP is kind of
broken. Somewhere else forces a default target of gfx803, which does
not enable denormal handling by default. We don't see this default
switching here, so you'll end up with a different denormal mode
depending on whether you explicitly requested gfx803, or used it by
default.
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/test/Driver/cl-denorms-are-zero.cl
clang/test/Driver/cuda-flush-denormals-to-zero.cu