File: fast-isel-mem.ll

package info (click to toggle)
llvm-3.0 3.0-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 75,412 kB
  • sloc: cpp: 468,043; asm: 109,345; ansic: 13,782; sh: 12,935; ml: 4,716; python: 4,351; perl: 2,096; makefile: 1,905; pascal: 1,578; exp: 389; xml: 283; lisp: 187; csh: 117
file content (34 lines) | stat: -rw-r--r-- 822 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; RUN: llc < %s -fast-isel -mtriple=i386-apple-darwin | FileCheck %s

@src = external global i32

; rdar://6653118
define i32 @loadgv() nounwind {
entry:
	%0 = load i32* @src, align 4
	%1 = load i32* @src, align 4
        %2 = add i32 %0, %1
        store i32 %2, i32* @src
	ret i32 %2
; This should fold one of the loads into the add.
; CHECK: loadgv:
; CHECK: 	movl	L_src$non_lazy_ptr, %ecx
; CHECK: 	movl	(%ecx), %eax
; CHECK: 	addl	(%ecx), %eax
; CHECK: 	movl	%eax, (%ecx)
; CHECK: 	ret

}

%stuff = type { i32 (...)** }
@LotsStuff = external constant [4 x i32 (...)*]

define void @t(%stuff* %this) nounwind {
entry:
	store i32 (...)** getelementptr ([4 x i32 (...)*]* @LotsStuff, i32 0, i32 2), i32 (...)*** null, align 4
	ret void
; CHECK: _t:
; CHECK:	movl	$0, %eax
; CHECK:	movl	L_LotsStuff$non_lazy_ptr, %ecx

}