================
@@ -5743,9 +5743,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
     } else if (Triple.getArch() == llvm::Triple::x86_64) {
       Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
                               CM);
-    } else if (Triple.isNVPTX()) {
-      // NVPTX does not care about the code model and will accept whatever 
works
-      // for the host.
+    } else if (Triple.isNVPTX() || Triple.isAMDGPU()) {
+      // NVPTX/AMDGPU does not care about the code model and will accept
+      // whatever works for the host.
       Ok = true;
     }
     if (Ok) {
----------------
yxsamliu wrote:

neither nvptx or amdgpu backend accepts -mcmodel=tiny and kernel. the backends 
will fail with error:

fatal error: error in backend: Target does not support the tiny CodeModel

for tiny and kernel, we should not pass them to clang -cc1 and emit a warning 
that they are ignored.

https://github.com/llvm/llvm-project/pull/70760
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to