[PATCH] D69826: [hip] Enable pointer argument lowering through coercing type.

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 14:29:27 PST 2019


arsenm added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:1308-1310
+  if (isa<llvm::PointerType>(SrcTy) &&
+      isa<llvm::PointerType>(DstTy) &&
+      SrcTy->getPointerAddressSpace() != DstTy->getPointerAddressSpace()) {
----------------
I would somewhat prefer 2 dyn_cast and getAddressSpace, this is essentially isa + cast combo


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:7719
+      // Arrary types.
+      if (auto ATy = dyn_cast<llvm::ArrayType>(Ty)) {
+        auto T = ATy->getElementType();
----------------
No tests with arrays or structs?

It's also not immediately obvious to me that this optimization is still valid if the pointer is buried in a struct


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69826





More information about the cfe-commits mailing list