[PATCH] D104752: [LLParser] Remove special handling for call address space

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 15:34:10 PDT 2021


nikic added a reviewer: arichardson.
nikic added a comment.

In D104752#2834690 <https://reviews.llvm.org/D104752#2834690>, @aeubanks wrote:

> I'm confused by "The pointer address space of the callee should always match the specified addrspace". The addrspace on the call sounds like it's basically the "expected" addrspace and could affect lower of the call instruction itself. But the call operand might not be of that addrspace, whether it's a direct call's callee, or an indirect call's function pointer.

LangRef says:

> The optional addrspace attribute can be used to indicate the address space of the called function. If it is not specified, the program address space from the datalayout string will be used.

My reading here is that the call addrspace and the callee addrspace must be the same.

Looking back over D47541 <https://reviews.llvm.org/D47541>, I think this code is an artifact from an earlier version of the patch that did not have addrspace on calls.



================
Comment at: llvm/lib/AsmParser/LLParser.cpp:1472
 Value *LLParser::checkValidVariableType(LocTy Loc, const Twine &Name, Type *Ty,
                                         Value *Val, bool IsCall) {
   if (Val->getType() == Ty)
----------------
aeubanks wrote:
> IsCall isn't being used anymore
It will be used by D104740 again, so I don't want to remove the parameter. I can comment the name though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104752



More information about the llvm-commits mailing list