74 lines · plain
1; RUN: llc %s -mtriple=aarch64-linux-gnuabi -aarch64-enable-global-merge -o - | FileCheck %s2 3target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32:64-S128"4target triple = "arm64-apple-ios7.0.0"5 6@bar = internal global [5 x i32] zeroinitializer, align 47@baz = internal global [5 x i32] zeroinitializer, align 48@foo = internal global [5 x i32] zeroinitializer, align 49 10; Function Attrs: nounwind ssp11define internal void @initialize() #0 {12 %1 = tail call i32 @calc() #213 store i32 %1, ptr @bar, align 414 %2 = tail call i32 @calc() #215 store i32 %2, ptr @baz, align 416 %3 = tail call i32 @calc() #217 store i32 %3, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 1), align 418 %4 = tail call i32 @calc() #219 store i32 %4, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 1), align 420 %5 = tail call i32 @calc() #221 store i32 %5, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 2), align 422 %6 = tail call i32 @calc() #223 store i32 %6, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 2), align 424 %7 = tail call i32 @calc() #225 store i32 %7, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 3), align 426 %8 = tail call i32 @calc() #227 store i32 %8, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 3), align 428 %9 = tail call i32 @calc() #229 store i32 %9, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 4), align 430 %10 = tail call i32 @calc() #231 store i32 %10, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 4), align 432 ret void33}34 35declare i32 @calc(...)36 37; Function Attrs: nounwind ssp38define internal void @calculate() #0 {39 %1 = load i32, ptr @bar, align 440 %2 = load i32, ptr @baz, align 441 %3 = mul nsw i32 %2, %142 store i32 %3, ptr @foo, align 443 %4 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 1), align 444 %5 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 1), align 445 %6 = mul nsw i32 %5, %446 store i32 %6, ptr getelementptr inbounds ([5 x i32], ptr @foo, i64 0, i64 1), align 447 %7 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 2), align 448 %8 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 2), align 449 %9 = mul nsw i32 %8, %750 store i32 %9, ptr getelementptr inbounds ([5 x i32], ptr @foo, i64 0, i64 2), align 451 %10 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 3), align 452 %11 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 3), align 453 %12 = mul nsw i32 %11, %1054 store i32 %12, ptr getelementptr inbounds ([5 x i32], ptr @foo, i64 0, i64 3), align 455 %13 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @bar, i64 0, i64 4), align 456 %14 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @baz, i64 0, i64 4), align 457 %15 = mul nsw i32 %14, %1358 store i32 %15, ptr getelementptr inbounds ([5 x i32], ptr @foo, i64 0, i64 4), align 459 ret void60}61 62; Function Attrs: nounwind readnone ssp63define internal ptr @returnFoo() #1 {64 ret ptr @foo65}66 67;CHECK: .type .L_MergedGlobals,@object // @_MergedGlobals68;CHECK: .local .L_MergedGlobals69;CHECK: .comm .L_MergedGlobals,60,470 71attributes #0 = { nounwind ssp }72attributes #1 = { nounwind readnone ssp }73attributes #2 = { nounwind }74