1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instcombine,lower-constant-intrinsics -S < %s | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 declare i64 @llvm.objectsize.i64.p0(ptr, i1 immarg, i1 immarg, i1 immarg)
10 define dso_local i64 @check_store_load(i1 %cond) local_unnamed_addr {
11 ; CHECK-LABEL: @check_store_load(
13 ; CHECK-NEXT: [[PTR01:%.*]] = alloca [10 x i8], align 1
14 ; CHECK-NEXT: br i1 [[COND:%.*]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
16 ; CHECK-NEXT: br label [[RETURN:%.*]]
18 ; CHECK-NEXT: [[PTR12:%.*]] = alloca [12 x i8], align 1
19 ; CHECK-NEXT: br label [[RETURN]]
21 ; CHECK-NEXT: [[STOREMERGE:%.*]] = phi ptr [ [[PTR12]], [[IF_END]] ], [ [[PTR01]], [[IF_THEN]] ]
22 ; CHECK-NEXT: ret i64 12
26 %ptr0 = alloca i8, i64 10
27 br i1 %cond, label %if.then, label %if.end
30 store ptr %ptr0, ptr %holder
34 %ptr1 = alloca i8, i64 12
35 store ptr %ptr1, ptr %holder
39 %held = load ptr, ptr %holder
40 %objsize = call i64 @llvm.objectsize.i64.p0(ptr %held, i1 false, i1 true, i1 false)