diff options
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 3 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/lifetime.ll | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index e001f6d2863..383010f0f9d 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1789,6 +1789,9 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, IRBuilder<> builder(&FirstNewBlock->front()); for (unsigned ai = 0, ae = IFI.StaticAllocas.size(); ai != ae; ++ai) { AllocaInst *AI = IFI.StaticAllocas[ai]; + // Don't mark swifterror allocas. They can't have bitcast uses. + if (AI->isSwiftError()) + continue; // If the alloca is already scoped to something smaller than the whole // function then there's no need to add redundant, less accurate markers. diff --git a/llvm/test/Transforms/Inline/lifetime.ll b/llvm/test/Transforms/Inline/lifetime.ll index 12c433b9e62..fc209ccc50f 100644 --- a/llvm/test/Transforms/Inline/lifetime.ll +++ b/llvm/test/Transforms/Inline/lifetime.ll @@ -98,3 +98,20 @@ define void @test_arrays_alloca() { ; CHECK: ret void ret void } + +%swift.error = type opaque + +define void @helper_swifterror_alloca() { +entry: + %swifterror = alloca swifterror %swift.error*, align 8 + store %swift.error* null, %swift.error** %swifterror, align 8 + ret void +} + +define void @test_swifterror_alloca() { +; CHECK-LABEL: @test_swifterror_alloca( +; CHECK-NOT: lifetime + call void @helper_swifterror_alloca() +; CHECK: ret void + ret void +} |