[PATCH] D31210: [AMDGPU] Add new address space mapping

Tony Tye via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 24 11:13:20 PDT 2017


t-tye requested changes to this revision.
t-tye added a comment.
This revision now requires changes to proceed.

Also please upload as full diff.



================
Comment at: lib/Basic/Targets.cpp:2026-2069
+  struct AddrSpace {
+    unsigned Generic, Global, Local, Constant, Private;
+    bool IsGenericZero;
+    AddrSpace(bool IsGenericZero_ = false){
+      reset(IsGenericZero_);
+    }
+    void reset(bool IsGenericZero_) {
----------------
Now that the target triple is being used to control the address space mapping, the mapping is only being set once. So suggest simplifying this and simply have two static arrays for the address spaces (like is done for the data layout), and then set AddrSpaceMap to the address of the appropriate array.


================
Comment at: lib/Basic/Targets.cpp:2119
 
-    AddrSpaceMap = &AMDGPUAddrSpaceMap;
+    AddrSpaceMap = AS.getMap();
     UseAddrSpaceMapMangling = true;
----------------
See comment above.


https://reviews.llvm.org/D31210





More information about the cfe-commits mailing list