[PATCH] D84345: [AMDGPU] Set the default globals address space to 1

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 12:02:24 PDT 2020


akhuang added inline comments.


================
Comment at: llvm/lib/IR/AutoUpgrade.cpp:4297
+  // address space of 1.
+  if (T.isAMDGPU() && !DL.contains("-G") && !DL.startswith("G")) {
+    return DL.empty() ? std::string("G1") : (DL + "-G1").str();
----------------
arichardson wrote:
> arsenm wrote:
> > I would expect datalayout upgrades to work by parsing the old string, and checking the field values inside. I guess directly checking the string isn't a new problem here
> I agree that would be less error prone. I wonder if there are cases where the old string may fail to parse so you have to do the textual upgrade first. I'm happy to make this change.
> 
> @akhuang is there a reason you used string parsing in D67631? Any objections to changing the code to parse the datalayout and add missing attributes?
I don't think so; parsing the datalayout sounds better to me too. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84345





More information about the llvm-commits mailing list