[PATCH] D48287: [HIP] Support -fcuda-flush-denormals-to-zero for amdgcn
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 13 19:56:49 PDT 2018
yaxunl added a comment.
In https://reviews.llvm.org/D48287#1138262, @tra wrote:
> 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.
https://reviews.llvm.org/D48287
More information about the cfe-commits
mailing list