From f3470cc979c7314e5d5d0cae16d2eb24f0cf11e0 Mon Sep 17 00:00:00 2001 From: "Arnaud A. de Grandmaison" Date: Mon, 1 Dec 2014 09:30:16 +0000 Subject: [PATCH] Revert "Remove threshold for lifetime marker insertion of named temporaries" Revert r222993 while I investigate some MemorySanitizer failures. llvm-svn: 222995 --- clang/lib/CodeGen/CGDecl.cpp | 52 +++++++------- clang/lib/CodeGen/CodeGenFunction.h | 3 - clang/test/CodeGenCXX/destructors.cpp | 5 +- clang/test/CodeGenCXX/nrvo.cpp | 15 +--- clang/test/CodeGenObjC/arc-blocks.m | 20 +----- clang/test/CodeGenObjC/arc-bridged-cast.m | 11 +-- clang/test/CodeGenObjC/arc-literals.m | 4 -- clang/test/CodeGenObjC/arc-precise-lifetime.m | 44 ------------ clang/test/CodeGenObjC/arc-ternary-op.m | 12 ---- clang/test/CodeGenObjC/arc.m | 100 +------------------------- clang/test/CodeGenObjC/exceptions.m | 3 - clang/test/CodeGenObjCXX/arc-move.mm | 10 --- clang/test/CodeGenObjCXX/arc-references.mm | 8 --- clang/test/CodeGenObjCXX/arc.mm | 27 ------- clang/test/CodeGenObjCXX/literals.mm | 14 +--- 15 files changed, 34 insertions(+), 294 deletions(-) diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 48ba97d..959ac9a 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -512,7 +512,10 @@ namespace { : Addr(addr), Size(size) {} void Emit(CodeGenFunction &CGF, Flags flags) override { - CGF.EmitLifetimeEnd(Size, Addr); + llvm::Value *castAddr = CGF.Builder.CreateBitCast(Addr, CGF.Int8PtrTy); + CGF.Builder.CreateCall2(CGF.CGM.getLLVMLifetimeEndFn(), + Size, castAddr) + ->setDoesNotThrow(); } }; } @@ -832,6 +835,21 @@ static bool shouldUseMemSetPlusStoresToInitialize(llvm::Constant *Init, canEmitInitWithFewStoresAfterMemset(Init, StoreBudget); } +/// Should we use the LLVM lifetime intrinsics for the given local variable? +static bool shouldUseLifetimeMarkers(CodeGenFunction &CGF, const VarDecl &D, + unsigned Size) { + // For now, only in optimized builds. + if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) + return false; + + // Limit the size of marked objects to 32 bytes. We don't want to increase + // compile time by marking tiny objects. + unsigned SizeThreshold = 32; + + return Size > SizeThreshold; +} + + /// EmitAutoVarDecl - Emit code and set up an entry in LocalDeclMap for a /// variable declaration with auto, register, or no storage class specifier. /// These turn into simple stack objects, or GlobalValues depending on target. @@ -841,29 +859,6 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D) { EmitAutoVarCleanups(emission); } -/// Emit a lifetime.begin marker if some criteria are satisfied. -/// \return a pointer to the temporary size Value if a marker was emitted, null -/// otherwise -llvm::Value *CodeGenFunction::EmitLifetimeStart(uint64_t Size, - llvm::Value *Addr) { - // For now, only in optimized builds. - if (CGM.getCodeGenOpts().OptimizationLevel == 0) - return nullptr; - - llvm::Value *SizeV = llvm::ConstantInt::get(Int64Ty, Size); - llvm::Value *CastAddr = Builder.CreateBitCast(Addr, Int8PtrTy); - Builder.CreateCall2(CGM.getLLVMLifetimeStartFn(), SizeV, CastAddr) - ->setDoesNotThrow(); - - return SizeV; -} - -void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { - llvm::Value *CastAddr = Builder.CreateBitCast(Addr, Int8PtrTy); - Builder.CreateCall2(CGM.getLLVMLifetimeEndFn(), Size, CastAddr) - ->setDoesNotThrow(); -} - /// EmitAutoVarAlloca - Emit the alloca and debug information for a /// local variable. Does not emit initialization or destruction. CodeGenFunction::AutoVarEmission @@ -959,8 +954,13 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { // Emit a lifetime intrinsic if meaningful. There's no point // in doing this if we don't have a valid insertion point (?). uint64_t size = CGM.getDataLayout().getTypeAllocSize(LTy); - if (HaveInsertPoint()) { - emission.SizeForLifetimeMarkers = EmitLifetimeStart(size, Alloc); + if (HaveInsertPoint() && shouldUseLifetimeMarkers(*this, D, size)) { + llvm::Value *sizeV = llvm::ConstantInt::get(Int64Ty, size); + + emission.SizeForLifetimeMarkers = sizeV; + llvm::Value *castAddr = Builder.CreateBitCast(Alloc, Int8PtrTy); + Builder.CreateCall2(CGM.getLLVMLifetimeStartFn(), sizeV, castAddr) + ->setDoesNotThrow(); } else { assert(!emission.useLifetimeMarkers()); } diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 198cf50..4575e31 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -1743,9 +1743,6 @@ public: void EmitCXXTemporary(const CXXTemporary *Temporary, QualType TempType, llvm::Value *Ptr); - llvm::Value *EmitLifetimeStart(uint64_t Size, llvm::Value *Addr); - void EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr); - llvm::Value *EmitCXXNewExpr(const CXXNewExpr *E); void EmitCXXDeleteExpr(const CXXDeleteExpr *E); diff --git a/clang/test/CodeGenCXX/destructors.cpp b/clang/test/CodeGenCXX/destructors.cpp index 6f5133d..bc9a683 100644 --- a/clang/test/CodeGenCXX/destructors.cpp +++ b/clang/test/CodeGenCXX/destructors.cpp @@ -280,8 +280,6 @@ namespace test5 { // CHECK5: [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align // CHECK5-NEXT: [[EXN:%.*]] = alloca i8* // CHECK5-NEXT: [[SEL:%.*]] = alloca i32 - // CHECK5-NEXT: [[PELEMS:%.*]] = bitcast [5 x [[A]]]* [[ELEMS]] to i8* - // CHECK5-NEXT: call void @llvm.lifetime.start(i64 5, i8* [[PELEMS]]) // CHECK5-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x [[A]]]* [[ELEMS]], i32 0, i32 0 // CHECK5-NEXT: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 5 // CHECK5-NEXT: br label @@ -290,8 +288,7 @@ namespace test5 { // CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]]) // CHECK5: [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]] // CHECK5-NEXT: br i1 [[T0]], - // CHECK5: call void @llvm.lifetime.end - // CHECK5-NEXT: ret void + // CHECK5: ret void // lpad // CHECK5: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]] // CHECK5-NEXT: br i1 [[EMPTY]] diff --git a/clang/test/CodeGenCXX/nrvo.cpp b/clang/test/CodeGenCXX/nrvo.cpp index bc184e5..aad287d 100644 --- a/clang/test/CodeGenCXX/nrvo.cpp +++ b/clang/test/CodeGenCXX/nrvo.cpp @@ -54,22 +54,16 @@ X test2(bool B) { return x; // CHECK: call {{.*}} @_ZN1XC1Ev - // CHECK-NEXT: {{.*}} getelementptr inbounds %class.X* %y, i32 0, i32 0 - // CHECK-NEXT: call void @llvm.lifetime.start // CHECK-NEXT: call {{.*}} @_ZN1XC1Ev // CHECK: call {{.*}} @_ZN1XC1ERKS_ // CHECK: call {{.*}} @_ZN1XC1ERKS_ // CHECK: call {{.*}} @_ZN1XD1Ev - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK: call {{.*}} @_ZN1XD1Ev - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK: ret void // The block ordering in the -fexceptions IR is unfortunate. - // CHECK-EH: call void @llvm.lifetime.start - // CHECK-EH-NEXT: call {{.*}} @_ZN1XC1Ev - // CHECK-EH: call void @llvm.lifetime.start + // CHECK-EH: call {{.*}} @_ZN1XC1Ev // CHECK-EH-NEXT: invoke {{.*}} @_ZN1XC1Ev // -> %invoke.cont, %lpad @@ -102,9 +96,7 @@ X test2(bool B) { // -> %invoke.cont11, %lpad // %invoke.cont11: normal cleanup for 'x' - // CHECK-EH: call void @llvm.lifetime.end - // CHECK-EH-NEXT: call {{.*}} @_ZN1XD1Ev - // CHECK-EH-NEXT: call void @llvm.lifetime.end + // CHECK-EH: call {{.*}} @_ZN1XD1Ev // CHECK-EH-NEXT: ret void // %eh.cleanup: EH cleanup for 'x' @@ -176,12 +168,9 @@ X test6() { X a __attribute__((aligned(8))); return a; // CHECK: [[A:%.*]] = alloca [[X:%.*]], align 8 - // CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds %class.X* [[A]], i32 0, i32 0 - // CHECK-NEXT: call void @llvm.lifetime.start(i64 1, i8* [[PTR]]) // CHECK-NEXT: call {{.*}} @_ZN1XC1Ev([[X]]* [[A]]) // CHECK-NEXT: call {{.*}} @_ZN1XC1ERKS_([[X]]* {{%.*}}, [[X]]* dereferenceable({{[0-9]+}}) [[A]]) // CHECK-NEXT: call {{.*}} @_ZN1XD1Ev([[X]]* [[A]]) - // CHECK-NEXT: call void @llvm.lifetime.end(i64 1, i8* [[PTR]]) // CHECK-NEXT: ret void } diff --git a/clang/test/CodeGenObjC/arc-blocks.m b/clang/test/CodeGenObjC/arc-blocks.m index 00d8fcf..4ba3f05 100644 --- a/clang/test/CodeGenObjC/arc-blocks.m +++ b/clang/test/CodeGenObjC/arc-blocks.m @@ -74,8 +74,6 @@ void test3(void (^sink)(id*)) { // CHECK-NEXT: call i8* @objc_retain( // CHECK-NEXT: bitcast i8* // CHECK-NEXT: store void (i8**)* {{%.*}}, void (i8**)** [[SINK]] - // CHECK-NEXT: [[STRONGPTR1:%.*]] = bitcast i8** [[STRONG]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGPTR1]]) // CHECK-NEXT: store i8* null, i8** [[STRONG]] // CHECK-NEXT: load void (i8**)** [[SINK]] @@ -96,8 +94,6 @@ void test3(void (^sink)(id*)) { // CHECK-NEXT: [[T0:%.*]] = load i8** [[STRONG]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[STRONGPTR2:%.*]] = bitcast i8** [[STRONG]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[STRONGPTR2]]) // CHECK-NEXT: load void (i8**)** [[SINK]] // CHECK-NEXT: bitcast @@ -171,8 +167,6 @@ void test5(void) { // CHECK-LABEL: define void @test5() // CHECK: [[VAR:%.*]] = alloca i8* // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], - // CHECK-NEXT: [[VARPTR1:%.*]] = bitcast i8** [[VAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[VARPTR1]]) // CHECK: [[T0:%.*]] = call i8* @test5_source() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[VAR]], @@ -184,8 +178,6 @@ void test5(void) { // CHECK-NEXT: store i8* [[T0]], i8** [[CAPTURE]] // CHECK-NEXT: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to // CHECK: call void @test5_helper - // CHECK-NEXT: [[VARPTR2:%.*]] = bitcast i8** [[VAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[VARPTR2]]) // CHECK-NEXT: ret void } @@ -198,8 +190,6 @@ void test6(void) { // CHECK-LABEL: define void @test6() // CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]], // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], - // CHECK-NEXT: [[VARPTR1:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 48, i8* [[VARPTR1]]) // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2 // 0x02000000 - has copy/dispose helpers weak // CHECK-NEXT: store i32 1107296256, i32* [[T0]] @@ -217,9 +207,7 @@ void test6(void) { // CHECK: [[T0:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) // CHECK-NEXT: call void @objc_destroyWeak(i8** [[SLOT]]) - // CHECK-NEXT: [[VARPTR2:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 48, i8* [[VARPTR2]]) - // CHECK-NEXT: ret void + // CHECK: ret void // CHECK-LABEL: define internal void @__Block_byref_object_copy_ // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 @@ -506,8 +494,6 @@ void test13(id x) { // CHECK-NEXT: [[CLEANUP_ACTIVE:%.*]] = alloca i1 // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* {{%.*}}) // CHECK-NEXT: store i8* [[T0]], i8** [[X]], align 8 - // CHECK-NEXT: [[BPTR1:%.*]] = bitcast void ()** [[B]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[BPTR1]]) // CHECK-NEXT: [[CLEANUP_ADDR:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]], align 8 // CHECK-NEXT: [[T1:%.*]] = icmp ne i8* [[T0]], null @@ -533,8 +519,6 @@ void test13(id x) { // CHECK-NEXT: [[T0:%.*]] = load void ()** [[B]] // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) - // CHECK-NEXT: [[BPTR2:%.*]] = bitcast void ()** [[B]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[BPTR2]]) // CHECK-NEXT: [[T0:%.*]] = load i1* [[CLEANUP_ACTIVE]] // CHECK-NEXT: br i1 [[T0]] @@ -566,8 +550,6 @@ void test16() { // CHECK-LABEL: define void @test16( // CHECK: [[BLKVAR:%.*]] = alloca void ()*, align 8 // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], - // CHECK-NEXT: [[BLKVARPTR1:%.*]] = bitcast void ()** [[BLKVAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[BLKVARPTR1]]) // CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 // CHECK-NEXT: store void ()* null, void ()** [[BLKVAR]], align 8 } diff --git a/clang/test/CodeGenObjC/arc-bridged-cast.m b/clang/test/CodeGenObjC/arc-bridged-cast.m index f489853..cdfe1db 100644 --- a/clang/test/CodeGenObjC/arc-bridged-cast.m +++ b/clang/test/CodeGenObjC/arc-bridged-cast.m @@ -31,8 +31,6 @@ void bridge_transfer_from_cf(int *i) { // CHECK: store i32 17 *i = 17; // CHECK: call void @objc_release - // CHECK-NEXT: bitcast - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -52,8 +50,6 @@ void bridge_from_cf(int *i) { // CHECK: store i32 17 *i = 17; // CHECK: call void @objc_release - // CHECK-NEXT: bitcast - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -71,8 +67,6 @@ void bridge_retained_of_cf(int *i) { // CHECK: store i32 13 // CHECK: store i32 17 *i = 17; - // CHECK-NEXT: bitcast - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -80,8 +74,7 @@ void bridge_retained_of_cf(int *i) { void bridge_of_cf(int *i) { // CHECK: store i32 7 *i = 7; - // CHECK: call void @llvm.lifetime.start - // CHECK-NEXT: call i8* @CreateSomething() + // CHECK: call i8* @CreateSomething() CFTypeRef cf1 = (__bridge CFTypeRef)CreateSomething(); // CHECK-NOT: retain // CHECK: store i32 11 @@ -92,8 +85,6 @@ void bridge_of_cf(int *i) { // CHECK-NOT: release // CHECK: store i32 17 *i = 17; - // CHECK-NEXT: bitcast - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } diff --git a/clang/test/CodeGenObjC/arc-literals.m b/clang/test/CodeGenObjC/arc-literals.m index 151c3e4..abeb49f 100644 --- a/clang/test/CodeGenObjC/arc-literals.m +++ b/clang/test/CodeGenObjC/arc-literals.m @@ -27,13 +27,9 @@ void test_numeric() { // CHECK: call i8* @objc_retainAutoreleasedReturnValue id charlit = @'a'; // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK-NEXT: ret void } diff --git a/clang/test/CodeGenObjC/arc-precise-lifetime.m b/clang/test/CodeGenObjC/arc-precise-lifetime.m index e6701d1..ddbd704 100644 --- a/clang/test/CodeGenObjC/arc-precise-lifetime.m +++ b/clang/test/CodeGenObjC/arc-precise-lifetime.m @@ -7,8 +7,6 @@ void test0() { PRECISE_LIFETIME id x = test0_helper(); x = 0; // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[CALL:%.*]] = call i8* @test0_helper() // CHECK-NEXT: store i8* [[CALL]], i8** [[X]] @@ -21,8 +19,6 @@ void test0() { // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW:#[0-9]+]] // CHECK-NOT: clang.imprecise_release - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -36,17 +32,11 @@ extern Test1 *test1_helper(void); // CHECK-LABEL: define void @test1a() void test1a(void) { - // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 - // CHECK: [[C:%.*]] = alloca i8*, align 8 - // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[CPTR1:%.*]] = bitcast i8** [[C]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CPTR1]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) @@ -55,13 +45,9 @@ void test1a(void) { // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST1]]* [[T3]] to i8* // CHECK-NEXT: [[T6:%.*]] = call i8* bitcast // CHECK-NEXT: store i8* [[T6]], i8** - // CHECK-NEXT: [[CPTR2:%.*]] = bitcast i8** [[C]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CPTR2]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void Test1 *ptr = test1_helper(); char *c = [(ptr) interior]; @@ -69,47 +55,31 @@ void test1a(void) { // CHECK-LABEL: define void @test1b() void test1b(void) { - // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 - // CHECK: [[C:%.*]] = alloca i8*, align 8 - // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[CPTR1:%.*]] = bitcast i8** [[C]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CPTR1]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast // CHECK-NEXT: store i8* [[T3]], i8** - // CHECK-NEXT: [[CPTR2:%.*]] = bitcast i8** [[C]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CPTR2]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]] // CHECK-NOT: clang.imprecise_release - // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void __attribute__((objc_precise_lifetime)) Test1 *ptr = test1_helper(); char *c = [ptr interior]; } void test1c(void) { - // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 - // CHECK: [[PC:%.*]] = alloca i8*, align 8 - // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[PCPTR1:%.*]] = bitcast i8** [[PC]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[PCPTR1]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) @@ -118,30 +88,20 @@ void test1c(void) { // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST1]]* [[T3]] to i8* // CHECK-NEXT: [[T6:%.*]] = call i8* bitcast // CHECK-NEXT: store i8* [[T6]], i8** - // CHECK-NEXT: [[PCPTR2:%.*]] = bitcast i8** [[PC]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PCPTR2]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void Test1 *ptr = test1_helper(); char *pc = ptr.PropertyReturnsInnerPointer; } void test1d(void) { - // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 - // CHECK: [[PC:%.*]] = alloca i8*, align 8 - // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[PCPTR1:%.*]] = bitcast i8** [[PC]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[PCPTR1]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retainAutorelease @@ -150,13 +110,9 @@ void test1d(void) { // CHECK-NEXT: [[EIGHT:%.*]] = bitcast [[TEST1]]* [[SIX]] to i8* // CHECK-NEXT: [[CALL1:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[EIGHT]], i8* [[SEVEN]]) // CHECK-NEXT: store i8* [[CALL1]], i8** - // CHECK-NEXT: [[PCPTR2:%.*]] = bitcast i8** [[PC]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PCPTR2]]) // CHECK-NEXT: [[NINE:%.*]] = load [[TEST1]]** // CHECK-NEXT: [[TEN:%.*]] = bitcast [[TEST1]]* [[NINE]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[TEN]]) - // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void __attribute__((objc_precise_lifetime)) Test1 *ptr = test1_helper(); char *pc = ptr.PropertyReturnsInnerPointer; diff --git a/clang/test/CodeGenObjC/arc-ternary-op.m b/clang/test/CodeGenObjC/arc-ternary-op.m index 52627d7..217db80 100644 --- a/clang/test/CodeGenObjC/arc-ternary-op.m +++ b/clang/test/CodeGenObjC/arc-ternary-op.m @@ -10,8 +10,6 @@ void test0(_Bool cond) { // CHECK-NEXT: [[RELCOND:%.*]] = alloca i1 // CHECK-NEXT: zext // CHECK-NEXT: store - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = load i8* [[COND]] // CHECK-NEXT: [[T1:%.*]] = trunc i8 [[T0]] to i1 // CHECK-NEXT: store i1 false, i1* [[RELCOND]] @@ -31,8 +29,6 @@ void test0(_Bool cond) { // CHECK-NEXT: br label // CHECK: [[T0:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x = (cond ? 0 : test0_helper()); } @@ -53,11 +49,7 @@ void test1(int cond) { // CHECK-NEXT: [[CONDCLEANUPSAVE:%.*]] = alloca i8* // CHECK-NEXT: [[CONDCLEANUP:%.*]] = alloca i1 // CHECK-NEXT: store i32 - // CHECK-NEXT: [[STRONGPTR1:%.*]] = bitcast i8** [[STRONG]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGPTR1]]) // CHECK-NEXT: store i8* null, i8** [[STRONG]] - // CHECK-NEXT: [[WEAKPTR1:%.*]] = bitcast i8** [[WEAK]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[WEAKPTR1]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[WEAK]], i8* null) // CHECK-NEXT: [[T0:%.*]] = load i32* [[COND]] @@ -101,10 +93,6 @@ void test1(int cond) { // CHECK-NEXT: br label // CHECK: call void @objc_destroyWeak(i8** [[WEAK]]) - // CHECK: [[WEAKPTR2:%.*]] = bitcast i8** [[WEAK]] to i8* - // CHECK: call void @llvm.lifetime.end(i64 8, i8* [[WEAKPTR2]]) - // CHECK: [[STRONGPTR2:%.*]] = bitcast i8** [[STRONG]] to i8* - // CHECK: call void @llvm.lifetime.end(i64 8, i8* [[STRONGPTR2]]) // CHECK: ret void } diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m index 597ce6d..a83fe0f 100644 --- a/clang/test/CodeGenObjC/arc.m +++ b/clang/test/CodeGenObjC/arc.m @@ -49,16 +49,12 @@ id test1(id x) { // CHECK-NEXT: alloca i32 // CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}}) // CHECK-NEXT: store i8* [[PARM]], i8** [[X]] - // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: store i8* null, i8** [[Y]] // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] // CHECK-NEXT: [[RET:%.*]] = call i8* @objc_retain(i8* [[T0]]) // CHECK-NEXT: store i32 // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // CHECK-NEXT: [[T1:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[RET]]) @@ -103,8 +99,6 @@ void test3_unelided() { extern void test3_helper(void); // CHECK: [[X:%.*]] = alloca [[TEST3:%.*]]* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast [[TEST3]]** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store [[TEST3]]* null, [[TEST3]]** [[X]], align Test3 *x; @@ -128,16 +122,12 @@ void test3_unelided() { // CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]** [[X]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST3]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]] - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast [[TEST3]]** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } // CHECK-LABEL: define void @test3() void test3() { // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) id x = [[Test3 alloc] initWith: 5]; @@ -172,8 +162,7 @@ void test3() { // Cleanup for x. // CHECK-NEXT: [[TMP:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) [[NUW]] - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) + // CHECK-NEXT: ret void } @@ -255,14 +244,10 @@ id test6_helper(void) __attribute__((ns_returns_retained)); // CHECK-LABEL: define void @test6() void test6() { // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[CALL:%.*]] = call i8* @test6_helper() // CHECK-NEXT: store i8* [[CALL]], i8** [[X]] // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x = test6_helper(); } @@ -271,16 +256,12 @@ void test7_helper(id __attribute__((ns_consumed))); // CHECK-LABEL: define void @test7() void test7() { // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) [[NUW]] // CHECK-NEXT: call void @test7_helper(i8* [[T1]]) // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x; test7_helper(x); @@ -290,13 +271,9 @@ id test8_helper(void) __attribute__((ns_returns_retained)); void test8() { __unsafe_unretained id x = test8_helper(); // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test8_helper() // CHECK-NEXT: store i8* [[T0]], i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -310,11 +287,7 @@ void test10() { // CHECK-LABEL: define void @test10() // CHECK: [[X:%.*]] = alloca [[TEST10:%.*]]*, align // CHECK-NEXT: [[Y:%.*]] = alloca i8*, align - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast [[TEST10]]** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store [[TEST10]]* null, [[TEST10]]** [[X]] - // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: load [[TEST10]]** [[X]], align // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_{{[0-9]*}} // CHECK-NEXT: bitcast @@ -334,13 +307,9 @@ void test10() { // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: [[T0:%.*]] = load [[TEST10]]** [[X]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST10]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast [[TEST10]]** [[X]] to i8* - // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -349,15 +318,11 @@ void test11(id (*f)(void) __attribute__((ns_returns_retained))) { // CHECK: [[F:%.*]] = alloca i8* ()*, align // CHECK-NEXT: [[X:%.*]] = alloca i8*, align // CHECK-NEXT: store i8* ()* {{%.*}}, i8* ()** [[F]], align - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = load i8* ()** [[F]], align // CHECK-NEXT: [[T1:%.*]] = call i8* [[T0]]() // CHECK-NEXT: store i8* [[T1]], i8** [[X]], align // CHECK-NEXT: [[T3:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T3]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x = f(); } @@ -370,8 +335,6 @@ void test12(void) { // CHECK-NEXT: [[Y:%.*]] = alloca i8*, align __weak id x = test12_helper(); - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test12_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[X]], i8* [[T1]]) @@ -384,18 +347,12 @@ void test12(void) { // CHECK-NEXT: call void @objc_release(i8* [[T1]]) id y = x; - // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_loadWeakRetained(i8** [[X]]) // CHECK-NEXT: store i8* [[T2]], i8** [[Y]], align // CHECK-NEXT: [[T4:%.*]] = load i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T4]]) [[NUW]], !clang.imprecise_release - // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: call void @objc_destroyWeak(i8** [[X]]) - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK: ret void } @@ -403,8 +360,6 @@ void test12(void) { void test13(void) { // CHECK-LABEL: define void @test13() // CHECK: [[X:%.*]] = alloca i8*, align - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]], align id x; @@ -430,8 +385,6 @@ void test13(void) { // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -910,8 +863,6 @@ void test33(Test33 *ptr) { // CHECK-NEXT: objc_retain // CHECK-NEXT: bitcast // CHECK-NEXT: store - // CHECK-NEXT: bitcast - // CHECK-NEXT: call void @llvm.lifetime.start // CHECK-NEXT: store [[A_T]]* null, [[A_T]]** [[A]] // CHECK-NEXT: load [[TEST33]]** [[PTR]] @@ -974,8 +925,6 @@ void test33(Test33 *ptr) { // CHECK-NEXT: load // CHECK-NEXT: bitcast // CHECK-NEXT: objc_release - // CHECK-NEXT: bitcast - // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: load // CHECK-NEXT: bitcast // CHECK-NEXT: objc_release @@ -1014,8 +963,6 @@ void test37(void) { // CHECK-LABEL: define void @test37() // CHECK: [[VAR:%.*]] = alloca [[TEST37:%.*]]*, // CHECK-NEXT: [[TEMP:%.*]] = alloca i8* - // CHECK-NEXT: [[VARPTR1:%.*]] = bitcast [[TEST37]]** [[VAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[VARPTR1]]) // CHECK-NEXT: store [[TEST37]]* null, [[TEST37]]** [[VAR]] // CHECK-NEXT: [[W0:%.*]] = load [[TEST37]]** [[VAR]] @@ -1036,8 +983,6 @@ void test37(void) { // CHECK-NEXT: [[T0:%.*]] = load [[TEST37]]** [[VAR]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST37]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) - // CHECK-NEXT: [[VARPTR2:%.*]] = bitcast [[TEST37]]** [[VAR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[VARPTR2]]) // CHECK-NEXT: ret void } @@ -1094,8 +1039,6 @@ void test47(void) { // CHECK-LABEL: define void @test47() // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: [[CALL:%.*]] = call i8* @test47_helper() // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[CALL]]) @@ -1108,8 +1051,6 @@ void test47(void) { // CHECK-NEXT: call void @objc_release(i8* [[T3]]) // CHECK-NEXT: [[T4:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T4]]) - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1118,8 +1059,6 @@ void test48(void) { __weak id x = x = test48_helper(); // CHECK-LABEL: define void @test48() // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_initWeak(i8** [[X]], i8* null) // CHECK-NEXT: [[T1:%.*]] = call i8* @test48_helper() // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) @@ -1127,8 +1066,6 @@ void test48(void) { // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_storeWeak(i8** [[X]], i8* [[T3]]) // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK-NEXT: call void @objc_destroyWeak(i8** [[X]]) - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1137,8 +1074,6 @@ void test49(void) { __autoreleasing id x = x = test49_helper(); // CHECK-LABEL: define void @test49() // CHECK: [[X:%.*]] = alloca i8* - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: [[CALL:%.*]] = call i8* @test49_helper() // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[CALL]]) @@ -1146,8 +1081,6 @@ void test49(void) { // CHECK-NEXT: store i8* [[T2]], i8** [[X]] // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) // CHECK-NEXT: store i8* [[T3]], i8** [[X]] - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1183,14 +1116,10 @@ id test52(void) { // CHECK-LABEL: define i8* @test52() // CHECK: [[X:%.*]] = alloca i32 // CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8* -// CHECK-NEXT: [[XPTR1:%.*]] = bitcast i32* [[X]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* [[XPTR1]]) // CHECK-NEXT: store i32 5, i32* [[X]], // CHECK-NEXT: [[T0:%.*]] = load i32* [[X]], // CHECK-NEXT: [[T1:%.*]] = call i8* @test52_helper(i32 [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]] -// CHECK-NEXT: [[XPTR2:%.*]] = bitcast i32* [[X]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[XPTR2]]) // CHECK-NEXT: [[T2:%.*]] = load i8** [[TMPALLOCA]] // CHECK-NEXT: [[T3:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T2]]) // CHECK-NEXT: ret i8* [[T3]] @@ -1205,10 +1134,6 @@ void test53(void) { // CHECK: [[X:%.*]] = alloca i8*, // CHECK-NEXT: [[Y:%.*]] = alloca i8*, // CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8*, -// CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) -// CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test53_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[Y]], @@ -1217,15 +1142,11 @@ void test53(void) { // CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]] // CHECK-NEXT: [[T2:%.*]] = load i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) -// CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: [[T3:%.*]] = load i8** [[TMPALLOCA]] // CHECK-NEXT: store i8* [[T3]], i8** [[X]], // CHECK-NEXT: load i8** [[X]], // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) -// CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1272,14 +1193,10 @@ void test56_test(void) { id x = [Test56 make]; // CHECK-LABEL: define void @test56_test() // CHECK: [[X:%.*]] = alloca i8*, align 8 - // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK: [[T0:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)( // CHECK-NEXT: store i8* [[T0]], i8** [[X]] // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1359,8 +1276,6 @@ void test61(void) { // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [test61_make() performSelector: @selector(test61_void)]; - // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test61_make() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: [[T2:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ @@ -1373,8 +1288,6 @@ void test61(void) { // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: ret void } @@ -1382,14 +1295,11 @@ void test61(void) { void test62(void) { // CHECK-LABEL: define void @test62() // CHECK: [[I:%.*]] = alloca i32, align 4 - // CHECK-NEXT: [[CLEANUP_DEST_SLOT:%.*]] = alloca i32 // CHECK-NEXT: [[CLEANUP_VALUE:%.*]] = alloca i8* // CHECK-NEXT: [[CLEANUP_REQUIRED:%.*]] = alloca i1 extern id test62_make(void); extern void test62_body(void); - // CHECK-NEXT: [[IPTR:%.*]] = bitcast i32* [[I]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* [[IPTR]]) // CHECK-NEXT: store i32 0, i32* [[I]], align 4 // CHECK-NEXT: br label @@ -1481,12 +1391,8 @@ void test67(void) { } // CHECK-LABEL: define void @test67() // CHECK: [[CL:%.*]] = alloca i8*, align 8 -// CHECK-NEXT: [[CLPTR1:%.*]] = bitcast i8** [[CL]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CLPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper() // CHECK-NEXT: store i8* [[T0]], i8** [[CL]], align 8 -// CHECK-NEXT: [[CLPTR2:%.*]] = bitcast i8** [[CL]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CLPTR2]]) // CHECK-NEXT: ret void Class test68_helper(void); @@ -1495,15 +1401,11 @@ void test68(void) { } // CHECK-LABEL: define void @test68() // CHECK: [[CL:%.*]] = alloca i8*, align 8 -// CHECK-NEXT: [[CLPTR1:%.*]] = bitcast i8** [[CL]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CLPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[CL]], align 8 // CHECK-NEXT: [[T2:%.*]] = load i8** [[CL]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) -// CHECK-NEXT: [[CLPTR2:%.*]] = bitcast i8** [[CL]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CLPTR2]]) // CHECK-NEXT: ret void // rdar://problem/10564852 diff --git a/clang/test/CodeGenObjC/exceptions.m b/clang/test/CodeGenObjC/exceptions.m index 8e3a6ef..92f6829 100644 --- a/clang/test/CodeGenObjC/exceptions.m +++ b/clang/test/CodeGenObjC/exceptions.m @@ -82,8 +82,6 @@ void f3() { extern void f3_helper(int, int*); // CHECK: [[X:%.*]] = alloca i32 - // CHECK: [[XPTR:%.*]] = bitcast i32* [[X]] to i8* - // CHECK: call void @llvm.lifetime.start(i64 4, i8* [[XPTR]]) // CHECK: store i32 0, i32* [[X]] int x = 0; @@ -124,7 +122,6 @@ void f3() { } // CHECK: call void @f3_helper(i32 4, i32* [[X]]) - // CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[XPTR]]) // CHECK-NEXT: ret void f3_helper(4, &x); } diff --git a/clang/test/CodeGenObjCXX/arc-move.mm b/clang/test/CodeGenObjCXX/arc-move.mm index e9709c8..d7b9f55 100644 --- a/clang/test/CodeGenObjCXX/arc-move.mm +++ b/clang/test/CodeGenObjCXX/arc-move.mm @@ -46,10 +46,6 @@ void library_move(__strong id &x, __strong id &y) { // CHECK-LABEL: define void @_Z12library_moveRU8__strongP11objc_object void library_move(__strong id &y) { - // CHECK: [[X:%.*]] = alloca i8*, align 8 - // CHECK: [[I:%.*]] = alloca i32, align 4 - // CHECK: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK: [[Y:%[a-zA-Z0-9]+]] = call dereferenceable({{[0-9]+}}) i8** @_Z4moveIRU8__strongP11objc_objectEON16remove_referenceIT_E4typeEOS5_ // Load the object // CHECK-NEXT: [[OBJ:%[a-zA-Z0-9]+]] = load i8** [[Y]] @@ -59,16 +55,10 @@ void library_move(__strong id &y) { // CHECK-NEXT: store i8* [[OBJ]], i8** [[X:%[a-zA-Z0-9]+]] id x = move(y); - // CHECK-NEXT: [[IPTR1:%.*]] = bitcast i32* [[I]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* [[IPTR1]]) // CHECK-NEXT: store i32 17 int i = 17; - // CHECK-NEXT: [[IPTR2:%.*]] = bitcast i32* [[I]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[IPTR2]]) // CHECK-NEXT: [[OBJ:%[a-zA-Z0-9]+]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[OBJ]]) - // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } diff --git a/clang/test/CodeGenObjCXX/arc-references.mm b/clang/test/CodeGenObjCXX/arc-references.mm index db601d2..0acb6d5 100644 --- a/clang/test/CodeGenObjCXX/arc-references.mm +++ b/clang/test/CodeGenObjCXX/arc-references.mm @@ -38,14 +38,11 @@ typedef __strong id strong_id; //CHECK: define void @_Z5test3v void test3() { - // CHECK: [[REF:%.*]] = alloca i8**, align 8 // CHECK: call i8* @objc_initWeak // CHECK-NEXT: store i8** const __weak id &ref = strong_id(); // CHECK-NEXT: call void @_Z6calleev() callee(); - // CHECK-NEXT: [[PTR:%.*]] = bitcast i8*** [[REF]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTR]]) // CHECK-NEXT: call void @objc_destroyWeak // CHECK-NEXT: ret void } @@ -65,7 +62,6 @@ void sink(__strong A* &&); // CHECK-LABEL: define void @_Z5test5RU8__strongP11objc_object void test5(__strong id &x) { // CHECK: [[REFTMP:%.*]] = alloca {{%.*}}*, align 8 - // CHECK: [[I:%.*]] = alloca i32, align 4 // CHECK: [[OBJ_ID:%.*]] = call i8* @objc_retain( // CHECK-NEXT: [[OBJ_A:%.*]] = bitcast i8* [[OBJ_ID]] to [[A:%[a-zA-Z0-9]+]]* // CHECK-NEXT: store [[A]]* [[OBJ_A]], [[A]]** [[REFTMP:%[a-zA-Z0-9]+]] @@ -74,12 +70,8 @@ void test5(__strong id &x) { // CHECK-NEXT: [[OBJ_A:%[a-zA-Z0-9]+]] = load [[A]]** [[REFTMP]] // CHECK-NEXT: [[OBJ_ID:%[a-zA-Z0-9]+]] = bitcast [[A]]* [[OBJ_A]] to i8* // CHECK-NEXT: call void @objc_release - // CHECK-NEXT: [[IPTR1:%.*]] = bitcast i32* [[I]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* [[IPTR1]]) // CHECK-NEXT: store i32 17, i32 int i = 17; - // CHECK-NEXT: [[IPTR2:%.*]] = bitcast i32* [[I]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[IPTR2]]) // CHECK-NEXT: ret void } diff --git a/clang/test/CodeGenObjCXX/arc.mm b/clang/test/CodeGenObjCXX/arc.mm index f115763..6b42a4c 100644 --- a/clang/test/CodeGenObjCXX/arc.mm +++ b/clang/test/CodeGenObjCXX/arc.mm @@ -64,11 +64,7 @@ void test34(int cond) { // CHECK-NEXT: [[CONDCLEANUPSAVE:%.*]] = alloca i8* // CHECK-NEXT: [[CONDCLEANUP:%.*]] = alloca i1 // CHECK-NEXT: store i32 - // CHECK-NEXT: [[STRONGP:%.*]] = bitcast i8** [[STRONG]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGP]]) // CHECK-NEXT: store i8* null, i8** [[STRONG]] - // CHECK-NEXT: [[WEAKP:%.*]] = bitcast i8** [[WEAK]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[WEAKP]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[WEAK]], i8* null) // CHECK-NEXT: [[T0:%.*]] = load i32* [[COND]] @@ -124,77 +120,56 @@ struct Test35_Helper { // CHECK-LABEL: define void @_Z6test3513Test35_HelperPS_ void test35(Test35_Helper x0, Test35_Helper *x0p) { - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject1Ev // CHECK-NOT: call i8* @objc_retain id obj1 = Test35_Helper::makeObject1(); - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject2Ev // CHECK-NOT: call i8* @objc_retain id obj2 = x0.makeObject2(); - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject2Ev // CHECK-NOT: call i8* @objc_retain id obj3 = x0p->makeObject2(); id (Test35_Helper::*pmf)() __attribute__((ns_returns_retained)) = &Test35_Helper::makeObject2; - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK-NOT: call i8* @objc_retain id obj4 = (x0.*pmf)(); - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK-NOT: call i8* @objc_retain id obj5 = (x0p->*pmf)(); // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK-NEXT: ret void } // CHECK-LABEL: define void @_Z7test35b13Test35_HelperPS_ void test35b(Test35_Helper x0, Test35_Helper *x0p) { - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject3Ev // CHECK: call i8* @objc_retain id obj1 = Test35_Helper::makeObject3(); - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject4Ev // CHECK: call i8* @objc_retain id obj2 = x0.makeObject4(); - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject4Ev // CHECK: call i8* @objc_retain id obj3 = x0p->makeObject4(); id (Test35_Helper::*pmf)() = &Test35_Helper::makeObject4; - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK: call i8* @objc_retain id obj4 = (x0.*pmf)(); - // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK: call i8* @objc_retain id obj5 = (x0p->*pmf)(); // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release - // CHECK: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -315,8 +290,6 @@ template void test40_helper(); // CHECK-LABEL: define weak_odr void @_Z13test40_helperIiEvv() // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[TEMP:%.*]] = alloca i8* -// CHECK-NEXT: [[XP:%.*]] = bitcast i8** [[X]] to i8* -// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XP]]) // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK: [[T0:%.*]] = load i8** [[X]] // CHECK-NEXT: store i8* [[T0]], i8** [[TEMP]] diff --git a/clang/test/CodeGenObjCXX/literals.mm b/clang/test/CodeGenObjCXX/literals.mm index 32abcc4..f21bba7 100644 --- a/clang/test/CodeGenObjCXX/literals.mm +++ b/clang/test/CodeGenObjCXX/literals.mm @@ -16,13 +16,10 @@ struct Y { // CHECK-LABEL: define void @_Z10test_arrayv void test_array() { - // CHECK: [[ARR:%[a-zA-Z0-9.]+]] = alloca i8* // CHECK: [[OBJECTS:%[a-zA-Z0-9.]+]] = alloca [2 x i8*] // Initializing first element - // CHECK: [[PTR1:%.*]] = bitcast i8** [[ARR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[PTR1]]) - // CHECK-NEXT: [[ELEMENT0:%[a-zA-Z0-9.]+]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 0 + // CHECK: [[ELEMENT0:%[a-zA-Z0-9.]+]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 0 // CHECK-NEXT: call void @_ZN1XC1Ev // CHECK-NEXT: [[OBJECT0:%[a-zA-Z0-9.]+]] = invoke i8* @_ZNK1XcvP11objc_objectEv // CHECK: [[RET0:%[a-zA-Z0-9.]+]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[OBJECT0]]) @@ -50,8 +47,6 @@ void test_array() { // CHECK-NEXT: call void @_ZN1XD1Ev // CHECK-NOT: ret void // CHECK: call void @objc_release - // CHECK-NEXT: [[PTR2:%.*]] = bitcast i8** [[ARR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTR2]]) // CHECK-NEXT: ret void // Check cleanups @@ -68,13 +63,10 @@ void test_array() { // CHECK-LABEL: define weak_odr void @_Z24test_array_instantiationIiEvv template void test_array_instantiation() { - // CHECK: [[ARR:%[a-zA-Z0-9.]+]] = alloca i8* // CHECK: [[OBJECTS:%[a-zA-Z0-9.]+]] = alloca [2 x i8*] // Initializing first element - // CHECK: [[PTR1:%.*]] = bitcast i8** [[ARR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[PTR1]]) - // CHECK-NEXT: [[ELEMENT0:%[a-zA-Z0-9.]+]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 0 + // CHECK: [[ELEMENT0:%[a-zA-Z0-9.]+]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 0 // CHECK-NEXT: call void @_ZN1XC1Ev // CHECK-NEXT: [[OBJECT0:%[a-zA-Z0-9.]+]] = invoke i8* @_ZNK1XcvP11objc_objectEv // CHECK: [[RET0:%[a-zA-Z0-9.]+]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[OBJECT0]]) @@ -102,8 +94,6 @@ void test_array_instantiation() { // CHECK-NEXT: call void @_ZN1XD1Ev // CHECK-NOT: ret void // CHECK: call void @objc_release - // CHECK-NEXT: [[PTR2]] = bitcast i8** [[ARR]] to i8* - // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTR2]]) // CHECK-NEXT: ret void // Check cleanups -- 2.7.4