Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/isel-optnone.ll @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | 95c75e76d11b |
children | 803732b1fca8 |
comparison
equal
deleted
inserted
replaced
84:f3e34b893a5f | 95:afa8332a0e37 |
---|---|
1 ; RUN: llc -O2 -march=x86 < %s | FileCheck %s | 1 ; RUN: llc -O2 -march=x86 < %s | FileCheck %s |
2 | 2 |
3 define i32* @fooOptnone(i32* %p, i32* %q, i32** %z) #0 { | 3 define i32* @fooOptnone(i32* %p, i32* %q, i32** %z) #0 { |
4 entry: | 4 entry: |
5 %r = load i32* %p | 5 %r = load i32, i32* %p |
6 %s = load i32* %q | 6 %s = load i32, i32* %q |
7 %y = load i32** %z | 7 %y = load i32*, i32** %z |
8 | 8 |
9 %t0 = add i32 %r, %s | 9 %t0 = add i32 %r, %s |
10 %t1 = add i32 %t0, 1 | 10 %t1 = add i32 %t0, 1 |
11 %t2 = getelementptr i32* %y, i32 1 | 11 %t2 = getelementptr i32, i32* %y, i32 1 |
12 %t3 = getelementptr i32* %t2, i32 %t1 | 12 %t3 = getelementptr i32, i32* %t2, i32 %t1 |
13 | 13 |
14 ret i32* %t3 | 14 ret i32* %t3 |
15 | 15 |
16 ; 'optnone' should use fast-isel which will not produce 'lea'. | 16 ; 'optnone' should use fast-isel which will not produce 'lea'. |
17 ; CHECK-LABEL: fooOptnone: | 17 ; CHECK-LABEL: fooOptnone: |
19 ; CHECK: ret | 19 ; CHECK: ret |
20 } | 20 } |
21 | 21 |
22 define i32* @fooNormal(i32* %p, i32* %q, i32** %z) #1 { | 22 define i32* @fooNormal(i32* %p, i32* %q, i32** %z) #1 { |
23 entry: | 23 entry: |
24 %r = load i32* %p | 24 %r = load i32, i32* %p |
25 %s = load i32* %q | 25 %s = load i32, i32* %q |
26 %y = load i32** %z | 26 %y = load i32*, i32** %z |
27 | 27 |
28 %t0 = add i32 %r, %s | 28 %t0 = add i32 %r, %s |
29 %t1 = add i32 %t0, 1 | 29 %t1 = add i32 %t0, 1 |
30 %t2 = getelementptr i32* %y, i32 1 | 30 %t2 = getelementptr i32, i32* %y, i32 1 |
31 %t3 = getelementptr i32* %t2, i32 %t1 | 31 %t3 = getelementptr i32, i32* %t2, i32 %t1 |
32 | 32 |
33 ret i32* %t3 | 33 ret i32* %t3 |
34 | 34 |
35 ; Normal ISel will produce 'lea'. | 35 ; Normal ISel will produce 'lea'. |
36 ; CHECK-LABEL: fooNormal: | 36 ; CHECK-LABEL: fooNormal: |