Loading llvm/test/Transforms/InstCombine/builtin-object-size-ptr.ll +9 −10 Original line number Diff line number Diff line ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -instcombine -S < %s | FileCheck %s ; int foo() { Loading @@ -13,22 +14,20 @@ %struct.V = type { [10 x i8], i32, [10 x i8] } define i32 @foo() #0 { entry: ; CHECK-LABEL: @foo( ; CHECK-NEXT: ret i32 27 ; %var = alloca %struct.V, align 4 %0 = bitcast %struct.V* %var to i8* call void @llvm.lifetime.start.p0i8(i64 28, i8* %0) #3 %t0 = bitcast %struct.V* %var to i8* call void @llvm.lifetime.start.p0i8(i64 28, i8* %t0) #3 %buf1 = getelementptr inbounds %struct.V, %struct.V* %var, i32 0, i32 0 %arrayidx = getelementptr inbounds [10 x i8], [10 x i8]* %buf1, i64 0, i64 1 %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %arrayidx, i1 false) %conv = trunc i64 %1 to i32 call void @llvm.lifetime.end.p0i8(i64 28, i8* %0) #3 %t1 = call i64 @llvm.objectsize.i64.p0i8(i8* %arrayidx, i1 false) %conv = trunc i64 %t1 to i32 call void @llvm.lifetime.end.p0i8(i64 28, i8* %t0) #3 ret i32 %conv ; CHECK: ret i32 27 ; CHECK-NOT: ret i32 -1 } declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1) #2 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 Loading
llvm/test/Transforms/InstCombine/builtin-object-size-ptr.ll +9 −10 Original line number Diff line number Diff line ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -instcombine -S < %s | FileCheck %s ; int foo() { Loading @@ -13,22 +14,20 @@ %struct.V = type { [10 x i8], i32, [10 x i8] } define i32 @foo() #0 { entry: ; CHECK-LABEL: @foo( ; CHECK-NEXT: ret i32 27 ; %var = alloca %struct.V, align 4 %0 = bitcast %struct.V* %var to i8* call void @llvm.lifetime.start.p0i8(i64 28, i8* %0) #3 %t0 = bitcast %struct.V* %var to i8* call void @llvm.lifetime.start.p0i8(i64 28, i8* %t0) #3 %buf1 = getelementptr inbounds %struct.V, %struct.V* %var, i32 0, i32 0 %arrayidx = getelementptr inbounds [10 x i8], [10 x i8]* %buf1, i64 0, i64 1 %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %arrayidx, i1 false) %conv = trunc i64 %1 to i32 call void @llvm.lifetime.end.p0i8(i64 28, i8* %0) #3 %t1 = call i64 @llvm.objectsize.i64.p0i8(i8* %arrayidx, i1 false) %conv = trunc i64 %t1 to i32 call void @llvm.lifetime.end.p0i8(i64 28, i8* %t0) #3 ret i32 %conv ; CHECK: ret i32 27 ; CHECK-NOT: ret i32 -1 } declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1) #2 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1