[llvm] [clang] [AMDGPU] Add code model (#70760) test for amdgpu target. (PR #71019)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 29 04:45:02 PST 2023


================
@@ -5767,12 +5768,23 @@ 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() || Triple.isAMDGPU()) {
-      // NVPTX/AMDGPU does not care about the code model and will accept
+    } else if (Triple.isNVPTX()) {
+      // NVPTX does not care about the code model and will accept
       // whatever works for the host.
       Ok = true;
+    } else if (Triple.isAMDGPU()) {
+      // AMDGPU does not care about the code model.
+      Ok = true;
+      // AMDGPU target ignores CM tiny and kernel.
+      if (CM == "tiny" || CM == "kernel") {
+        Skip = true;
+        D.Diag(diag::warn_ignored_clang_option)
+            << A->getSpelling() << CM << TripleStr;
+      }
----------------
arsenm wrote:

This is doing more than adding the test?

https://github.com/llvm/llvm-project/pull/71019


More information about the cfe-commits mailing list