r219303 - Remove threshold on object size for inserting lifetime begin / end

Arnaud A. de Grandmaison arnaud.degrandmaison at arm.com
Wed Oct 8 05:49:16 PDT 2014


Author: aadg
Date: Wed Oct  8 07:49:16 2014
New Revision: 219303

URL: http://llvm.org/viewvc/llvm-project?rev=219303&view=rev
Log:
Remove threshold on object size for inserting lifetime begin / end

Boostrapping LLVM+Clang+LLDB without threshold on object size for
lifetime markers insertion has shown there was no significant change
in compile time, so let the stack slot colorizer do its optimization
for all slots.

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/test/CodeGenCXX/destructors.cpp
    cfe/trunk/test/CodeGenCXX/nrvo.cpp
    cfe/trunk/test/CodeGenCXX/unnamed-object-lifetime.cpp
    cfe/trunk/test/CodeGenObjC/arc-blocks.m
    cfe/trunk/test/CodeGenObjC/arc-bridged-cast.m
    cfe/trunk/test/CodeGenObjC/arc-literals.m
    cfe/trunk/test/CodeGenObjC/arc-precise-lifetime.m
    cfe/trunk/test/CodeGenObjC/arc-ternary-op.m
    cfe/trunk/test/CodeGenObjC/arc.m
    cfe/trunk/test/CodeGenObjC/exceptions.m
    cfe/trunk/test/CodeGenObjCXX/arc-move.mm
    cfe/trunk/test/CodeGenObjCXX/arc-references.mm
    cfe/trunk/test/CodeGenObjCXX/arc.mm
    cfe/trunk/test/CodeGenObjCXX/literals.mm

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Wed Oct  8 07:49:16 2014
@@ -825,19 +825,6 @@ static bool shouldUseMemSetPlusStoresToI
          canEmitInitWithFewStoresAfterMemset(Init, StoreBudget);
 }
 
-/// Should we use the LLVM lifetime intrinsics for the given local variable?
-static bool shouldUseLifetimeMarkers(CodeGenFunction &CGF, uint64_t 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.
@@ -852,7 +839,12 @@ void CodeGenFunction::EmitAutoVarDecl(co
 /// otherwise
 llvm::Value *CodeGenFunction::EmitLifetimeStart(uint64_t Size,
                                                 llvm::Value *Addr) {
-  if (!shouldUseLifetimeMarkers(*this, Size))
+  // For now, only use the markers in optimized builds
+  if (CGM.getCodeGenOpts().OptimizationLevel == 0)
+    return nullptr;
+
+  // Zero-sized objects do not need lifetime markers
+  if (Size == 0)
     return nullptr;
 
   llvm::Value *SizeV = llvm::ConstantInt::get(Int64Ty, Size);
@@ -963,11 +955,10 @@ CodeGenFunction::EmitAutoVarAlloca(const
       // 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() && EmitLifetimeStart(size, Alloc)) {
-        emission.SizeForLifetimeMarkers = llvm::ConstantInt::get(Int64Ty, size);
-      } else {
+      if (HaveInsertPoint())
+        emission.SizeForLifetimeMarkers = EmitLifetimeStart(size, Alloc);
+      else
         assert(!emission.useLifetimeMarkers());
-      }
     }
   } else {
     EnsureInsertPoint();

Modified: cfe/trunk/test/CodeGenCXX/destructors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/destructors.cpp?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/destructors.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/destructors.cpp Wed Oct  8 07:49:16 2014
@@ -280,6 +280,8 @@ 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
@@ -288,7 +290,8 @@ namespace test5 {
   // CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
   // CHECK5:      [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
   // CHECK5-NEXT: br i1 [[T0]],
-  // CHECK5:      ret void
+  // CHECK5:      call void @llvm.lifetime.end
+  // CHECK5-NEXT: ret void
   // lpad
   // CHECK5:      [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
   // CHECK5-NEXT: br i1 [[EMPTY]]
@@ -405,7 +408,9 @@ namespace test9 {
     f1<int>();
     f2();
   }
-  // CHECK5: call void @_ZN5test97ArgTypeD1Ev(%"struct.test9::ArgType"* %
+
+  // CHECK5-LABEL: define void @_ZN5test93barEv(
+  // CHECK5: invoke void @_ZN5test97ArgTypeD1Ev(%"struct.test9::ArgType"* %
   // CHECK5: call void @_ZN5test92f2Ev()
 }
 

Modified: cfe/trunk/test/CodeGenCXX/nrvo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/nrvo.cpp?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/nrvo.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/nrvo.cpp Wed Oct  8 07:49:16 2014
@@ -54,16 +54,22 @@ 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 {{.*}} @_ZN1XC1Ev
+  // CHECK-EH:      call void @llvm.lifetime.start
+  // CHECK-EH-NEXT: call {{.*}} @_ZN1XC1Ev
+  // CHECK-EH:      call void @llvm.lifetime.start
   // CHECK-EH-NEXT: invoke {{.*}} @_ZN1XC1Ev
   // -> %invoke.cont, %lpad
 
@@ -96,7 +102,9 @@ X test2(bool B) {
   // -> %invoke.cont11, %lpad
 
   // %invoke.cont11: normal cleanup for 'x'
-  // CHECK-EH:      call {{.*}} @_ZN1XD1Ev
+  // CHECK-EH:      call void @llvm.lifetime.end
+  // CHECK-EH-NEXT: call {{.*}} @_ZN1XD1Ev
+  // CHECK-EH-NEXT: call void @llvm.lifetime.end
   // CHECK-EH-NEXT: ret void
 
   // %eh.cleanup:  EH cleanup for 'x'
@@ -168,9 +176,12 @@ 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
 }
 

Modified: cfe/trunk/test/CodeGenCXX/unnamed-object-lifetime.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/unnamed-object-lifetime.cpp?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/unnamed-object-lifetime.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/unnamed-object-lifetime.cpp Wed Oct  8 07:49:16 2014
@@ -6,7 +6,7 @@
 struct X {
   X();
   ~X();
-  char t[33]; // make the class big enough so that lifetime markers get inserted
+  char t[33];
 };
 
 extern void useX(const X &);
@@ -118,18 +118,18 @@ struct Z {
 
 extern void useZ(const Z &);
 
-// Check lifetime markers are not inserted if the unnamed object is too small
-// CHECK-LABEL: define void @_Z8tooSmallv
-// CHECK-EH-LABEL: define void @_Z8tooSmallv
-void tooSmall() {
-  // CHECK-NOT: call void @llvm.lifetime.start
+// Check lifetime markers are inserted even if the unnamed object is small
+// CHECK-LABEL: define void @_Z11notTooSmallv
+// CHECK-EH-LABEL: define void @_Z11notTooSmallv
+void notTooSmall() {
+  // CHECK: call void @llvm.lifetime.start
   // CHECK: call void @_Z4useZRK1Z
-  // CHECK-NOT: call void @llvm.lifetime.end
+  // CHECK: call void @llvm.lifetime.end
   // CHECK: ret
   //
-  // CHECK-EH-NOT: call void @llvm.lifetime.start
+  // CHECK-EH: call void @llvm.lifetime.start
   // CHECK-EH: invoke void @_Z4useZRK1Z
-  // CHECK-EH-NOT: call void @llvm.lifetime.end
+  // CHECK-EH: call void @llvm.lifetime.end
   // CHECK-EH: ret
   useZ(Z());
 }

Modified: cfe/trunk/test/CodeGenObjC/arc-blocks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-blocks.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-blocks.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-blocks.m Wed Oct  8 07:49:16 2014
@@ -74,6 +74,8 @@ 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]]
@@ -94,6 +96,8 @@ 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
@@ -167,6 +171,8 @@ 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]],
@@ -178,6 +184,8 @@ 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
 }
 
@@ -190,6 +198,8 @@ 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]]
@@ -207,7 +217,9 @@ 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: ret void
+  // 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-LABEL:    define internal void @__Block_byref_object_copy_
   // CHECK:      [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
@@ -494,6 +506,8 @@ 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
@@ -519,6 +533,8 @@ 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]]
@@ -550,6 +566,8 @@ 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
 }

Modified: cfe/trunk/test/CodeGenObjC/arc-bridged-cast.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-bridged-cast.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-bridged-cast.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-bridged-cast.m Wed Oct  8 07:49:16 2014
@@ -31,6 +31,8 @@ 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
 }
 
@@ -50,6 +52,8 @@ 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
 }
 
@@ -67,6 +71,8 @@ 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
 }
 
@@ -74,7 +80,8 @@ void bridge_retained_of_cf(int *i) {
 void bridge_of_cf(int *i) {
   // CHECK: store i32 7
   *i = 7;
-  // CHECK: call i8* @CreateSomething()
+  // CHECK: call void @llvm.lifetime.start
+  // CHECK-NEXT: call i8* @CreateSomething()
   CFTypeRef cf1 = (__bridge CFTypeRef)CreateSomething();
   // CHECK-NOT: retain
   // CHECK: store i32 11
@@ -85,6 +92,8 @@ 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
 }
 

Modified: cfe/trunk/test/CodeGenObjC/arc-literals.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-literals.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-literals.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-literals.m Wed Oct  8 07:49:16 2014
@@ -27,9 +27,13 @@ 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
 }
 

Modified: cfe/trunk/test/CodeGenObjC/arc-precise-lifetime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-precise-lifetime.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-precise-lifetime.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-precise-lifetime.m Wed Oct  8 07:49:16 2014
@@ -7,6 +7,8 @@ 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]]
 
@@ -19,6 +21,8 @@ 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
 }
 
@@ -32,11 +36,17 @@ 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]])
@@ -45,9 +55,13 @@ 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];
@@ -55,31 +69,47 @@ 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** @"\01L_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]])
@@ -88,20 +118,30 @@ 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
@@ -110,9 +150,13 @@ 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;

Modified: cfe/trunk/test/CodeGenObjC/arc-ternary-op.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-ternary-op.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-ternary-op.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-ternary-op.m Wed Oct  8 07:49:16 2014
@@ -10,6 +10,8 @@ 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]]
@@ -29,6 +31,8 @@ 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());
 }
@@ -49,7 +53,11 @@ 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]]
@@ -93,6 +101,10 @@ 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
 }
 

Modified: cfe/trunk/test/CodeGenObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc.m Wed Oct  8 07:49:16 2014
@@ -49,12 +49,16 @@ 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]])
@@ -99,6 +103,8 @@ 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;
 
@@ -122,12 +128,16 @@ 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];
 
@@ -162,7 +172,8 @@ 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
 }
 
@@ -244,10 +255,14 @@ id test6_helper(void) __attribute__((ns_
 // 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();
 }
@@ -256,12 +271,16 @@ void test7_helper(id __attribute__((ns_c
 // 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);
@@ -271,9 +290,13 @@ id test8_helper(void) __attribute__((ns_
 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
 }
 
@@ -287,7 +310,11 @@ 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** @"\01L_OBJC_SELECTOR_REFERENCES_{{[0-9]*}}"
   // CHECK-NEXT: bitcast
@@ -307,9 +334,13 @@ 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
 }
 
@@ -318,11 +349,15 @@ void test11(id (*f)(void) __attribute__(
   // 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();
 }
@@ -335,6 +370,8 @@ 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]])
@@ -347,12 +384,18 @@ 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
 }
 
@@ -360,6 +403,8 @@ 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;
 
@@ -385,6 +430,8 @@ 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
 }
 
@@ -863,6 +910,8 @@ 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]]
@@ -925,6 +974,8 @@ 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
@@ -963,6 +1014,8 @@ 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]]
@@ -983,6 +1036,8 @@ 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
 }
 
@@ -1039,6 +1094,8 @@ 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]])
@@ -1051,6 +1108,8 @@ 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
 }
 
@@ -1059,6 +1118,8 @@ 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]])
@@ -1066,6 +1127,8 @@ 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
 }
 
@@ -1074,6 +1137,8 @@ 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]])
@@ -1081,6 +1146,8 @@ 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
 }
 
@@ -1116,10 +1183,14 @@ 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]]
@@ -1134,6 +1205,10 @@ 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]],
@@ -1142,11 +1217,15 @@ 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
 }
 
@@ -1193,10 +1272,14 @@ 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
 }
 
@@ -1276,6 +1359,8 @@ 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** @"\01L_OBJC_SELECTOR_REFERENCES_
@@ -1288,6 +1373,8 @@ 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
 }
 
@@ -1295,11 +1382,14 @@ 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
 
@@ -1391,8 +1481,12 @@ 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);
@@ -1401,11 +1495,15 @@ 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

Modified: cfe/trunk/test/CodeGenObjC/exceptions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/exceptions.m?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/exceptions.m (original)
+++ cfe/trunk/test/CodeGenObjC/exceptions.m Wed Oct  8 07:49:16 2014
@@ -82,6 +82,8 @@ 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;
 
@@ -122,6 +124,7 @@ 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);
 }

Modified: cfe/trunk/test/CodeGenObjCXX/arc-move.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-move.mm?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-move.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-move.mm Wed Oct  8 07:49:16 2014
@@ -46,6 +46,10 @@ void library_move(__strong id &x, __stro
 
 // 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]]
@@ -55,10 +59,16 @@ 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
 }
 

Modified: cfe/trunk/test/CodeGenObjCXX/arc-references.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-references.mm?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-references.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-references.mm Wed Oct  8 07:49:16 2014
@@ -38,11 +38,14 @@ 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
 }
@@ -62,6 +65,7 @@ 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]+]]
@@ -70,8 +74,12 @@ 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
 }
 

Modified: cfe/trunk/test/CodeGenObjCXX/arc.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc.mm?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc.mm Wed Oct  8 07:49:16 2014
@@ -64,7 +64,11 @@ 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]]
@@ -120,56 +124,77 @@ 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
 }
 
@@ -290,6 +315,8 @@ template void test40_helper<int>();
 // 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]]

Modified: cfe/trunk/test/CodeGenObjCXX/literals.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/literals.mm?rev=219303&r1=219302&r2=219303&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/literals.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/literals.mm Wed Oct  8 07:49:16 2014
@@ -16,10 +16,13 @@ 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: [[ELEMENT0:%[a-zA-Z0-9.]+]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 0
+  // 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-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]])
@@ -54,6 +57,8 @@ 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
@@ -70,10 +75,13 @@ void test_array() {
 // CHECK-LABEL: define weak_odr void @_Z24test_array_instantiationIiEvv
 template<typename T>
 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: [[ELEMENT0:%[a-zA-Z0-9.]+]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 0
+  // 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-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]])
@@ -101,6 +109,8 @@ 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





More information about the cfe-commits mailing list