[PATCH] D99201: [HIP] Diagnose unaligned atomic for amdgpu

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 07:44:42 PDT 2023


yaxunl marked 2 inline comments as done.
yaxunl added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:7215
+    // warnings as errors.
+    CmdArgs.push_back("-Werror=atomic-alignment");
   }
----------------
tra wrote:
> Should it be done from `HIPAMDToolChain::addClangWarningOptions` ?
> 
> That's where Darwin does similar propotion from a waring to an error.
will do. Since this option is shared between all AMDGPU toolchains, I will add it to AMDGPUToolChain::addClangWarningOptions and let the derived toolchains call it.


================
Comment at: clang/test/Driver/hip-options.hip:144
+
+// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
+// RUN:   --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=WARN-ATOMIC %s
----------------
MaskRay wrote:
> Prefer `--target=` to deprecated (since 3.x) `-target `
will fix


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99201/new/

https://reviews.llvm.org/D99201



More information about the cfe-commits mailing list