File: global-merge-alignment.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8~deb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (24 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: llc < %s -arm-global-merge -data-sections | FileCheck %s

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7em-arm-none-eabi"

@f = local_unnamed_addr global [4 x i32*] zeroinitializer, align 4
@d = local_unnamed_addr global i64 0, align 8

;CHECK: .section	.bss..L_MergedGlobals,"aw",%nobits
;CHECK-NEXT: .p2align	3
;CHECK-NEXT: .L_MergedGlobals:
;CHECK-NEXT: .zero	24
;CHECK-NEXT: .size	.L_MergedGlobals, 24


define i32 @func_1() {
  %1 = load i64, i64* @d, align 8
  %2 = load i32*, i32** getelementptr inbounds ([4 x i32*], [4 x i32*]* @f, i32 0, i32 0), align 4
  %3 = load i32, i32* %2, align 4
  %4 = trunc i64 %1 to i32
  %5 = add i32 %3, %4
  ret i32 %5
}