Revert "OpaquePtr: Turn inalloca into a type attribute"

This reverts commit 4fefed65637ec46c8c2edad6b07b5569ac61e9e5.
Broke check-clang everywhere.

GitOrigin-RevId: 20d5c42e0ef5d252b434bcb610b04f1cb79fe771
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index 794ca109..09a8933 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -1119,7 +1119,7 @@
 
 .. _attr_inalloca:
 
-``inalloca(<ty>)``
+``inalloca``
 
     The ``inalloca`` argument attribute allows the caller to take the
     address of outgoing stack arguments. An ``inalloca`` argument must
@@ -1143,9 +1143,6 @@
     must be cleared off with :ref:`llvm.stackrestore
     <int_stackrestore>`.
 
-    The inalloca attribute requires a type argument, which must be the
-    same as the pointee type of the argument.
-
     See :doc:`InAlloca` for more information on how to use this
     attribute.
 
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst
index e751ed9..e35dfdd 100644
--- a/docs/ReleaseNotes.rst
+++ b/docs/ReleaseNotes.rst
@@ -58,8 +58,7 @@
 Changes to the LLVM IR
 ----------------------
 
-* The ``inalloca`` attribute now has a mandatory type field, similar
-  to ``byval`` and ``sret``.
+* ...
 
 
 Changes to building LLVM
diff --git a/include/llvm/IR/Argument.h b/include/llvm/IR/Argument.h
index 4b13e2d..e8ca8a6 100644
--- a/include/llvm/IR/Argument.h
+++ b/include/llvm/IR/Argument.h
@@ -111,9 +111,6 @@
   /// If this is a byref argument, return its type.
   Type *getParamByRefType() const;
 
-  /// If this is an inalloca argument, return its type.
-  Type *getParamInAllocaType() const;
-
   /// Return true if this argument has the nest attribute.
   bool hasNestAttr() const;
 
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index a8c4017..d21d65b 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -114,7 +114,6 @@
   static Attribute getWithStructRetType(LLVMContext &Context, Type *Ty);
   static Attribute getWithByRefType(LLVMContext &Context, Type *Ty);
   static Attribute getWithPreallocatedType(LLVMContext &Context, Type *Ty);
-  static Attribute getWithInAllocaType(LLVMContext &Context, Type *Ty);
 
   /// For a typed attribute, return the equivalent attribute with the type
   /// changed to \p ReplacementTy.
@@ -161,7 +160,7 @@
   bool hasAttribute(StringRef Val) const;
 
   /// Return the attribute's kind as an enum (Attribute::AttrKind). This
-  /// requires the attribute to be an enum, integer, or type attribute.
+  /// requires the attribute to be an enum or integer attribute.
   Attribute::AttrKind getKindAsEnum() const;
 
   /// Return the attribute's value as an integer. This requires that the
@@ -326,7 +325,6 @@
   Type *getStructRetType() const;
   Type *getByRefType() const;
   Type *getPreallocatedType() const;
-  Type *getInAllocaType() const;
   std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
   std::pair<unsigned, unsigned> getVScaleRangeArgs() const;
   std::string getAsString(bool InAttrGrp = false) const;
@@ -686,9 +684,6 @@
   /// Return the preallocated type for the specified function parameter.
   Type *getParamPreallocatedType(unsigned ArgNo) const;
 
-  /// Return the inalloca type for the specified function parameter.
-  Type *getParamInAllocaType(unsigned ArgNo) const;
-
   /// Get the stack alignment.
   MaybeAlign getStackAlignment(unsigned Index) const;
 
@@ -796,7 +791,6 @@
   Type *StructRetType = nullptr;
   Type *ByRefType = nullptr;
   Type *PreallocatedType = nullptr;
-  Type *InAllocaType = nullptr;
 
 public:
   AttrBuilder() = default;
@@ -891,9 +885,6 @@
   /// Retrieve the preallocated type.
   Type *getPreallocatedType() const { return PreallocatedType; }
 
-  /// Retrieve the inalloca type.
-  Type *getInAllocaType() const { return InAllocaType; }
-
   /// Retrieve the allocsize args, if the allocsize attribute exists.  If it
   /// doesn't exist, pair(0, 0) is returned.
   std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
@@ -953,9 +944,6 @@
   /// This turns a preallocated type into the form used internally in Attribute.
   AttrBuilder &addPreallocatedAttr(Type *Ty);
 
-  /// This turns an inalloca type into the form used internally in Attribute.
-  AttrBuilder &addInAllocaAttr(Type *Ty);
-
   /// Add an allocsize attribute, using the representation returned by
   /// Attribute.getIntValue().
   AttrBuilder &addAllocSizeAttrFromRawRepr(uint64_t RawAllocSizeRepr);
diff --git a/include/llvm/IR/Attributes.td b/include/llvm/IR/Attributes.td
index 9684ffa..9f62723 100644
--- a/include/llvm/IR/Attributes.td
+++ b/include/llvm/IR/Attributes.td
@@ -80,7 +80,7 @@
 def InaccessibleMemOrArgMemOnly : EnumAttr<"inaccessiblemem_or_argmemonly">;
 
 /// Pass structure in an alloca.
-def InAlloca : TypeAttr<"inalloca">;
+def InAlloca : EnumAttr<"inalloca">;
 
 /// Source said inlining was desirable.
 def InlineHint : EnumAttr<"inlinehint">;
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h
index a24b12c..ab20cc4 100644
--- a/include/llvm/IR/Function.h
+++ b/include/llvm/IR/Function.h
@@ -493,11 +493,6 @@
     return AttributeSets.getParamStructRetType(ArgNo);
   }
 
-  /// Extract the inalloca type for a parameter.
-  Type *getParamInAllocaType(unsigned ArgNo) const {
-    return AttributeSets.getParamInAllocaType(ArgNo);
-  }
-
   /// Extract the byref type for a parameter.
   Type *getParamByRefType(unsigned ArgNo) const {
     return AttributeSets.getParamByRefType(ArgNo);
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index ee84424..0372da1 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -1736,13 +1736,6 @@
       B.addPreallocatedAttr(Ty);
       continue;
     }
-    case lltok::kw_inalloca: {
-      Type *Ty;
-      if (parseInalloca(Ty))
-        return true;
-      B.addInAllocaAttr(Ty);
-      continue;
-    }
     case lltok::kw_dereferenceable: {
       uint64_t Bytes;
       if (parseOptionalDerefAttrBytes(lltok::kw_dereferenceable, Bytes))
@@ -1764,6 +1757,7 @@
       B.addByRefAttr(Ty);
       continue;
     }
+    case lltok::kw_inalloca:        B.addAttribute(Attribute::InAlloca); break;
     case lltok::kw_inreg:           B.addAttribute(Attribute::InReg); break;
     case lltok::kw_nest:            B.addAttribute(Attribute::Nest); break;
     case lltok::kw_noundef:
@@ -2700,12 +2694,6 @@
   return parseRequiredTypeAttr(Result, lltok::kw_preallocated);
 }
 
-/// parseInalloca
-///   ::= inalloca(<ty>)
-bool LLParser::parseInalloca(Type *&Result) {
-  return parseRequiredTypeAttr(Result, lltok::kw_inalloca);
-}
-
 /// parseByRef
 ///   ::= byref(<type>)
 bool LLParser::parseByRef(Type *&Result) {
diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h
index 3d9ffe6..1205394 100644
--- a/lib/AsmParser/LLParser.h
+++ b/lib/AsmParser/LLParser.h
@@ -331,7 +331,6 @@
                                     bool inAttrGrp, LocTy &BuiltinLoc);
     bool parseRequiredTypeAttr(Type *&Result, lltok::Kind AttrName);
     bool parsePreallocated(Type *&Result);
-    bool parseInalloca(Type *&Result);
     bool parseByRef(Type *&Result);
 
     // Module Summary Index Parsing.
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 46db3ed..951e32e 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1624,8 +1624,6 @@
             B.addByValAttr(nullptr);
           else if (Kind == Attribute::StructRet)
             B.addStructRetAttr(nullptr);
-          else if (Kind == Attribute::InAlloca)
-            B.addInAllocaAttr(nullptr);
 
           B.addAttribute(Kind);
         } else if (Record[i] == 1) { // Integer attribute
@@ -1677,8 +1675,6 @@
             B.addByRefAttr(getTypeByID(Record[++i]));
           } else if (Kind == Attribute::Preallocated) {
             B.addPreallocatedAttr(getTypeByID(Record[++i]));
-          } else if (Kind == Attribute::InAlloca) {
-            B.addInAllocaAttr(HasType ? getTypeByID(Record[++i]) : nullptr);
           }
         }
       }
@@ -3332,8 +3328,7 @@
   // argument's pointee type. There should be no opaque pointers where the byval
   // type is implicit.
   for (unsigned i = 0; i != Func->arg_size(); ++i) {
-    for (Attribute::AttrKind Kind : {Attribute::ByVal, Attribute::StructRet,
-                                     Attribute::InAlloca}) {
+    for (Attribute::AttrKind Kind : {Attribute::ByVal, Attribute::StructRet}) {
       if (!Func->hasParamAttribute(i, Kind))
         continue;
 
@@ -3341,21 +3336,10 @@
 
       Type *PTy = cast<FunctionType>(FullFTy)->getParamType(i);
       Type *PtrEltTy = getPointerElementFlatType(PTy);
-      Attribute NewAttr;
-      switch (Kind) {
-      case Attribute::ByVal:
-        NewAttr = Attribute::getWithByValType(Context, PtrEltTy);
-        break;
-      case Attribute::StructRet:
-        NewAttr = Attribute::getWithStructRetType(Context, PtrEltTy);
-        break;
-      case Attribute::InAlloca:
-        NewAttr = Attribute::getWithInAllocaType(Context, PtrEltTy);
-        break;
-      default:
-        llvm_unreachable("not an upgraded type attribute");
-      }
-
+      Attribute NewAttr =
+          Kind == Attribute::ByVal
+              ? Attribute::getWithByValType(Context, PtrEltTy)
+              : Attribute::getWithStructRetType(Context, PtrEltTy);
       Func->addParamAttr(i, NewAttr);
     }
   }
@@ -3821,29 +3805,17 @@
 void BitcodeReader::propagateByValSRetTypes(CallBase *CB,
                                             ArrayRef<Type *> ArgsFullTys) {
   for (unsigned i = 0; i != CB->arg_size(); ++i) {
-    for (Attribute::AttrKind Kind : {Attribute::ByVal, Attribute::StructRet,
-                                     Attribute::InAlloca}) {
+    for (Attribute::AttrKind Kind : {Attribute::ByVal, Attribute::StructRet}) {
       if (!CB->paramHasAttr(i, Kind))
         continue;
 
       CB->removeParamAttr(i, Kind);
 
       Type *PtrEltTy = getPointerElementFlatType(ArgsFullTys[i]);
-      Attribute NewAttr;
-      switch (Kind) {
-      case Attribute::ByVal:
-        NewAttr = Attribute::getWithByValType(Context, PtrEltTy);
-        break;
-      case Attribute::StructRet:
-        NewAttr = Attribute::getWithStructRetType(Context, PtrEltTy);
-        break;
-      case Attribute::InAlloca:
-        NewAttr = Attribute::getWithInAllocaType(Context, PtrEltTy);
-        break;
-      default:
-        llvm_unreachable("not an upgraded type attribute");
-      }
-
+      Attribute NewAttr =
+          Kind == Attribute::ByVal
+              ? Attribute::getWithByValType(Context, PtrEltTy)
+              : Attribute::getWithStructRetType(Context, PtrEltTy);
       CB->addParamAttr(i, NewAttr);
     }
   }
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp
index 91f8939..09f21d2 100644
--- a/lib/IR/AsmWriter.cpp
+++ b/lib/IR/AsmWriter.cpp
@@ -4413,18 +4413,20 @@
     return;
   }
 
+  assert((Attr.hasAttribute(Attribute::ByVal) ||
+          Attr.hasAttribute(Attribute::StructRet) ||
+          Attr.hasAttribute(Attribute::ByRef) ||
+          Attr.hasAttribute(Attribute::Preallocated)) &&
+         "unexpected type attr");
+
   if (Attr.hasAttribute(Attribute::ByVal)) {
     Out << "byval";
   } else if (Attr.hasAttribute(Attribute::StructRet)) {
     Out << "sret";
   } else if (Attr.hasAttribute(Attribute::ByRef)) {
     Out << "byref";
-  } else if (Attr.hasAttribute(Attribute::Preallocated)) {
-    Out << "preallocated";
-  } else if (Attr.hasAttribute(Attribute::InAlloca)) {
-    Out << "inalloca";
   } else {
-    llvm_unreachable("unexpected type attr");
+    Out << "preallocated";
   }
 
   if (Type *Ty = Attr.getValueAsType()) {
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index 60e2ec2..53c2228 100644
--- a/lib/IR/AttributeImpl.h
+++ b/lib/IR/AttributeImpl.h
@@ -258,7 +258,6 @@
   Type *getStructRetType() const;
   Type *getByRefType() const;
   Type *getPreallocatedType() const;
-  Type *getInAllocaType() const;
 
   using iterator = const Attribute *;
 
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index c174e4f..831186a 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -195,10 +195,6 @@
   return get(Context, Preallocated, Ty);
 }
 
-Attribute Attribute::getWithInAllocaType(LLVMContext &Context, Type *Ty) {
-  return get(Context, InAlloca, Ty);
-}
-
 Attribute
 Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg,
                                 const Optional<unsigned> &NumElemsArg) {
@@ -381,6 +377,8 @@
     return "inaccessiblememonly";
   if (hasAttribute(Attribute::InaccessibleMemOrArgMemOnly))
     return "inaccessiblemem_or_argmemonly";
+  if (hasAttribute(Attribute::InAlloca))
+    return "inalloca";
   if (hasAttribute(Attribute::InlineHint))
     return "inlinehint";
   if (hasAttribute(Attribute::InReg))
@@ -486,30 +484,24 @@
   if (hasAttribute(Attribute::MustProgress))
     return "mustprogress";
 
-  if (isTypeAttribute()) {
+  const bool IsByVal = hasAttribute(Attribute::ByVal);
+  if (IsByVal || hasAttribute(Attribute::StructRet)) {
     std::string Result;
-    raw_string_ostream OS(Result);
-
-    switch (getKindAsEnum()) {
-    case Attribute::ByVal:
-      Result += "byval";
-      break;
-    case Attribute::StructRet:
-      Result += "sret";
-      break;
-    case Attribute::ByRef:
-      Result += "byref";
-      break;
-    case Attribute::Preallocated:
-      Result += "preallocated";
-      break;
-    case Attribute::InAlloca:
-      Result += "inalloca";
-      break;
-    default:
-      llvm_unreachable("unhandled type attribute");
+    Result += IsByVal ? "byval" : "sret";
+    if (Type *Ty = getValueAsType()) {
+      raw_string_ostream OS(Result);
+      Result += '(';
+      Ty->print(OS, false, true);
+      OS.flush();
+      Result += ')';
     }
+    return Result;
+  }
 
+  const bool IsByRef = hasAttribute(Attribute::ByRef);
+  if (IsByRef || hasAttribute(Attribute::Preallocated)) {
+    std::string Result = IsByRef ? "byref" : "preallocated";
+    raw_string_ostream OS(Result);
     Result += '(';
     getValueAsType()->print(OS, false, true);
     OS.flush();
@@ -817,10 +809,6 @@
   return SetNode ? SetNode->getPreallocatedType() : nullptr;
 }
 
-Type *AttributeSet::getInAllocaType() const {
-  return SetNode ? SetNode->getInAllocaType() : nullptr;
-}
-
 std::pair<unsigned, Optional<unsigned>> AttributeSet::getAllocSizeArgs() const {
   return SetNode ? SetNode->getAllocSizeArgs()
                  : std::pair<unsigned, Optional<unsigned>>(0, 0);
@@ -927,9 +915,6 @@
     case Attribute::Preallocated:
       Attr = Attribute::getWithPreallocatedType(C, B.getPreallocatedType());
       break;
-    case Attribute::InAlloca:
-      Attr = Attribute::getWithInAllocaType(C, B.getInAllocaType());
-      break;
     case Attribute::Alignment:
       assert(B.getAlignment() && "Alignment must be set");
       Attr = Attribute::getWithAlignment(C, *B.getAlignment());
@@ -1036,12 +1021,6 @@
   return nullptr;
 }
 
-Type *AttributeSetNode::getInAllocaType() const {
-  if (auto A = findEnumAttribute(Attribute::InAlloca))
-    return A->getValueAsType();
-  return nullptr;
-}
-
 uint64_t AttributeSetNode::getDereferenceableBytes() const {
   if (auto A = findEnumAttribute(Attribute::Dereferenceable))
     return A->getDereferenceableBytes();
@@ -1599,10 +1578,6 @@
   return getAttributes(Index + FirstArgIndex).getPreallocatedType();
 }
 
-Type *AttributeList::getParamInAllocaType(unsigned Index) const {
-  return getAttributes(Index + FirstArgIndex).getInAllocaType();
-}
-
 MaybeAlign AttributeList::getStackAlignment(unsigned Index) const {
   return getAttributes(Index).getStackAlignment();
 }
@@ -1724,9 +1699,6 @@
     AllocSizeArgs = Attr.getValueAsInt();
   else if (Kind == Attribute::VScaleRange)
     VScaleRangeArgs = Attr.getValueAsInt();
-  else if (Kind == Attribute::InAlloca)
-    InAllocaType = Attr.getValueAsType();
-
   return *this;
 }
 
@@ -1751,8 +1723,6 @@
     ByRefType = nullptr;
   else if (Val == Attribute::Preallocated)
     PreallocatedType = nullptr;
-  else if (Val == Attribute::InAlloca)
-    InAllocaType = nullptr;
   else if (Val == Attribute::Dereferenceable)
     DerefBytes = 0;
   else if (Val == Attribute::DereferenceableOrNull)
@@ -1882,12 +1852,6 @@
   return *this;
 }
 
-AttrBuilder &AttrBuilder::addInAllocaAttr(Type *Ty) {
-  Attrs[Attribute::InAlloca] = true;
-  InAllocaType = Ty;
-  return *this;
-}
-
 AttrBuilder &AttrBuilder::merge(const AttrBuilder &B) {
   // FIXME: What if both have alignments, but they don't match?!
   if (!Alignment)
@@ -1917,9 +1881,6 @@
   if (!PreallocatedType)
     PreallocatedType = B.PreallocatedType;
 
-  if (!InAllocaType)
-    InAllocaType = B.InAllocaType;
-
   if (!VScaleRangeArgs)
     VScaleRangeArgs = B.VScaleRangeArgs;
 
@@ -1960,9 +1921,6 @@
   if (B.PreallocatedType)
     PreallocatedType = nullptr;
 
-  if (B.InAllocaType)
-    InAllocaType = nullptr;
-
   if (B.VScaleRangeArgs)
     VScaleRangeArgs = 0;
 
@@ -2027,7 +1985,6 @@
          DerefBytes == B.DerefBytes && ByValType == B.ByValType &&
          StructRetType == B.StructRetType && ByRefType == B.ByRefType &&
          PreallocatedType == B.PreallocatedType &&
-         InAllocaType == B.InAllocaType &&
          VScaleRangeArgs == B.VScaleRangeArgs;
 }
 
@@ -2057,7 +2014,6 @@
         .addAttribute(Attribute::ReadOnly)
         .addAttribute(Attribute::InAlloca)
         .addPreallocatedAttr(Ty)
-        .addInAllocaAttr(Ty)
         .addByValAttr(Ty)
         .addStructRetAttr(Ty)
         .addByRefAttr(Ty);
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp
index 1001607..7389ec6 100644
--- a/lib/IR/Function.cpp
+++ b/lib/IR/Function.cpp
@@ -162,8 +162,6 @@
     return ByRefTy;
   if (Type *PreAllocTy = ParamAttrs.getPreallocatedType())
     return PreAllocTy;
-  if (Type *InAllocaTy = ParamAttrs.getInAllocaType())
-    return InAllocaTy;
 
   // FIXME: sret and inalloca always depends on pointee element type. It's also
   // possible for byval to miss it.
@@ -215,11 +213,6 @@
   return getParent()->getParamByRefType(getArgNo());
 }
 
-Type *Argument::getParamInAllocaType() const {
-  assert(getType()->isPointerTy() && "Only pointers have inalloca types");
-  return getParent()->getParamInAllocaType(getArgNo());
-}
-
 uint64_t Argument::getDereferenceableBytes() const {
   assert(getType()->isPointerTy() &&
          "Only pointers have dereferenceable bytes");
diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp
index b6952f7..0a96b29 100644
--- a/lib/IR/Verifier.cpp
+++ b/lib/IR/Verifier.cpp
@@ -1813,11 +1813,6 @@
       Assert(Attrs.getPreallocatedType() == PTy->getElementType(),
              "Attribute 'preallocated' type does not match parameter!", V);
     }
-
-    if (Attrs.hasAttribute(Attribute::InAlloca)) {
-      Assert(Attrs.getInAllocaType() == PTy->getElementType(),
-             "Attribute 'inalloca' type does not match parameter!", V);
-    }
   } else {
     Assert(!Attrs.hasAttribute(Attribute::ByVal),
            "Attribute 'byval' only applies to parameters with pointer type!",
diff --git a/lib/Linker/IRMover.cpp b/lib/Linker/IRMover.cpp
index 1433d07..f9b9b94 100644
--- a/lib/Linker/IRMover.cpp
+++ b/lib/Linker/IRMover.cpp
@@ -647,8 +647,7 @@
 AttributeList IRLinker::mapAttributeTypes(LLVMContext &C, AttributeList Attrs) {
   for (unsigned i = 0; i < Attrs.getNumAttrSets(); ++i) {
     for (Attribute::AttrKind TypedAttr :
-         {Attribute::ByVal, Attribute::StructRet, Attribute::ByRef,
-          Attribute::InAlloca}) {
+         {Attribute::ByVal, Attribute::StructRet, Attribute::ByRef}) {
       if (Attrs.hasAttribute(i, TypedAttr)) {
         if (Type *Ty = Attrs.getAttribute(i, TypedAttr).getValueAsType()) {
           Attrs = Attrs.replaceAttributeType(C, i, TypedAttr, TypeMap.get(Ty));
diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp
index d875188..ae839bd 100644
--- a/lib/Transforms/Utils/ValueMapper.cpp
+++ b/lib/Transforms/Utils/ValueMapper.cpp
@@ -945,8 +945,7 @@
     AttributeList Attrs = CB->getAttributes();
     for (unsigned i = 0; i < Attrs.getNumAttrSets(); ++i) {
       for (Attribute::AttrKind TypedAttr :
-             {Attribute::ByVal, Attribute::StructRet, Attribute::ByRef,
-              Attribute::InAlloca}) {
+           {Attribute::ByVal, Attribute::StructRet, Attribute::ByRef}) {
         if (Type *Ty = Attrs.getAttribute(i, TypedAttr).getValueAsType()) {
           Attrs = Attrs.replaceAttributeType(C, i, TypedAttr,
                                              TypeMapper->remapType(Ty));
diff --git a/test/Assembler/inalloca-parse-error0.ll b/test/Assembler/inalloca-parse-error0.ll
deleted file mode 100644
index 24fe82b..0000000
--- a/test/Assembler/inalloca-parse-error0.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:40: error: expected '('{{$}}
-define void @test_inalloca(i8* inalloca) {
-  ret void
-}
diff --git a/test/Assembler/invalid-immarg.ll b/test/Assembler/invalid-immarg.ll
index 023a528..f2203d2 100644
--- a/test/Assembler/invalid-immarg.ll
+++ b/test/Assembler/invalid-immarg.ll
@@ -4,7 +4,7 @@
 declare void @llvm.immarg.byval(i32* byval(i32) immarg)
 
 ; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.inalloca(i32* inalloca(i32) immarg)
+declare void @llvm.immarg.inalloca(i32* inalloca immarg)
 
 ; CHECK: Attribute 'immarg' is incompatible with other attributes
 declare void @llvm.immarg.inreg(i32 inreg immarg)
diff --git a/test/Bitcode/Inputs/inalloca-upgrade.bc b/test/Bitcode/Inputs/inalloca-upgrade.bc
deleted file mode 100644
index 51012ca..0000000
--- a/test/Bitcode/Inputs/inalloca-upgrade.bc
+++ /dev/null
Binary files differ
diff --git a/test/Bitcode/attributes.ll b/test/Bitcode/attributes.ll
index 936a295..b8b41e5 100644
--- a/test/Bitcode/attributes.ll
+++ b/test/Bitcode/attributes.ll
@@ -214,8 +214,8 @@
         ret void;
 }
 
-define void @f36(i8* inalloca(i8) %0) {
-; CHECK: define void @f36(i8* inalloca(i8) %0) {
+define void @f36(i8* inalloca %0) {
+; CHECK: define void @f36(i8* inalloca %0) {
         ret void
 }
 
diff --git a/test/Bitcode/compatibility-3.6.ll b/test/Bitcode/compatibility-3.6.ll
index 882f041..05e6b71 100644
--- a/test/Bitcode/compatibility-3.6.ll
+++ b/test/Bitcode/compatibility-3.6.ll
@@ -406,7 +406,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -993,7 +993,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility-3.7.ll b/test/Bitcode/compatibility-3.7.ll
index 65dae1b..b31509e 100644
--- a/test/Bitcode/compatibility-3.7.ll
+++ b/test/Bitcode/compatibility-3.7.ll
@@ -412,7 +412,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1034,7 +1034,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility-3.8.ll b/test/Bitcode/compatibility-3.8.ll
index 51b4740..72b01f6 100644
--- a/test/Bitcode/compatibility-3.8.ll
+++ b/test/Bitcode/compatibility-3.8.ll
@@ -437,7 +437,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1182,7 +1182,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility-3.9.ll b/test/Bitcode/compatibility-3.9.ll
index e203e51..f5b409a 100644
--- a/test/Bitcode/compatibility-3.9.ll
+++ b/test/Bitcode/compatibility-3.9.ll
@@ -506,7 +506,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1253,7 +1253,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility-4.0.ll b/test/Bitcode/compatibility-4.0.ll
index b0b65fe..c787410 100644
--- a/test/Bitcode/compatibility-4.0.ll
+++ b/test/Bitcode/compatibility-4.0.ll
@@ -506,7 +506,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1253,7 +1253,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility-5.0.ll b/test/Bitcode/compatibility-5.0.ll
index 93916d9..e63ff3a 100644
--- a/test/Bitcode/compatibility-5.0.ll
+++ b/test/Bitcode/compatibility-5.0.ll
@@ -510,7 +510,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1265,7 +1265,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility-6.0.ll b/test/Bitcode/compatibility-6.0.ll
index bd5dfd3..980dd92 100644
--- a/test/Bitcode/compatibility-6.0.ll
+++ b/test/Bitcode/compatibility-6.0.ll
@@ -517,7 +517,7 @@
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 declare void @f.param.inalloca(i8* inalloca)
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1276,7 +1276,7 @@
 
 define void @instructions.call_musttail(i8* inalloca %val) {
   musttail call void @f.param.inalloca(i8* inalloca %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/compatibility.ll b/test/Bitcode/compatibility.ll
index 95bb263..34c5cfd 100644
--- a/test/Bitcode/compatibility.ll
+++ b/test/Bitcode/compatibility.ll
@@ -532,8 +532,8 @@
 ; CHECK: declare void @f.param.inreg(i8 inreg)
 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
-declare void @f.param.inalloca(i8* inalloca(i8))
-; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
+declare void @f.param.inalloca(i8* inalloca)
+; CHECK: declare void @f.param.inalloca(i8* inalloca)
 declare void @f.param.sret(i8* sret(i8))
 ; CHECK: declare void @f.param.sret(i8* sret(i8))
 declare void @f.param.noalias(i8* noalias)
@@ -1520,9 +1520,9 @@
   ret void
 }
 
-define void @instructions.call_musttail(i8* inalloca(i8) %val) {
-  musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
-  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
+define void @instructions.call_musttail(i8* inalloca %val) {
+  musttail call void @f.param.inalloca(i8* inalloca %val)
+  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
 
   ret void
 }
diff --git a/test/Bitcode/inalloca-upgrade.test b/test/Bitcode/inalloca-upgrade.test
deleted file mode 100644
index 20d4136..0000000
--- a/test/Bitcode/inalloca-upgrade.test
+++ /dev/null
@@ -1,7 +0,0 @@
-RUN: llvm-dis %p/Inputs/inalloca-upgrade.bc -o - | FileCheck %s
-
-Make sure we upgrade old-style IntAttribute inalloca records to a
-fully typed version correctly.
-
-CHECK: call void @bar({ i32*, i8 }* inalloca({ i32*, i8 }) %ptr)
-CHECK: invoke void @bar({ i32*, i8 }* inalloca({ i32*, i8 }) %ptr)
diff --git a/test/Bitcode/inalloca.ll b/test/Bitcode/inalloca.ll
index 3b56f57..84abe17 100644
--- a/test/Bitcode/inalloca.ll
+++ b/test/Bitcode/inalloca.ll
@@ -3,17 +3,17 @@
 
 ; inalloca should roundtrip.
 
-define void @foo(i32* inalloca(i32) %args) {
+define void @foo(i32* inalloca %args) {
   ret void
 }
-; CHECK-LABEL: define void @foo(i32* inalloca(i32) %args)
+; CHECK-LABEL: define void @foo(i32* inalloca %args)
 
 define void @bar() {
   ; Use the maximum alignment, since we stuff our bit with alignment.
   %args = alloca inalloca i32, align 536870912
-  call void @foo(i32* inalloca(i32) %args)
+  call void @foo(i32* inalloca %args)
   ret void
 }
 ; CHECK-LABEL: define void @bar() {
 ; CHECK: %args = alloca inalloca i32, align 536870912
-; CHECK: call void @foo(i32* inalloca(i32) %args)
+; CHECK: call void @foo(i32* inalloca %args)
diff --git a/test/CodeGen/X86/arg-copy-elide.ll b/test/CodeGen/X86/arg-copy-elide.ll
index 36510e0..f8761bd 100644
--- a/test/CodeGen/X86/arg-copy-elide.ll
+++ b/test/CodeGen/X86/arg-copy-elide.ll
@@ -232,7 +232,7 @@
 ; CHECK: retl
 
 
-define void @avoid_inalloca(i32* inalloca(i32) %x) {
+define void @avoid_inalloca(i32* inalloca %x) {
 entry:
   %x.p.p = alloca i32*
   store i32* %x, i32** %x.p.p
diff --git a/test/CodeGen/X86/cleanuppad-inalloca.ll b/test/CodeGen/X86/cleanuppad-inalloca.ll
index 927956d..4e28b5f 100644
--- a/test/CodeGen/X86/cleanuppad-inalloca.ll
+++ b/test/CodeGen/X86/cleanuppad-inalloca.ll
@@ -25,7 +25,7 @@
           to label %invoke.cont unwind label %ehcleanup
 
 invoke.cont:                                      ; preds = %entry
-  call void @takes_two(<{ %struct.A, %struct.A }>* inalloca(<{ %struct.A, %struct.A }>) nonnull %argmem)
+  call void @takes_two(<{ %struct.A, %struct.A }>* inalloca nonnull %argmem)
   ret void
 
 ehcleanup:                                        ; preds = %entry
@@ -57,7 +57,7 @@
 ; CHECK: addl $8, %esp
 ; CHECK: retl
 
-declare void @takes_two(<{ %struct.A, %struct.A }>* inalloca(<{ %struct.A, %struct.A }>)) #0
+declare void @takes_two(<{ %struct.A, %struct.A }>* inalloca) #0
 
 declare x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* returned) #0
 
diff --git a/test/CodeGen/X86/inalloca-ctor.ll b/test/CodeGen/X86/inalloca-ctor.ll
index 740c61a..f13d537 100644
--- a/test/CodeGen/X86/inalloca-ctor.ll
+++ b/test/CodeGen/X86/inalloca-ctor.ll
@@ -4,7 +4,7 @@
 
 %frame = type { %Foo, i32, %Foo }
 
-declare void @f(%frame* inalloca(%frame) %a)
+declare void @f(%frame* inalloca %a)
 
 declare void @Foo_ctor(%Foo* %this)
 
@@ -28,7 +28,7 @@
 ; CHECK-NEXT: pushl
 ; CHECK-NEXT: calll _Foo_ctor
 ; CHECK: addl $4, %esp
-  call void @f(%frame* inalloca(%frame) %args)
+  call void @f(%frame* inalloca %args)
 ; CHECK: calll   _f
   ret void
 }
diff --git a/test/CodeGen/X86/inalloca-invoke.ll b/test/CodeGen/X86/inalloca-invoke.ll
index 39a9ac5..4623c58 100644
--- a/test/CodeGen/X86/inalloca-invoke.ll
+++ b/test/CodeGen/X86/inalloca-invoke.ll
@@ -9,7 +9,7 @@
 declare i8* @llvm.stacksave()
 declare void @begin(%Iter* sret(%Iter))
 declare void @plus(%Iter* sret(%Iter), %Iter*, i32)
-declare void @reverse(%frame.reverse* inalloca(%frame.reverse) align 4)
+declare void @reverse(%frame.reverse* inalloca align 4)
 
 define i32 @main() personality i32 (...)* @pers {
   %temp.lvalue = alloca %Iter
@@ -42,7 +42,7 @@
 ; CHECK:  pushl %[[beg]]
 ; CHECK:  calll _begin
 
-  invoke void @reverse(%frame.reverse* inalloca(%frame.reverse) align 4 %rev_args)
+  invoke void @reverse(%frame.reverse* inalloca align 4 %rev_args)
           to label %invoke.cont5 unwind label %lpad
 
 invoke.cont5:                                     ; preds = %invoke.cont
diff --git a/test/CodeGen/X86/inalloca-regparm.ll b/test/CodeGen/X86/inalloca-regparm.ll
index 24a7d17..d379333 100644
--- a/test/CodeGen/X86/inalloca-regparm.ll
+++ b/test/CodeGen/X86/inalloca-regparm.ll
@@ -4,11 +4,11 @@
 ; This will compile successfully on x86 but not x86_64, because %b will become a
 ; register parameter.
 
-declare x86_thiscallcc i32 @f(i32 %a, i32* inalloca(i32) %b)
+declare x86_thiscallcc i32 @f(i32 %a, i32* inalloca %b)
 define void @g() {
   %b = alloca inalloca i32
   store i32 2, i32* %b
-  call x86_thiscallcc i32 @f(i32 0, i32* inalloca(i32) %b)
+  call x86_thiscallcc i32 @f(i32 0, i32* inalloca %b)
   ret void
 }
 
diff --git a/test/CodeGen/X86/inalloca-stdcall.ll b/test/CodeGen/X86/inalloca-stdcall.ll
index e0a292b..69d94d8 100644
--- a/test/CodeGen/X86/inalloca-stdcall.ll
+++ b/test/CodeGen/X86/inalloca-stdcall.ll
@@ -2,7 +2,7 @@
 
 %Foo = type { i32, i32 }
 
-declare x86_stdcallcc void @f(%Foo* inalloca(%Foo) %a)
+declare x86_stdcallcc void @f(%Foo* inalloca %a)
 declare x86_stdcallcc void @i(i32 %a)
 
 define void @g() {
@@ -17,7 +17,7 @@
 ; CHECK: movl %esp, %eax
 ; CHECK: movl    $13, (%eax)
 ; CHECK: movl    $42, 4(%eax)
-  call x86_stdcallcc void @f(%Foo* inalloca(%Foo) %b)
+  call x86_stdcallcc void @f(%Foo* inalloca %b)
 ; CHECK: calll   _f@8
 ; CHECK-NOT: %esp
 ; CHECK: pushl
diff --git a/test/CodeGen/X86/inalloca.ll b/test/CodeGen/X86/inalloca.ll
index ed85c79..134de2f 100644
--- a/test/CodeGen/X86/inalloca.ll
+++ b/test/CodeGen/X86/inalloca.ll
@@ -2,7 +2,7 @@
 
 %Foo = type { i32, i32 }
 
-declare void @f(%Foo* inalloca(%Foo) %b)
+declare void @f(%Foo* inalloca %b)
 
 define void @a() {
 ; CHECK-LABEL: _a:
@@ -17,12 +17,12 @@
 ; CHECK: movl %esp, %eax
 ; CHECK: movl    $13, (%eax)
 ; CHECK: movl    $42, 4(%eax)
-  call void @f(%Foo* inalloca(%Foo) %b)
+  call void @f(%Foo* inalloca %b)
 ; CHECK: calll   _f
   ret void
 }
 
-declare void @inreg_with_inalloca(i32 inreg %a, %Foo* inalloca(%Foo) %b)
+declare void @inreg_with_inalloca(i32 inreg %a, %Foo* inalloca %b)
 
 define void @b() {
 ; CHECK-LABEL: _b:
@@ -37,13 +37,13 @@
 ; CHECK: movl %esp, %eax
 ; CHECK: movl    $13, (%eax)
 ; CHECK: movl    $42, 4(%eax)
-  call void @inreg_with_inalloca(i32 inreg 1, %Foo* inalloca(%Foo) %b)
+  call void @inreg_with_inalloca(i32 inreg 1, %Foo* inalloca %b)
 ; CHECK: movl    $1, %eax
 ; CHECK: calll   _inreg_with_inalloca
   ret void
 }
 
-declare x86_thiscallcc void @thiscall_with_inalloca(i8* %a, %Foo* inalloca(%Foo) %b)
+declare x86_thiscallcc void @thiscall_with_inalloca(i8* %a, %Foo* inalloca %b)
 
 define void @c() {
 ; CHECK-LABEL: _c:
@@ -58,7 +58,7 @@
 ; CHECK: movl %esp, %eax
 ; CHECK-DAG: movl    $13, (%eax)
 ; CHECK-DAG: movl    $42, 4(%eax)
-  call x86_thiscallcc void @thiscall_with_inalloca(i8* null, %Foo* inalloca(%Foo) %b)
+  call x86_thiscallcc void @thiscall_with_inalloca(i8* null, %Foo* inalloca %b)
 ; CHECK-DAG: xorl    %ecx, %ecx
 ; CHECK: calll   _thiscall_with_inalloca
   ret void
diff --git a/test/CodeGen/X86/movtopush.ll b/test/CodeGen/X86/movtopush.ll
index 33e1123..fa200c2 100644
--- a/test/CodeGen/X86/movtopush.ll
+++ b/test/CodeGen/X86/movtopush.ll
@@ -15,7 +15,7 @@
 declare void @eightparams16(i16 %a, i16 %b, i16 %c, i16 %d, i16 %e, i16 %f, i16 %g, i16 %h)
 declare void @eightparams64(i64 %a, i64 %b, i64 %c, i64 %d, i64 %e, i64 %f, i64 %g, i64 %h)
 declare void @struct(%struct.s* byval(%struct.s) %a, i32 %b, i32 %c, i32 %d)
-declare void @inalloca(<{ %struct.s }>* inalloca(<{ %struct.s }>))
+declare void @inalloca(<{ %struct.s }>* inalloca)
 
 declare i8* @llvm.stacksave()
 declare void @llvm.stackrestore(i8*)
diff --git a/test/CodeGen/X86/musttail-inalloca.ll b/test/CodeGen/X86/musttail-inalloca.ll
index f3e27fa..c0e571a 100644
--- a/test/CodeGen/X86/musttail-inalloca.ll
+++ b/test/CodeGen/X86/musttail-inalloca.ll
@@ -11,10 +11,10 @@
 ; 20 bytes of memory.
 %struct.Args = type { i32, i32, i32, i32, i32 }
 
-declare dso_local x86_thiscallcc void @methodWithVtorDisp(i8* nocapture readonly, <{ %struct.Args }>* inalloca(<{ %struct.Args }>))
+declare dso_local x86_thiscallcc void @methodWithVtorDisp(i8* nocapture readonly, <{ %struct.Args }>* inalloca)
 
 ; Function Attrs: nounwind optsize
-define dso_local x86_thiscallcc void @methodWithVtorDisp_thunk(i8* %0, <{ %struct.Args }>* inalloca(<{ %struct.Args }>) %1) #0 {
+define dso_local x86_thiscallcc void @methodWithVtorDisp_thunk(i8* %0, <{ %struct.Args }>* inalloca %1) #0 {
 ; CHECK-LABEL: methodWithVtorDisp_thunk:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushl %esi
@@ -34,7 +34,7 @@
   %7 = getelementptr i8, i8* %0, i32 %6
   %8 = call i8* @llvm.returnaddress(i32 0)
   call void @__cyg_profile_func_exit(i8* bitcast (void (i8*, <{ %struct.Args }>*)* @methodWithVtorDisp_thunk to i8*), i8* %8)
-  musttail call x86_thiscallcc void @methodWithVtorDisp(i8* %7, <{ %struct.Args }>* inalloca(<{ %struct.Args }>) nonnull %1)
+  musttail call x86_thiscallcc void @methodWithVtorDisp(i8* %7, <{ %struct.Args }>* inalloca nonnull %1)
   ret void
 }
 
diff --git a/test/CodeGen/X86/musttail-indirect.ll b/test/CodeGen/X86/musttail-indirect.ll
index cb7a314..f30d775 100644
--- a/test/CodeGen/X86/musttail-indirect.ll
+++ b/test/CodeGen/X86/musttail-indirect.ll
@@ -42,13 +42,13 @@
 ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
 ; CHECK: jmpl
 ; CHECK-NOT: ret
-define x86_thiscallcc i32 @g_thunk(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca(<{ %struct.A, i32, %struct.A }>)) {
+define x86_thiscallcc i32 @g_thunk(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca) {
 entry:
   %1 = bitcast %struct.B* %this to i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)***
   %vtable = load i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)**, i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)*** %1
   %vfn = getelementptr inbounds i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)*, i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)** %vtable, i32 1
   %2 = load i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)*, i32 (%struct.B*, <{ %struct.A, i32, %struct.A }>*)** %vfn
-  %3 = musttail call x86_thiscallcc i32 %2(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca(<{ %struct.A, i32, %struct.A }>) %0)
+  %3 = musttail call x86_thiscallcc i32 %2(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca %0)
   ret i32 %3
 }
 
@@ -71,13 +71,13 @@
 ; CHECK: jmpl
 ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
 ; CHECK-NOT: ret
-define x86_thiscallcc void @h_thunk(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca(<{ %struct.A, i32, %struct.A }>)) {
+define x86_thiscallcc void @h_thunk(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca) {
 entry:
   %1 = bitcast %struct.B* %this to void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)***
   %vtable = load void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)**, void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)*** %1
   %vfn = getelementptr inbounds void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)*, void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)** %vtable, i32 2
   %2 = load void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)*, void (%struct.B*, <{ %struct.A, i32, %struct.A }>*)** %vfn
-  musttail call x86_thiscallcc void %2(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca(<{ %struct.A, i32, %struct.A }>) %0)
+  musttail call x86_thiscallcc void %2(%struct.B* %this, <{ %struct.A, i32, %struct.A }>* inalloca %0)
   ret void
 }
 
@@ -99,13 +99,13 @@
 ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
 ; CHECK: jmpl
 ; CHECK-NOT: ret
-define x86_thiscallcc %struct.A* @i_thunk(%struct.B* %this, <{ %struct.A*, %struct.A, i32, %struct.A }>* inalloca(<{ %struct.A*, %struct.A, i32, %struct.A }>)) {
+define x86_thiscallcc %struct.A* @i_thunk(%struct.B* %this, <{ %struct.A*, %struct.A, i32, %struct.A }>* inalloca) {
 entry:
   %1 = bitcast %struct.B* %this to %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)***
   %vtable = load %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)**, %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)*** %1
   %vfn = getelementptr inbounds %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)*, %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)** %vtable, i32 3
   %2 = load %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)*, %struct.A* (%struct.B*, <{ %struct.A*, %struct.A, i32, %struct.A }>*)** %vfn
-  %3 = musttail call x86_thiscallcc %struct.A* %2(%struct.B* %this, <{ %struct.A*, %struct.A, i32, %struct.A }>* inalloca(<{ %struct.A*, %struct.A, i32, %struct.A }>) %0)
+  %3 = musttail call x86_thiscallcc %struct.A* %2(%struct.B* %this, <{ %struct.A*, %struct.A, i32, %struct.A }>* inalloca %0)
   ret %struct.A* %3
 }
 
@@ -140,7 +140,7 @@
 ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
 ; CHECK: jmpl
 ; CHECK-NOT: ret
-define x86_stdcallcc i32 @stdcall_thunk(<{ %struct.B*, %struct.A }>* inalloca(<{ %struct.B*, %struct.A }>)) {
+define x86_stdcallcc i32 @stdcall_thunk(<{ %struct.B*, %struct.A }>* inalloca) {
 entry:
   %this_ptr = getelementptr inbounds <{ %struct.B*, %struct.A }>, <{ %struct.B*, %struct.A }>* %0, i32 0, i32 0
   %this = load %struct.B*, %struct.B** %this_ptr
@@ -148,7 +148,7 @@
   %vtable = load i32 (<{ %struct.B*, %struct.A }>*)**, i32 (<{ %struct.B*, %struct.A }>*)*** %1
   %vfn = getelementptr inbounds i32 (<{ %struct.B*, %struct.A }>*)*, i32 (<{ %struct.B*, %struct.A }>*)** %vtable, i32 1
   %2 = load i32 (<{ %struct.B*, %struct.A }>*)*, i32 (<{ %struct.B*, %struct.A }>*)** %vfn
-  %3 = musttail call x86_stdcallcc i32 %2(<{ %struct.B*, %struct.A }>* inalloca(<{ %struct.B*, %struct.A }>) %0)
+  %3 = musttail call x86_stdcallcc i32 %2(<{ %struct.B*, %struct.A }>* inalloca %0)
   ret i32 %3
 }
 
@@ -172,13 +172,13 @@
 ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
 ; CHECK: jmpl
 ; CHECK-NOT: ret
-define x86_fastcallcc i32 @fastcall_thunk(%struct.B* inreg %this, <{ %struct.A }>* inalloca(<{ %struct.A }>)) {
+define x86_fastcallcc i32 @fastcall_thunk(%struct.B* inreg %this, <{ %struct.A }>* inalloca) {
 entry:
   %1 = bitcast %struct.B* %this to i32 (%struct.B*, <{ %struct.A }>*)***
   %vtable = load i32 (%struct.B*, <{ %struct.A }>*)**, i32 (%struct.B*, <{ %struct.A }>*)*** %1
   %vfn = getelementptr inbounds i32 (%struct.B*, <{ %struct.A }>*)*, i32 (%struct.B*, <{ %struct.A }>*)** %vtable, i32 1
   %2 = load i32 (%struct.B*, <{ %struct.A }>*)*, i32 (%struct.B*, <{ %struct.A }>*)** %vfn
-  %3 = musttail call x86_fastcallcc i32 %2(%struct.B* inreg %this, <{ %struct.A }>* inalloca(<{ %struct.A }>) %0)
+  %3 = musttail call x86_fastcallcc i32 %2(%struct.B* inreg %this, <{ %struct.A }>* inalloca %0)
   ret i32 %3
 }
 
diff --git a/test/CodeGen/X86/musttail-thiscall.ll b/test/CodeGen/X86/musttail-thiscall.ll
index b999496..682f85e 100644
--- a/test/CodeGen/X86/musttail-thiscall.ll
+++ b/test/CodeGen/X86/musttail-thiscall.ll
@@ -21,14 +21,14 @@
 
 ; CHECK-LABEL: t3:
 ; CHECK: jmp {{_?}}t3_callee
-define x86_thiscallcc i8* @t3(i8* %this, <{ i8*, i32 }>* inalloca(<{ i8*, i32 }>) %args) {
+define x86_thiscallcc i8* @t3(i8* %this, <{ i8*, i32 }>* inalloca %args) {
   %adj = getelementptr i8, i8* %this, i32 4
   %a_ptr = getelementptr <{ i8*, i32 }>, <{ i8*, i32 }>* %args, i32 0, i32 1
   store i32 0, i32* %a_ptr
-  %rv = musttail call x86_thiscallcc i8* @t3_callee(i8* %adj, <{ i8*, i32 }>* inalloca(<{ i8*, i32 }>) %args)
+  %rv = musttail call x86_thiscallcc i8* @t3_callee(i8* %adj, <{ i8*, i32 }>* inalloca %args)
   ret i8* %rv
 }
-declare x86_thiscallcc i8* @t3_callee(i8* %this, <{ i8*, i32 }>* inalloca(<{ i8*, i32 }>) %args);
+declare x86_thiscallcc i8* @t3_callee(i8* %this, <{ i8*, i32 }>* inalloca %args);
 
 ; CHECK-LABEL: t4:
 ; CHECK: jmp {{_?}}t4_callee
diff --git a/test/CodeGen/X86/shrink-wrap-chkstk.ll b/test/CodeGen/X86/shrink-wrap-chkstk.ll
index 241d42c..32e046d 100644
--- a/test/CodeGen/X86/shrink-wrap-chkstk.ll
+++ b/test/CodeGen/X86/shrink-wrap-chkstk.ll
@@ -25,7 +25,7 @@
   br label %bb2
 
 bb2:
-  call void @inalloca_params(<{ %struct.S }>* inalloca(<{ %struct.S }>) nonnull %argmem)
+  call void @inalloca_params(<{ %struct.S }>* inalloca nonnull %argmem)
   ret void
 }
 
@@ -39,7 +39,7 @@
 ; CHECK: popl %ebp
 ; CHECK: retl
 
-declare void @inalloca_params(<{ %struct.S }>* inalloca(<{ %struct.S }>))
+declare void @inalloca_params(<{ %struct.S }>* inalloca)
 
 declare i32 @doSomething(i32, i32*)
 
diff --git a/test/CodeGen/X86/tail-call-mutable-memarg.ll b/test/CodeGen/X86/tail-call-mutable-memarg.ll
index e4b9dad..34db632 100644
--- a/test/CodeGen/X86/tail-call-mutable-memarg.ll
+++ b/test/CodeGen/X86/tail-call-mutable-memarg.ll
@@ -24,7 +24,7 @@
 ; CHECK:         calll   _tail_std@4
 ; CHECK:         retl    $4
 
-define x86_thiscallcc void @inalloca(i32* %this, i32* inalloca(i32) %args) {
+define x86_thiscallcc void @inalloca(i32* %this, i32* inalloca %args) {
 entry:
   %val = load i32, i32* %args
   store i32 0, i32* %args
diff --git a/test/CodeGen/X86/x86-repmov-copy-eflags.ll b/test/CodeGen/X86/x86-repmov-copy-eflags.ll
index 1106915..91bce16 100644
--- a/test/CodeGen/X86/x86-repmov-copy-eflags.ll
+++ b/test/CodeGen/X86/x86-repmov-copy-eflags.ll
@@ -5,7 +5,7 @@
 %struct.T = type { i64, [3 x i32] }
 
 ; Function Attrs: nounwind optsize
-define void @f(i8* %p, i8* %q, i32* inalloca(i32) nocapture %unused) #0 {
+define void @f(i8* %p, i8* %q, i32* inalloca nocapture %unused) #0 {
 entry:
   %g = alloca %struct.T, align 8
   %r = alloca i32, align 8
@@ -25,7 +25,7 @@
   ret void
 }
 
-define void @f_pgso(i8* %p, i8* %q, i32* inalloca(i32) nocapture %unused) !prof !14 {
+define void @f_pgso(i8* %p, i8* %q, i32* inalloca nocapture %unused) !prof !14 {
 entry:
   %g = alloca %struct.T, align 8
   %r = alloca i32, align 8
diff --git a/test/DebugInfo/X86/dbg-declare-inalloca.ll b/test/DebugInfo/X86/dbg-declare-inalloca.ll
index d6920a7..ce5e583 100644
--- a/test/DebugInfo/X86/dbg-declare-inalloca.ll
+++ b/test/DebugInfo/X86/dbg-declare-inalloca.ll
@@ -109,7 +109,7 @@
 %struct.NonTrivial = type { i32 }
 
 ; Function Attrs: nounwind
-define void @f(<{ %struct.NonTrivial, i32, i32, i32 }>* inalloca(<{ %struct.NonTrivial, i32, i32, i32 }>)) local_unnamed_addr #0 !dbg !7 {
+define void @f(<{ %struct.NonTrivial, i32, i32, i32 }>* inalloca) local_unnamed_addr #0 !dbg !7 {
 entry:
   %a = getelementptr inbounds <{ %struct.NonTrivial, i32, i32, i32 }>, <{ %struct.NonTrivial, i32, i32, i32 }>* %0, i32 0, i32 0
   %b = getelementptr inbounds <{ %struct.NonTrivial, i32, i32, i32 }>, <{ %struct.NonTrivial, i32, i32, i32 }>* %0, i32 0, i32 1
diff --git a/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll b/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll
index 257c0cb..434e4be 100644
--- a/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll
+++ b/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll
@@ -31,8 +31,8 @@
 entry:
   %t = alloca inalloca i32
   store i32 42, i32* %t
-  call void @pass_inalloca(i32* inalloca(i32) %t)
+  call void @pass_inalloca(i32* inalloca %t)
   ret void
 }
 
-declare void @pass_inalloca(i32* inalloca(i32))
+declare void @pass_inalloca(i32* inalloca)
diff --git a/test/Linker/Inputs/inalloca-type-input.ll b/test/Linker/Inputs/inalloca-type-input.ll
deleted file mode 100644
index 7fa2d8f..0000000
--- a/test/Linker/Inputs/inalloca-type-input.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-%a = type { i64 }
-%struct = type { i32, i8 }
-
-define void @g(%a* inalloca(%a)) {
-  ret void
-}
-
-declare void @baz(%struct* inalloca(%struct))
-
-define void @foo(%struct* inalloca(%struct) %a) {
-  call void @baz(%struct* inalloca(%struct) %a)
-  ret void
-}
diff --git a/test/Linker/inalloca-types.ll b/test/Linker/inalloca-types.ll
deleted file mode 100644
index 36cc9c3..0000000
--- a/test/Linker/inalloca-types.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-link %s %p/Inputs/inalloca-type-input.ll -S | FileCheck %s
-
-%a = type { i64 }
-%struct = type { i32, i8 }
-
-; CHECK-LABEL: define void @f(%a* inalloca(%a) %0)
-define void @f(%a* inalloca(%a)) {
-  ret void
-}
-
-; CHECK-LABEL: define void @bar(
-; CHECK: call void @foo(%struct* inalloca(%struct) %ptr)
-define void @bar() {
-  %ptr = alloca inalloca %struct
-  call void @foo(%struct* inalloca(%struct) %ptr)
-  ret void
-}
-
-; CHECK-LABEL: define void @g(%a* inalloca(%a) %0)
-
-; CHECK-LABEL: define void @foo(%struct* inalloca(%struct) %a)
-; CHECK-NEXT:   call void @baz(%struct* inalloca(%struct) %a)
-declare void @foo(%struct* inalloca(%struct) %a)
-
-; CHECK: declare void @baz(%struct* inalloca(%struct))
diff --git a/test/Transforms/ArgumentPromotion/X86/thiscall.ll b/test/Transforms/ArgumentPromotion/X86/thiscall.ll
index 0643397..d9f3681 100644
--- a/test/Transforms/ArgumentPromotion/X86/thiscall.ll
+++ b/test/Transforms/ArgumentPromotion/X86/thiscall.ll
@@ -12,25 +12,25 @@
 
 %struct.a = type { i8 }
 
-define internal x86_thiscallcc void @internalfun(%struct.a* %this, <{ %struct.a }>* inalloca(<{ %struct.a }>)) {
+define internal x86_thiscallcc void @internalfun(%struct.a* %this, <{ %struct.a }>* inalloca) {
 ; ARGPROMOTION-LABEL: define {{[^@]+}}@internalfun
-; ARGPROMOTION-SAME: (%struct.a* [[THIS:%.*]], <{ [[STRUCT_A:%.*]] }>* inalloca(<{ [[STRUCT_A]] }>) [[TMP0:%.*]]) {
+; ARGPROMOTION-SAME: (%struct.a* [[THIS:%.*]], <{ [[STRUCT_A:%.*]] }>* inalloca [[TMP0:%.*]])
 ; ARGPROMOTION-NEXT:  entry:
 ; ARGPROMOTION-NEXT:    [[A:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[TMP0]], i32 0, i32 0
 ; ARGPROMOTION-NEXT:    [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A]] }>, align 4
 ; ARGPROMOTION-NEXT:    [[TMP1:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[ARGMEM]], i32 0, i32 0
 ; ARGPROMOTION-NEXT:    [[CALL:%.*]] = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* [[TMP1]], %struct.a* dereferenceable(1) [[A]])
-; ARGPROMOTION-NEXT:    call void @ext(<{ [[STRUCT_A]] }>* inalloca(<{ [[STRUCT_A]] }>) [[ARGMEM]])
+; ARGPROMOTION-NEXT:    call void @ext(<{ [[STRUCT_A]] }>* inalloca [[ARGMEM]])
 ; ARGPROMOTION-NEXT:    ret void
 ;
 ; GLOBALOPT_ARGPROMOTION-LABEL: define {{[^@]+}}@internalfun
-; GLOBALOPT_ARGPROMOTION-SAME: (<{ [[STRUCT_A:%.*]] }>* [[TMP0:%.*]]) unnamed_addr {
+; GLOBALOPT_ARGPROMOTION-SAME: (<{ [[STRUCT_A:%.*]] }>* [[TMP0:%.*]]) unnamed_addr
 ; GLOBALOPT_ARGPROMOTION-NEXT:  entry:
 ; GLOBALOPT_ARGPROMOTION-NEXT:    [[A:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[TMP0]], i32 0, i32 0
 ; GLOBALOPT_ARGPROMOTION-NEXT:    [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A]] }>, align 4
 ; GLOBALOPT_ARGPROMOTION-NEXT:    [[TMP1:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[ARGMEM]], i32 0, i32 0
 ; GLOBALOPT_ARGPROMOTION-NEXT:    [[CALL:%.*]] = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* [[TMP1]], %struct.a* dereferenceable(1) [[A]])
-; GLOBALOPT_ARGPROMOTION-NEXT:    call void @ext(<{ [[STRUCT_A]] }>* inalloca(<{ [[STRUCT_A]] }>) [[ARGMEM]])
+; GLOBALOPT_ARGPROMOTION-NEXT:    call void @ext(<{ [[STRUCT_A]] }>* inalloca [[ARGMEM]])
 ; GLOBALOPT_ARGPROMOTION-NEXT:    ret void
 ;
 entry:
@@ -38,22 +38,22 @@
   %argmem = alloca inalloca <{ %struct.a }>, align 4
   %1 = getelementptr inbounds <{ %struct.a }>, <{ %struct.a }>* %argmem, i32 0, i32 0
   %call = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* %1, %struct.a* dereferenceable(1) %a)
-  call void @ext(<{ %struct.a }>* inalloca(<{ %struct.a }>) %argmem)
+  call void @ext(<{ %struct.a }>* inalloca %argmem)
   ret void
 }
 
 ; This is here to ensure @internalfun is live.
 define void @exportedfun(%struct.a* %a) {
 ; ARGPROMOTION-LABEL: define {{[^@]+}}@exportedfun
-; ARGPROMOTION-SAME: (%struct.a* [[A:%.*]]) {
+; ARGPROMOTION-SAME: (%struct.a* [[A:%.*]])
 ; ARGPROMOTION-NEXT:    [[INALLOCA_SAVE:%.*]] = tail call i8* @llvm.stacksave()
 ; ARGPROMOTION-NEXT:    [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
-; ARGPROMOTION-NEXT:    call x86_thiscallcc void @internalfun(%struct.a* [[A]], <{ [[STRUCT_A]] }>* inalloca(<{ [[STRUCT_A]] }>) [[ARGMEM]])
+; ARGPROMOTION-NEXT:    call x86_thiscallcc void @internalfun(%struct.a* [[A]], <{ [[STRUCT_A]] }>* inalloca [[ARGMEM]])
 ; ARGPROMOTION-NEXT:    call void @llvm.stackrestore(i8* [[INALLOCA_SAVE]])
 ; ARGPROMOTION-NEXT:    ret void
 ;
 ; GLOBALOPT_ARGPROMOTION-LABEL: define {{[^@]+}}@exportedfun
-; GLOBALOPT_ARGPROMOTION-SAME: (%struct.a* [[A:%.*]]) local_unnamed_addr {
+; GLOBALOPT_ARGPROMOTION-SAME: (%struct.a* [[A:%.*]]) local_unnamed_addr
 ; GLOBALOPT_ARGPROMOTION-NEXT:    [[INALLOCA_SAVE:%.*]] = tail call i8* @llvm.stacksave()
 ; GLOBALOPT_ARGPROMOTION-NEXT:    [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
 ; GLOBALOPT_ARGPROMOTION-NEXT:    call fastcc void @internalfun(<{ [[STRUCT_A]] }>* [[ARGMEM]])
@@ -62,12 +62,12 @@
 ;
   %inalloca.save = tail call i8* @llvm.stacksave()
   %argmem = alloca inalloca <{ %struct.a }>, align 4
-  call x86_thiscallcc void @internalfun(%struct.a* %a, <{ %struct.a }>* inalloca(<{ %struct.a }>) %argmem)
+  call x86_thiscallcc void @internalfun(%struct.a* %a, <{ %struct.a }>* inalloca %argmem)
   call void @llvm.stackrestore(i8* %inalloca.save)
   ret void
 }
 
 declare x86_thiscallcc %struct.a* @copy_ctor(%struct.a* returned, %struct.a* dereferenceable(1))
-declare void @ext(<{ %struct.a }>* inalloca(<{ %struct.a }>))
+declare void @ext(<{ %struct.a }>* inalloca)
 declare i8* @llvm.stacksave()
 declare void @llvm.stackrestore(i8*)
diff --git a/test/Transforms/ArgumentPromotion/inalloca.ll b/test/Transforms/ArgumentPromotion/inalloca.ll
index 7eaa749..ebf3d18 100644
--- a/test/Transforms/ArgumentPromotion/inalloca.ll
+++ b/test/Transforms/ArgumentPromotion/inalloca.ll
@@ -7,9 +7,9 @@
 %struct.ss = type { i32, i32 }
 
 ; Argpromote + sroa should change this to passing the two integers by value.
-define internal i32 @f(%struct.ss* inalloca(%struct.ss)  %s) {
+define internal i32 @f(%struct.ss* inalloca  %s) {
 ; CHECK-LABEL: define {{[^@]+}}@f
-; CHECK-SAME: (i32 [[S_0_0_VAL:%.*]], i32 [[S_0_1_VAL:%.*]]) unnamed_addr {
+; CHECK-SAME: (i32 [[S_0_0_VAL:%.*]], i32 [[S_0_1_VAL:%.*]]) unnamed_addr
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[R:%.*]] = add i32 [[S_0_0_VAL]], [[S_0_1_VAL]]
 ; CHECK-NEXT:    ret i32 [[R]]
@@ -24,7 +24,7 @@
 }
 
 define i32 @main() {
-; CHECK-LABEL: define {{[^@]+}}@main() local_unnamed_addr {
+; CHECK-LABEL: define {{[^@]+}}@main() local_unnamed_addr
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[R:%.*]] = call fastcc i32 @f(i32 1, i32 2)
 ; CHECK-NEXT:    ret i32 [[R]]
@@ -35,14 +35,14 @@
   %f1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1
   store i32 1, i32* %f0, align 4
   store i32 2, i32* %f1, align 4
-  %r = call i32 @f(%struct.ss* inalloca(%struct.ss) %S)
+  %r = call i32 @f(%struct.ss* inalloca %S)
   ret i32 %r
 }
 
 ; Argpromote can't promote %a because of the icmp use.
-define internal i1 @g(%struct.ss* %a, %struct.ss* inalloca(%struct.ss) %b) nounwind  {
+define internal i1 @g(%struct.ss* %a, %struct.ss* inalloca %b) nounwind  {
 ; CHECK-LABEL: define {{[^@]+}}@g
-; CHECK-SAME: (%struct.ss* [[A:%.*]], %struct.ss* [[B:%.*]]) unnamed_addr #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (%struct.ss* [[A:%.*]], %struct.ss* [[B:%.*]]) unnamed_addr
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[C:%.*]] = icmp eq %struct.ss* [[A]], [[B]]
 ; CHECK-NEXT:    ret i1 [[C]]
@@ -53,14 +53,14 @@
 }
 
 define i32 @test() {
-; CHECK-LABEL: define {{[^@]+}}@test() local_unnamed_addr {
+; CHECK-LABEL: define {{[^@]+}}@test() local_unnamed_addr
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4
+; CHECK-NEXT:    [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]]
 ; CHECK-NEXT:    [[C:%.*]] = call fastcc i1 @g(%struct.ss* [[S]], %struct.ss* [[S]])
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
   %S = alloca inalloca %struct.ss
-  %c = call i1 @g(%struct.ss* %S, %struct.ss* inalloca(%struct.ss) %S)
+  %c = call i1 @g(%struct.ss* %S, %struct.ss* inalloca %S)
   ret i32 0
 }
diff --git a/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll b/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
index ad452d6..9937e6c 100644
--- a/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
+++ b/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
@@ -14,15 +14,15 @@
 
 %struct.a = type { i8 }
 
-define internal x86_thiscallcc void @internalfun(%struct.a* %this, <{ %struct.a }>* inalloca(<{ %struct.a }>)) {
+define internal x86_thiscallcc void @internalfun(%struct.a* %this, <{ %struct.a }>* inalloca) {
 ; CHECK-LABEL: define {{[^@]+}}@internalfun
-; CHECK-SAME: (%struct.a* noalias nocapture nofree readnone [[THIS:%.*]], <{ [[STRUCT_A:%.*]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[TMP0:%.*]]) {
+; CHECK-SAME: (%struct.a* noalias nocapture nofree readnone [[THIS:%.*]], <{ [[STRUCT_A:%.*]] }>* inalloca noundef nonnull align 4 dereferenceable(1) [[TMP0:%.*]]) {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[A:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[TMP0]], i32 0, i32 0
 ; CHECK-NEXT:    [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A]] }>, align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[ARGMEM]], i32 0, i32 0
 ; CHECK-NEXT:    [[CALL:%.*]] = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* noundef nonnull align 4 dereferenceable(1) [[TMP1]], %struct.a* noundef nonnull align 4 dereferenceable(1) [[A]])
-; CHECK-NEXT:    call void @ext(<{ [[STRUCT_A]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
+; CHECK-NEXT:    call void @ext(<{ [[STRUCT_A]] }>* inalloca noundef nonnull align 4 dereferenceable(1) [[ARGMEM]])
 ; CHECK-NEXT:    ret void
 ;
 entry:
@@ -30,7 +30,7 @@
   %argmem = alloca inalloca <{ %struct.a }>, align 4
   %1 = getelementptr inbounds <{ %struct.a }>, <{ %struct.a }>* %argmem, i32 0, i32 0
   %call = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* %1, %struct.a* dereferenceable(1) %a)
-  call void @ext(<{ %struct.a }>* inalloca(<{ %struct.a }>) %argmem)
+  call void @ext(<{ %struct.a }>* inalloca %argmem)
   ret void
 }
 
@@ -40,19 +40,19 @@
 ; CHECK-SAME: (%struct.a* nocapture nofree readnone [[A:%.*]]) {
 ; CHECK-NEXT:    [[INALLOCA_SAVE:%.*]] = tail call i8* @llvm.stacksave() #[[ATTR1:[0-9]+]]
 ; CHECK-NEXT:    [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
-; CHECK-NEXT:    call x86_thiscallcc void @internalfun(%struct.a* noalias nocapture nofree readnone undef, <{ [[STRUCT_A]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
+; CHECK-NEXT:    call x86_thiscallcc void @internalfun(%struct.a* noalias nocapture nofree readnone undef, <{ [[STRUCT_A]] }>* inalloca noundef nonnull align 4 dereferenceable(1) [[ARGMEM]])
 ; CHECK-NEXT:    call void @llvm.stackrestore(i8* nofree [[INALLOCA_SAVE]])
 ; CHECK-NEXT:    ret void
 ;
   %inalloca.save = tail call i8* @llvm.stacksave()
   %argmem = alloca inalloca <{ %struct.a }>, align 4
-  call x86_thiscallcc void @internalfun(%struct.a* %a, <{ %struct.a }>* inalloca(<{ %struct.a }>) %argmem)
+  call x86_thiscallcc void @internalfun(%struct.a* %a, <{ %struct.a }>* inalloca %argmem)
   call void @llvm.stackrestore(i8* %inalloca.save)
   ret void
 }
 
 declare x86_thiscallcc %struct.a* @copy_ctor(%struct.a* returned, %struct.a* dereferenceable(1))
-declare void @ext(<{ %struct.a }>* inalloca(<{ %struct.a }>))
+declare void @ext(<{ %struct.a }>* inalloca)
 declare i8* @llvm.stacksave()
 declare void @llvm.stackrestore(i8*)
 ;.
diff --git a/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll b/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll
index 0b82eac..30575fe 100644
--- a/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll
+++ b/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll
@@ -9,12 +9,12 @@
 %struct.ss = type { i32, i32 }
 
 ; Argpromote + sroa should change this to passing the two integers by value.
-define internal i32 @f(%struct.ss* inalloca(%struct.ss) %s) {
+define internal i32 @f(%struct.ss* inalloca  %s) {
 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@f
-; IS__TUNIT____-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] {
+; IS__TUNIT____-SAME: (%struct.ss* inalloca noalias nocapture nofree noundef nonnull align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] {
 ; IS__TUNIT____-NEXT:  entry:
-; IS__TUNIT____-NEXT:    [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
+; IS__TUNIT____-NEXT:    [[F0:%.*]] = getelementptr [[STRUCT_SS:%.*]], %struct.ss* [[S]], i32 0, i32 0
 ; IS__TUNIT____-NEXT:    [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
 ; IS__TUNIT____-NEXT:    [[A:%.*]] = load i32, i32* [[F0]], align 4
 ; IS__TUNIT____-NEXT:    [[B:%.*]] = load i32, i32* [[F1]], align 4
@@ -23,9 +23,9 @@
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@f
-; IS__CGSCC____-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] {
+; IS__CGSCC____-SAME: (%struct.ss* inalloca noalias nocapture nofree noundef nonnull align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] {
 ; IS__CGSCC____-NEXT:  entry:
-; IS__CGSCC____-NEXT:    [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
+; IS__CGSCC____-NEXT:    [[F0:%.*]] = getelementptr [[STRUCT_SS:%.*]], %struct.ss* [[S]], i32 0, i32 0
 ; IS__CGSCC____-NEXT:    [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
 ; IS__CGSCC____-NEXT:    [[A:%.*]] = load i32, i32* [[F0]], align 4
 ; IS__CGSCC____-NEXT:    [[B:%.*]] = load i32, i32* [[F1]], align 4
@@ -51,7 +51,7 @@
 ; IS__TUNIT____-NEXT:    [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
 ; IS__TUNIT____-NEXT:    store i32 1, i32* [[F0]], align 4
 ; IS__TUNIT____-NEXT:    store i32 2, i32* [[F1]], align 4
-; IS__TUNIT____-NEXT:    [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]]
+; IS__TUNIT____-NEXT:    [[R:%.*]] = call i32 @f(%struct.ss* inalloca noalias nocapture nofree noundef nonnull align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]]
 ; IS__TUNIT____-NEXT:    ret i32 [[R]]
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
@@ -63,7 +63,7 @@
 ; IS__CGSCC____-NEXT:    [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
 ; IS__CGSCC____-NEXT:    store i32 1, i32* [[F0]], align 4
 ; IS__CGSCC____-NEXT:    store i32 2, i32* [[F1]], align 4
-; IS__CGSCC____-NEXT:    [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]]
+; IS__CGSCC____-NEXT:    [[R:%.*]] = call i32 @f(%struct.ss* inalloca noalias nocapture nofree noundef nonnull align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]]
 ; IS__CGSCC____-NEXT:    ret i32 [[R]]
 ;
 entry:
@@ -72,15 +72,15 @@
   %f1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1
   store i32 1, i32* %f0, align 4
   store i32 2, i32* %f1, align 4
-  %r = call i32 @f(%struct.ss* inalloca(%struct.ss) %S)
+  %r = call i32 @f(%struct.ss* inalloca %S)
   ret i32 %r
 }
 
 ; Argpromote can't promote %a because of the icmp use.
-define internal i1 @g(%struct.ss* %a, %struct.ss* inalloca(%struct.ss) %b) nounwind  {
+define internal i1 @g(%struct.ss* %a, %struct.ss* inalloca %b) nounwind  {
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@g
-; IS__CGSCC____-SAME: (%struct.ss* noalias nocapture nofree nonnull readnone align 4 dereferenceable(8) [[A:%.*]], %struct.ss* noalias nocapture nofree nonnull writeonly inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[B:%.*]]) #[[ATTR1]] {
+; IS__CGSCC____-SAME: (%struct.ss* noalias nocapture nofree nonnull readnone align 4 dereferenceable(8) [[A:%.*]], %struct.ss* inalloca noalias nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[B:%.*]]) #[[ATTR1]] {
 ; IS__CGSCC____-NEXT:  entry:
 ; IS__CGSCC____-NEXT:    ret i1 undef
 ;
@@ -104,7 +104,7 @@
 ;
 entry:
   %S = alloca inalloca %struct.ss
-  %c = call i1 @g(%struct.ss* %S, %struct.ss* inalloca(%struct.ss) %S)
+  %c = call i1 @g(%struct.ss* %S, %struct.ss* inalloca %S)
   ret i32 0
 }
 ;.
diff --git a/test/Transforms/Attributor/readattrs.ll b/test/Transforms/Attributor/readattrs.ll
index c440e12..9f28407 100644
--- a/test/Transforms/Attributor/readattrs.ll
+++ b/test/Transforms/Attributor/readattrs.ll
@@ -107,15 +107,15 @@
 }
 
 ; inalloca parameters are always considered written
-define void @test7_1(i32* inalloca(i32) %a) {
+define void @test7_1(i32* inalloca %a) {
 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test7_1
-; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] {
+; IS__TUNIT____-SAME: (i32* inalloca nocapture nofree nonnull writeonly dereferenceable(4) [[A:%.*]]) #[[ATTR1]] {
 ; IS__TUNIT____-NEXT:    ret void
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test7_1
-; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] {
+; IS__CGSCC____-SAME: (i32* inalloca nocapture nofree nonnull writeonly dereferenceable(4) [[A:%.*]]) #[[ATTR1]] {
 ; IS__CGSCC____-NEXT:    ret void
 ;
   ret void
diff --git a/test/Transforms/Attributor/value-simplify.ll b/test/Transforms/Attributor/value-simplify.ll
index 0ed93a9..41fa16c 100644
--- a/test/Transforms/Attributor/value-simplify.ll
+++ b/test/Transforms/Attributor/value-simplify.ll
@@ -332,15 +332,15 @@
 
 ; Do not touch complicated arguments (for now)
 %struct.X = type { i8* }
-define internal i32* @test_inalloca(i32* inalloca(i32) %a) {
+define internal i32* @test_inalloca(i32* inalloca %a) {
 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_inalloca
-; IS__TUNIT____-SAME: (i32* noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
+; IS__TUNIT____-SAME: (i32* inalloca noalias nofree nonnull returned writeonly dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
 ; IS__TUNIT____-NEXT:    ret i32* [[A]]
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inalloca
-; IS__CGSCC____-SAME: (i32* noalias nofree noundef nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
+; IS__CGSCC____-SAME: (i32* inalloca noalias nofree noundef nonnull returned writeonly dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
 ; IS__CGSCC____-NEXT:    ret i32* [[A]]
 ;
   ret i32* %a
diff --git a/test/Transforms/DeadArgElim/keepalive.ll b/test/Transforms/DeadArgElim/keepalive.ll
index b9be83e..fff14a7 100644
--- a/test/Transforms/DeadArgElim/keepalive.ll
+++ b/test/Transforms/DeadArgElim/keepalive.ll
@@ -39,13 +39,13 @@
 
 ; We can't remove 'this' here, as that would put argmem in ecx instead of
 ; memory.
-define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca(i32) %argmem) {
+define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca %argmem) {
 ;
 ;
   %v = load i32, i32* %argmem
   ret i32 %v
 }
-; CHECK-LABEL: define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca(i32) %argmem)
+; CHECK-LABEL: define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca %argmem)
 
 define i32 @caller2() {
 ;
@@ -53,7 +53,7 @@
   %t = alloca i32
   %m = alloca inalloca i32
   store i32 42, i32* %m
-  %v = call x86_thiscallcc i32 @unused_this(i32* %t, i32* inalloca(i32) %m)
+  %v = call x86_thiscallcc i32 @unused_this(i32* %t, i32* inalloca %m)
   ret i32 %v
 }
 
diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll
index 361b243..48a939c 100644
--- a/test/Transforms/DeadStoreElimination/simple.ll
+++ b/test/Transforms/DeadStoreElimination/simple.ll
@@ -148,7 +148,7 @@
 }
 
 ; Test for inalloca handling.
-define void @test9_2(%struct.x* inalloca(%struct.x) %a) nounwind {
+define void @test9_2(%struct.x* inalloca  %a) nounwind  {
 ; CHECK-LABEL: @test9_2(
 ; CHECK-NEXT:    ret void
 ;
diff --git a/test/Transforms/FunctionAttrs/readattrs.ll b/test/Transforms/FunctionAttrs/readattrs.ll
index 6585ee4..ae34219 100644
--- a/test/Transforms/FunctionAttrs/readattrs.ll
+++ b/test/Transforms/FunctionAttrs/readattrs.ll
@@ -50,9 +50,9 @@
   ret void
 }
 
-; CHECK: define void @test7_1(i32* nocapture inalloca(i32) %a)
+; CHECK: define void @test7_1(i32* inalloca nocapture %a)
 ; inalloca parameters are always considered written
-define void @test7_1(i32* inalloca(i32) %a) {
+define void @test7_1(i32* inalloca %a) {
   ret void
 }
 
diff --git a/test/Transforms/GVNHoist/hoist-pr28606.ll b/test/Transforms/GVNHoist/hoist-pr28606.ll
index d8bad7a..2c58828 100644
--- a/test/Transforms/GVNHoist/hoist-pr28606.ll
+++ b/test/Transforms/GVNHoist/hoist-pr28606.ll
@@ -5,7 +5,7 @@
 
 %struct.S = type { i8* }
 
-declare void @f(<{ %struct.S }>* inalloca(<{ %struct.S }>))
+declare void @f(<{ %struct.S }>* inalloca)
 
 
 ; Check that we don't clone the %x alloca and insert it in the live range of
@@ -41,7 +41,7 @@
   br label %exit
 
 exit:
-  call void @f(<{ %struct.S }>* inalloca(<{ %struct.S }>) %argmem)
+  call void @f(<{ %struct.S }>* inalloca %argmem)
   call void @llvm.stackrestore(i8* %inalloca.save)
   ret void
 }
diff --git a/test/Transforms/GlobalOpt/fastcc.ll b/test/Transforms/GlobalOpt/fastcc.ll
index 0278d83..edd0688 100644
--- a/test/Transforms/GlobalOpt/fastcc.ll
+++ b/test/Transforms/GlobalOpt/fastcc.ll
@@ -29,19 +29,19 @@
   ret i32 %v
 }
 
-define internal i32 @inalloca(i32* inalloca(i32) %p) {
+define internal i32 @inalloca(i32* inalloca %p) {
 ; CHECK-LABEL: define internal fastcc i32 @inalloca(i32* %p)
   %rv = load i32, i32* %p
   ret i32 %rv
 }
 
-define i32 @inalloca2_caller(i32* inalloca(i32) %p) {
-  %rv = musttail call i32 @inalloca2(i32* inalloca(i32) %p)
+define i32 @inalloca2_caller(i32* inalloca %p) {
+  %rv = musttail call i32 @inalloca2(i32* inalloca %p)
   ret i32 %rv
 }
-define internal i32 @inalloca2(i32* inalloca(i32) %p) {
+define internal i32 @inalloca2(i32* inalloca %p) {
 ; Because of the musttail caller, this inalloca cannot be dropped.
-; CHECK-LABEL: define internal i32 @inalloca2(i32* inalloca(i32) %p)
+; CHECK-LABEL: define internal i32 @inalloca2(i32* inalloca %p)
   %rv = load i32, i32* %p
   ret i32 %rv
 }
@@ -59,7 +59,7 @@
   call coldcc i32 @h(i32* %m)
   call i32 @j(i32* %m)
   %args = alloca inalloca i32
-  call i32 @inalloca(i32* inalloca(i32) %args)
+  call i32 @inalloca(i32* inalloca %args)
   %c = call token @llvm.call.preallocated.setup(i32 1)
   %N = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32)
   %n = bitcast i8* %N to i32*
diff --git a/test/Transforms/Inline/inalloca-not-static.ll b/test/Transforms/Inline/inalloca-not-static.ll
index 1a6dd75..74b5ecf 100644
--- a/test/Transforms/Inline/inalloca-not-static.ll
+++ b/test/Transforms/Inline/inalloca-not-static.ll
@@ -41,13 +41,13 @@
   %argmem = alloca inalloca <{ %struct.Foo }>, align 4
   %0 = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %argmem, i32 0, i32 0
   %call = call x86_thiscallcc %struct.Foo* @"\01??0Foo@@QAE@XZ"(%struct.Foo* %0)
-  call void @h(<{ %struct.Foo }>* inalloca(<{ %struct.Foo }>) %argmem)
+  call void @h(<{ %struct.Foo }>* inalloca %argmem)
   call void @llvm.stackrestore(i8* %inalloca.save)
   ret void
 }
 
 ; Function Attrs: alwaysinline inlinehint nounwind
-define internal void @h(<{ %struct.Foo }>* inalloca(<{ %struct.Foo }>)) alwaysinline {
+define internal void @h(<{ %struct.Foo }>* inalloca) alwaysinline {
 entry:
   %o = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
   call x86_thiscallcc void @"\01??1Foo@@QAE@XZ"(%struct.Foo* %o)
diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll
index fee8e0e..072d5f2 100644
--- a/test/Transforms/InstCombine/alloca.ll
+++ b/test/Transforms/InstCombine/alloca.ll
@@ -207,7 +207,7 @@
 
 ; PR19569
 %struct_type = type { i32, i32 }
-declare void @test9_aux(<{ %struct_type }>* inalloca(<{ %struct_type }>))
+declare void @test9_aux(<{ %struct_type }>* inalloca)
 declare i8* @llvm.stacksave()
 declare void @llvm.stackrestore(i8*)
 
@@ -219,7 +219,7 @@
 ; ALL-NEXT:    [[TMP0:%.*]] = bitcast %struct_type* [[A:%.*]] to i64*
 ; ALL-NEXT:    [[TMP1:%.*]] = load i64, i64* [[TMP0]], align 4
 ; ALL-NEXT:    store i64 [[TMP1]], i64* [[ARGMEM]], align 8
-; ALL-NEXT:    call void @test9_aux(<{ [[STRUCT_TYPE]] }>* nonnull inalloca(<{ [[STRUCT_TYPE]] }>) [[TMPCAST]])
+; ALL-NEXT:    call void @test9_aux(<{ [[STRUCT_TYPE]] }>* inalloca nonnull [[TMPCAST]])
 ; ALL-NEXT:    ret void
 ;
 entry:
@@ -229,7 +229,7 @@
   %1 = bitcast %struct_type* %0 to i8*
   %2 = bitcast %struct_type* %a to i8*
   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %1, i8* align 4 %2, i32 8, i1 false)
-  call void @test9_aux(<{ %struct_type }>* inalloca(<{ %struct_type }>) %argmem)
+  call void @test9_aux(<{ %struct_type }>* inalloca %argmem)
   call void @llvm.stackrestore(i8* %inalloca.save)
   ret void
 }
diff --git a/test/Transforms/InstCombine/call-cast-target-inalloca.ll b/test/Transforms/InstCombine/call-cast-target-inalloca.ll
index bbf2008..90289e2 100644
--- a/test/Transforms/InstCombine/call-cast-target-inalloca.ll
+++ b/test/Transforms/InstCombine/call-cast-target-inalloca.ll
@@ -4,12 +4,12 @@
 target triple = "i686-pc-linux-gnu"
 
 declare void @takes_i32(i32)
-declare void @takes_i32_inalloca(i32* inalloca(i32))
+declare void @takes_i32_inalloca(i32* inalloca)
 
 define void @f() {
 ; CHECK-LABEL: define void @f()
   %args = alloca inalloca i32
-  call void bitcast (void (i32)* @takes_i32 to void (i32*)*)(i32* inalloca(i32) %args)
+  call void bitcast (void (i32)* @takes_i32 to void (i32*)*)(i32* inalloca %args)
 ; CHECK: call void bitcast
   ret void
 }
diff --git a/test/Transforms/InstCombine/stacksaverestore.ll b/test/Transforms/InstCombine/stacksaverestore.ll
index cbc353a..9eb0efb 100644
--- a/test/Transforms/InstCombine/stacksaverestore.ll
+++ b/test/Transforms/InstCombine/stacksaverestore.ll
@@ -9,7 +9,7 @@
 define i32* @test1(i32 %P) {
 	%tmp = call i8* @llvm.stacksave( )
 	call void @llvm.stackrestore( i8* %tmp ) ;; not restoring anything
-	%A = alloca i32, i32 %P
+	%A = alloca i32, i32 %P		
 	ret i32* %A
 }
 
@@ -49,7 +49,7 @@
 	%tmp77 = alloca i8, i32 %size		; <i8*> [#uses=1]
 	%tmp78 = call i8* @llvm.stacksave( )		; <i8*> [#uses=1]
 	%tmp102 = alloca i8, i32 %size		; <i8*> [#uses=1]
-	call void @bar( i32 %i.0.reg2mem.0, i8* %tmp23, i8* %tmp52, i8* %tmp77, i8* %tmp102, i32 %size ) nounwind
+	call void @bar( i32 %i.0.reg2mem.0, i8* %tmp23, i8* %tmp52, i8* %tmp77, i8* %tmp102, i32 %size ) nounwind 
 	call void @llvm.stackrestore( i8* %tmp78 )
 	call void @llvm.stackrestore( i8* %tmp53 )
 	call void @llvm.stackrestore( i8* %tmp28 )
@@ -72,7 +72,7 @@
 
 declare void @bar(i32, i8*, i8*, i8*, i8*, i32)
 
-declare void @inalloca_callee(i32* inalloca(i32))
+declare void @inalloca_callee(i32* inalloca)
 
 define void @test3(i32 %c) {
 entry:
@@ -83,7 +83,7 @@
   %save1 = call i8* @llvm.stacksave()
   %argmem = alloca inalloca i32
   store i32 0, i32* %argmem
-  call void @inalloca_callee(i32* inalloca(i32) %argmem)
+  call void @inalloca_callee(i32* inalloca %argmem)
 
   ; This restore cannot be deleted, the restore below does not make it dead.
   call void @llvm.stackrestore(i8* %save1)
@@ -106,7 +106,7 @@
 ; CHECK: %save1 = call i8* @llvm.stacksave()
 ; CHECK: %argmem = alloca inalloca i32
 ; CHECK: store i32 0, i32* %argmem
-; CHECK: call void @inalloca_callee(i32* {{.*}} inalloca(i32) %argmem)
+; CHECK: call void @inalloca_callee(i32* inalloca {{.*}} %argmem)
 ; CHECK: call void @llvm.stackrestore(i8* %save1)
 ; CHECK: br i1 %done, label %loop, label %return
 ; CHECK: ret void
diff --git a/test/Verifier/align.ll b/test/Verifier/align.ll
index 1f5c8da..38ce377 100644
--- a/test/Verifier/align.ll
+++ b/test/Verifier/align.ll
@@ -1,12 +1,12 @@
 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
 
-; CHECK: Wrong types for attribute: nest noalias nocapture nonnull readnone readonly byref(i32) byval(i32) inalloca(i32) preallocated(i32) sret(i32) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture nonnull readnone readonly byref(i32) byval(i32) preallocated(i32) sret(i32) align 1 dereferenceable(1) dereferenceable_or_null(1)
 ; CHECK-NEXT: @align_non_pointer1
 define void @align_non_pointer1(i32 align 4 %a) {
   ret void
 }
 
-; CHECK: Wrong types for attribute: nest noalias nocapture noundef nonnull readnone readonly signext zeroext byref(void) byval(void) inalloca(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture noundef nonnull readnone readonly signext zeroext byref(void) byval(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
 ; CHECK-NEXT: @align_non_pointer2
 define align 4 void @align_non_pointer2(i32 %a) {
   ret void
diff --git a/test/Verifier/amdgpu-cc.ll b/test/Verifier/amdgpu-cc.ll
index 61f1c68..b9b4c50 100644
--- a/test/Verifier/amdgpu-cc.ll
+++ b/test/Verifier/amdgpu-cc.ll
@@ -118,7 +118,7 @@
 
 ; CHECK: Calling convention disallows inalloca
 ; CHECK-NEXT: void (i32*)* @inalloca_as0_cc_amdgpu_kernel
-define amdgpu_kernel void @inalloca_as0_cc_amdgpu_kernel(i32* inalloca(i32) %ptr) {
+define amdgpu_kernel void @inalloca_as0_cc_amdgpu_kernel(i32* inalloca %ptr) {
   ret void
 }
 
diff --git a/test/Verifier/byref.ll b/test/Verifier/byref.ll
index d5921bf..2f22ee3 100644
--- a/test/Verifier/byref.ll
+++ b/test/Verifier/byref.ll
@@ -28,7 +28,7 @@
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
 ; CHECK-NEXT: void (i32*)* @byref_inalloca
-define void @byref_inalloca(i32* byref(i32) inalloca(i32)) {
+define void @byref_inalloca(i32* byref(i32) inalloca) {
   ret void
 }
 
@@ -56,7 +56,7 @@
   ret void
 }
 
-; CHECK: Wrong types for attribute: nest noalias nocapture nonnull readnone readonly byref(i32) byval(i32) inalloca(i32) preallocated(i32) sret(i32) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture nonnull readnone readonly byref(i32) byval(i32) preallocated(i32) sret(i32) align 1 dereferenceable(1) dereferenceable_or_null(1)
 ; CHECK-NEXT: void (i32)* @byref_non_pointer
 define void @byref_non_pointer(i32 byref(i32)) {
   ret void
diff --git a/test/Verifier/byval-1.ll b/test/Verifier/byval-1.ll
index 6344371..e2b4519 100644
--- a/test/Verifier/byval-1.ll
+++ b/test/Verifier/byval-1.ll
@@ -1,5 +1,5 @@
 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
 
-; CHECK: Wrong types for attribute: nest noalias nocapture nonnull readnone readonly byref(i32) byval(i32) inalloca(i32) preallocated(i32) sret(i32) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture nonnull readnone readonly byref(i32) byval(i32) preallocated(i32) sret(i32) align 1 dereferenceable(1) dereferenceable_or_null(1)
 ; CHECK-NEXT: void (i32)* @h
 declare void @h(i32 byval(i32) %num)
diff --git a/test/Verifier/inalloca-vararg.ll b/test/Verifier/inalloca-vararg.ll
index de7622b..428f89e 100644
--- a/test/Verifier/inalloca-vararg.ll
+++ b/test/Verifier/inalloca-vararg.ll
@@ -3,7 +3,7 @@
 declare void @h(i32, ...)
 define void @i() {
   %args = alloca inalloca i32
-  call void (i32, ...) @h(i32 1, i32* inalloca(i32) %args, i32 3)
+  call void (i32, ...) @h(i32 1, i32* inalloca %args, i32 3)
 ; CHECK: inalloca isn't on the last argument!
   ret void
 }
diff --git a/test/Verifier/inalloca1.ll b/test/Verifier/inalloca1.ll
index 76da66a..7ee2cba 100644
--- a/test/Verifier/inalloca1.ll
+++ b/test/Verifier/inalloca1.ll
@@ -1,34 +1,22 @@
 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
-declare void @a(i64* byval(i64) inalloca(i64) %p)
+declare void @a(i64* byval(i64) inalloca %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @b(i64* inreg inalloca(i64) %p)
+declare void @b(i64* inreg inalloca %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @c(i64* sret(i64) inalloca(i64) %p)
+declare void @c(i64* sret(i64) inalloca %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @d(i64* nest inalloca(i64) %p)
+declare void @d(i64* nest inalloca %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @e(i64* readonly inalloca(i64) %p)
+declare void @e(i64* readonly inalloca %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @f(void ()* inalloca(void()) %p)
+declare void @f(void ()* inalloca %p)
 ; CHECK: do not support unsized types
 
-declare void @g(i32* inalloca(i32) %p, i32 %p2)
+declare void @g(i32* inalloca %p, i32 %p2)
 ; CHECK: inalloca isn't on the last parameter!
-
-; CHECK: Attribute 'inalloca' type does not match parameter!
-; CHECK-NEXT: void (i32*)* @inalloca_mismatched_pointee_type0
-define void @inalloca_mismatched_pointee_type0(i32* inalloca(i8)) {
-  ret void
-}
-
-; CHECK: Wrong types for attribute:
-; CHECK-NEXT: void (i8)* @inalloca_not_pointer
-define void @inalloca_not_pointer(i8 byref(i8)) {
-  ret void
-}
diff --git a/test/Verifier/inalloca2.ll b/test/Verifier/inalloca2.ll
index 21fc251..12a4549 100644
--- a/test/Verifier/inalloca2.ll
+++ b/test/Verifier/inalloca2.ll
@@ -2,21 +2,21 @@
 ; doesn't reject it.
 ; RUN: llvm-as %s -o /dev/null
 
-declare void @doit(i64* inalloca(i64) %a)
+declare void @doit(i64* inalloca %a)
 
 define void @a() {
 entry:
   %a = alloca inalloca [2 x i32]
   %b = bitcast [2 x i32]* %a to i64*
-  call void @doit(i64* inalloca(i64) %b)
+  call void @doit(i64* inalloca %b)
   ret void
 }
 
 define void @b() {
 entry:
   %a = alloca inalloca i64
-  call void @doit(i64* inalloca(i64) %a)
-  call void @doit(i64* inalloca(i64) %a)
+  call void @doit(i64* inalloca %a)
+  call void @doit(i64* inalloca %a)
   ret void
 }
 
@@ -34,6 +34,6 @@
 
 call:
   %args = phi i64* [ %a, %if ], [ %b, %else ]
-  call void @doit(i64* inalloca(i64) %args)
+  call void @doit(i64* inalloca %args)
   ret void
 }
diff --git a/test/Verifier/inalloca3.ll b/test/Verifier/inalloca3.ll
index 28cdbfe..c09ce10 100644
--- a/test/Verifier/inalloca3.ll
+++ b/test/Verifier/inalloca3.ll
@@ -1,13 +1,13 @@
 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
 
-declare void @doit(i64* inalloca(i64) %a)
+declare void @doit(i64* inalloca %a)
 
 define void @a() {
 entry:
   %a = alloca [2 x i32]
   %b = bitcast [2 x i32]* %a to i64*
-  call void @doit(i64* inalloca(i64) %b)
+  call void @doit(i64* inalloca %b)
 ; CHECK: inalloca argument for call has mismatched alloca
   ret void
 }
diff --git a/test/Verifier/noundef.ll b/test/Verifier/noundef.ll
index 2ece2dd..7b199cd 100644
--- a/test/Verifier/noundef.ll
+++ b/test/Verifier/noundef.ll
@@ -1,6 +1,6 @@
 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
 
-; CHECK: Wrong types for attribute: nest noalias nocapture noundef nonnull readnone readonly signext zeroext byref(void) byval(void) inalloca(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture noundef nonnull readnone readonly signext zeroext byref(void) byval(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
 ; CHECK-NEXT: @noundef_void
 define noundef void @noundef_void() {
   ret void
diff --git a/unittests/IR/AttributesTest.cpp b/unittests/IR/AttributesTest.cpp
index 11b1598..2c19126 100644
--- a/unittests/IR/AttributesTest.cpp
+++ b/unittests/IR/AttributesTest.cpp
@@ -180,6 +180,9 @@
   Attribute A = Attribute::getWithByValType(C, Ty);
   EXPECT_EQ(A.getAsString(), "byval(%mystruct)");
 
+  A = Attribute::getWithByValType(C, nullptr);
+  EXPECT_EQ(A.getAsString(), "byval");
+
   A = Attribute::getWithByValType(C, Type::getInt32Ty(C));
   EXPECT_EQ(A.getAsString(), "byval(i32)");
 }
diff --git a/unittests/Transforms/Utils/CloningTest.cpp b/unittests/Transforms/Utils/CloningTest.cpp
index 34802b6..6bab802 100644
--- a/unittests/Transforms/Utils/CloningTest.cpp
+++ b/unittests/Transforms/Utils/CloningTest.cpp
@@ -718,10 +718,10 @@
 
 TEST(CloneFunction, CloneFunctionWithInalloca) {
   StringRef ImplAssembly = R"(
-    declare void @a(i32* inalloca(i32))
+    declare void @a(i32* inalloca)
     define void @foo() {
       %a = alloca inalloca i32
-      call void @a(i32* inalloca(i32) %a)
+      call void @a(i32* inalloca %a)
       ret void
     }
     declare void @bar()