[PATCH] D152251: [clang][CodeGen] Fix GPU-specific attributes being dropped by bitcode linking

Pierre van Houtryve via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 06:50:14 PDT 2023


Pierre-vh marked 2 inline comments as done.
Pierre-vh added inline comments.


================
Comment at: clang/test/CodeGenCUDA/link-builtin-bitcode-gpu-attrs-preserved.cu:34
+// CHECK: define {{.*}} i32 @do_intrin_stuff() #[[ATTR:[0-9]+]]
+// CHECK: attributes #[[ATTR]] = {{.*}} "target-features"="+gfx11-insts"
+
----------------
arsenm wrote:
> arsenm wrote:
> > Also should make sure target-cpu was set
> Did this previously receive the target-features spam implied by the target?
> Did this previously receive the target-features spam implied by the target?

I think it did, the attributes were filled with things like "+gfx9-insts", etc.

> Do we know why internalize keeps the target-cpu attribute but non-internalize does not?

PropagateAttrs is only set for -mlink-builtin-bitcode, see CompilerInvocation.cpp at 1888 (where OPT_mlink_builtin_bitcode is processed)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152251



More information about the cfe-commits mailing list