[PATCH] D145579: [Clang][Flang][AMDGPU] Add support for AMDGPU to Flang driver

Dominik Adamski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 28 06:00:25 PDT 2023


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


================
Comment at: flang/lib/Frontend/FrontendActions.cpp:149
+    err.print(errorMsg.data(), llvm::errs());
+    unsigned diagID = ci.getDiagnostics().getCustomDiagID(
+        clang::DiagnosticsEngine::Error, "Unsupported feature ID");
----------------
awarzynski wrote:
> Are you able to add a test that will trigger this?
Yes, please check the newest patch.


================
Comment at: flang/test/Driver/target-cpu-features.f90:59
+! CHECK-AMDGPU-R600: "-fc1" "-triple" "r600-unknown-unknown"
+! CHECK-AMDGPU-R600-SAME: "-target-cpu" "cayman"
----------------
awarzynski wrote:
> Hm, there aren't any "implicit" target features here.
You will see them in MLIR code:
https://reviews.llvm.org/D146612#change-ciOHRHlq0yvL (file: mlir/test/Target/LLVMIR/openmp-llvm.mlir )
Clang also does not list these features in command line for AMDGPU. Slightly different situation is for example for ARM target. Clang list 3 options as -cc1 options and it attaches 4 target options to the generated LLVM IR:
```
clang --target=aarch64 t.c -S -emit-llvm -v 
// I see in the command line 3 explicit target features:
// +neon,  +v8a ,  -fmv
// However, generated t.ll contains 4 target features:
"target-features"="+fp-armv8,+neon,+v8a,-fmv"
// It looks like target feature +fp-armv8 is implicit
```


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

https://reviews.llvm.org/D145579



More information about the cfe-commits mailing list