[clang] [Driver] Enable -ftime-trace for CUDA/HIP device compilation (PR #179701)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 09:40:24 PST 2026
================
@@ -63,6 +63,41 @@
// UNUSED-NEXT: warning: argument unused during compilation: '-ftime-trace-verbose'
// UNUSED-NOT: warning:
+/// Test HIP offloading: -ftime-trace should generate traces for both host and device.
+// RUN: %clang -### -ftime-trace -ftime-trace-granularity=0 -x hip d/a.cpp --offload-arch=gfx906 --offload-arch=gfx90a \
+// RUN: -c -o e/a.o --target=x86_64-linux-gnu 2>&1 \
+// RUN: | FileCheck %s --check-prefix=HIP
+// HIP-DAG: -cc1{{.*}} "-triple" "amdgcn-amd-amdhsa"{{.*}} "-ftime-trace=e/a-hip-amdgcn-amd-amdhsa-gfx906.json"
----------------
MaskRay wrote:
`-DAG` check lines are quite difficult to debug. Prefer to remove `-DAG` since the order should be deterministic.
https://github.com/llvm/llvm-project/pull/179701
More information about the cfe-commits
mailing list