diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -9571,8 +9571,7 @@ The '``alloca``' instruction allocates memory on the stack frame of the currently executing function, to be automatically released when this -function returns to its caller. The object is always allocated in the -address space for allocas indicated in the datalayout. +function returns to its caller. Arguments: """""""""" diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -3811,11 +3811,6 @@ void Verifier::visitAllocaInst(AllocaInst &AI) { SmallPtrSet Visited; - PointerType *PTy = AI.getType(); - // TODO: Relax this restriction? - Assert(PTy->getAddressSpace() == DL.getAllocaAddrSpace(), - "Allocation instruction pointer not in the stack address space!", - &AI); Assert(AI.getAllocatedType()->isSized(&Visited), "Cannot allocate unsized type", &AI); Assert(AI.getArraySize()->getType()->isIntegerTy(), diff --git a/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-0.ll b/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-0.ll deleted file mode 100644 --- a/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-0.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: not llvm-as < %s 2>&1 | FileCheck %s - -target datalayout = "A1" - -; CHECK: Allocation instruction pointer not in the stack address space! -; CHECK-NEXT: %alloca_scalar_no_align = alloca i32, align 4, addrspace(2) - -define void @use_alloca() { - %alloca_scalar_no_align = alloca i32, addrspace(2) - ret void -} diff --git a/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-1.ll b/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-1.ll deleted file mode 100644 --- a/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-1.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: not llvm-as < %s 2>&1 | FileCheck %s - -target datalayout = "A1" - -; CHECK: Allocation instruction pointer not in the stack address space! -; CHECK-NEXT: %alloca_scalar_no_align = alloca i32, align 4, addrspace(2) - -define void @use_alloca() { - %alloca_scalar_no_align = alloca i32, align 4, addrspace(2) - ret void -} diff --git a/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-2.ll b/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-2.ll deleted file mode 100644 --- a/llvm/test/Assembler/datalayout-alloca-addrspace-mismatch-2.ll +++ /dev/null @@ -1,13 +0,0 @@ -; RUN: not llvm-as < %s 2>&1 | FileCheck %s - -target datalayout = "A1" - -; CHECK: Allocation instruction pointer not in the stack address space! -; CHECK-NEXT: %alloca_scalar_no_align = alloca i32, align 4, addrspace(2), !foo !0 - -define void @use_alloca() { - %alloca_scalar_no_align = alloca i32, align 4, addrspace(2), !foo !0 - ret void -} - -!0 = !{} diff --git a/llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll b/llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll --- a/llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll +++ b/llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll @@ -12,7 +12,6 @@ metadata i8* undef, metadata !DILocalVariable(scope: !1), metadata !DIExpression()) -; ALL-NOT: Allocation instruction pointer not in the stack address space! ; AS: llvm.dbg.value intrinsic requires a !dbg attachment ; AS: warning: ignoring invalid debug info in ret void diff --git a/llvm/test/CodeGen/AMDGPU/invalid-alloca.ll b/llvm/test/CodeGen/AMDGPU/invalid-alloca.ll --- a/llvm/test/CodeGen/AMDGPU/invalid-alloca.ll +++ b/llvm/test/CodeGen/AMDGPU/invalid-alloca.ll @@ -5,7 +5,6 @@ ; RUN: llvm-as < %s | not opt -data-layout=A5 2>&1 | FileCheck -check-prefixes=MISMATCH %s ; AS: assembly parsed, but does not verify as correct! -; COMMON: Allocation instruction pointer not in the stack address space! ; COMMON: %tmp = alloca i32 ; MISMATCH: Explicit load/store type does not match pointee type of pointer operand ; LLC: error: {{.*}}input module cannot be verified