Details
Diff Detail
Event Timeline
Using OpenCL's flag for the purpose adds a *third* way we handle denormals flushing in clang. Now it would be HIP (which is CUDA-like) using OpenCL's flag for denormals instead of CUDA's one.
You could change AMDGPUTargetInfo::adjustTargetOptions() to use CGOpts.getLangOpts().CUDADeviceFlushDenormalsToZero instead. That would at least make HIP and CUDA do the same thing.
I think it would work better if we could coalesce CUDADeviceFlushDenormalsToZero and CodeGenOpts.FlushDenorm and, maybe move the flag to LangOpts , so we could use LangOpts.CUDAIsDevice.
Sorry for the delay.
CGOpts does not have member function getLangOpts(). It seems whereever we need to refer to LangOpts.CUDADeviceFlushDenormalsToZero, we can use Opts.FlushDenorm, but not true vice versa. Therefore if we want a unified option, Opts.FlushDenorm is a better choice.