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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 01:38:52 PDT 2021


nikic updated this revision to Diff 353877.
nikic edited the summary of this revision.
nikic added a comment.

Comment temporarily unused parameter name to make sure it doesn't warn.

One more thing to note here, because it probably wasn't clear from my original description: The call addrspace is a pure textural IR concept and is only used to determine the expected address space of the callee pointer type. There is no concept of a call addrspace for in-memory IR, just the addrspace of the callee pointer type.


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

https://reviews.llvm.org/D104752

Files:
  llvm/lib/AsmParser/LLParser.cpp


Index: llvm/lib/AsmParser/LLParser.cpp
===================================================================
--- llvm/lib/AsmParser/LLParser.cpp
+++ llvm/lib/AsmParser/LLParser.cpp
@@ -1469,24 +1469,15 @@
 }
 
 Value *LLParser::checkValidVariableType(LocTy Loc, const Twine &Name, Type *Ty,
-                                        Value *Val, bool IsCall) {
+                                        Value *Val, bool /* IsCall */) {
   if (Val->getType() == Ty)
     return Val;
-  // For calls we also accept variables in the program address space.
-  Type *SuggestedTy = Ty;
-  if (IsCall && isa<PointerType>(Ty)) {
-    Type *TyInProgAS = cast<PointerType>(Ty)->getElementType()->getPointerTo(
-        M->getDataLayout().getProgramAddressSpace());
-    SuggestedTy = TyInProgAS;
-    if (Val->getType() == TyInProgAS)
-      return Val;
-  }
   if (Ty->isLabelTy())
     error(Loc, "'" + Name + "' is not a basic block");
   else
     error(Loc, "'" + Name + "' defined with type '" +
                    getTypeString(Val->getType()) + "' but expected '" +
-                   getTypeString(SuggestedTy) + "'");
+                   getTypeString(Ty) + "'");
   return nullptr;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104752.353877.patch
Type: text/x-patch
Size: 1185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210623/d895db0f/attachment.bin>


More information about the llvm-commits mailing list