[PATCH] D139213: [llvm][CUDA] Make NVVM Reflect pass look inside ptr casting

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 12:00:20 PST 2022


tra added inline comments.


================
Comment at: llvm/test/CodeGen/NVPTX/nvvm-reflect-cast.ll:16
+; COMMON-NOT: call i32 @__nvvm_reflect
+  %reflect = tail call i32 bitcast (i32 (i8*)* @__nvvm_reflect to i32 (i8 addrspace(4)*)*)(i8 addrspace(4)* noundef getelementptr inbounds ([12 x i8], [12 x i8] addrspace(4)* @"$str", i64 0, i64 0))
+; SM20: ret i32 200  
----------------
Interesting. 

Wouldn't it be better/easier to generate ASC(4->0) of the string argument instead of casting the  `__nvvm_reflect` type?
Or declare an overload of __nvvm_reflect() accepting the pointer in AS(4)?

I'm OK with this change, but I want to understand the full picture, and have the motivation/context for the change recorded. Otherwise it's not clear why one would need this at all.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139213



More information about the llvm-commits mailing list