[PATCH] D89909: [SYCL] Implement SYCL address space attributes handling

Alexey Bader via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 02:18:28 PDT 2021


bader marked an inline comment as done.
bader added inline comments.


================
Comment at: clang/lib/Basic/Targets/SPIR.h:140
+    // space must be compatible with the generic address space
+    return LangAS::sycl_global;
+  }
----------------
Anastasia wrote:
> This needs a language guard too?
I can re-write this method to avoid using language address space:

```
  llvm::Optional<LangAS> getConstantAddressSpace() const override {
    return getLangASFromTargetAS(1);
  }
```

Does it look okay to you?

I don't think we need a language guard here as this hook is already guarded by users. E.g. https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CodeGenModule.cpp#L4137-L4159.
Adding language guards for `TargetInfo::getConstantAddressSpace` method will require API change similar to `adjust` method i.e. explicit `LangOptions` type parameter.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89909



More information about the llvm-commits mailing list