comparison test/Transforms/SROA/fca.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
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
1 ; RUN: opt < %s -sroa -S | FileCheck %s 1 ; RUN: opt < %s -sroa -S | FileCheck %s
2 ; RUN: opt < %s -sroa -force-ssa-updater -S | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n8:16:32:64" 2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n8:16:32:64"
4 3
5 define { i32, i32 } @test0(i32 %x, i32 %y) { 4 define { i32, i32 } @test0(i32 %x, i32 %y) {
6 ; CHECK-LABEL: @test0( 5 ; CHECK-LABEL: @test0(
7 ; CHECK-NOT: alloca 6 ; CHECK-NOT: alloca
12 entry: 11 entry:
13 %a = alloca { i32, i32 } 12 %a = alloca { i32, i32 }
14 13
15 store { i32, i32 } undef, { i32, i32 }* %a 14 store { i32, i32 } undef, { i32, i32 }* %a
16 15
17 %gep1 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 0 16 %gep1 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 0
18 store i32 %x, i32* %gep1 17 store i32 %x, i32* %gep1
19 %gep2 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 1 18 %gep2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 1
20 store i32 %y, i32* %gep2 19 store i32 %y, i32* %gep2
21 20
22 %result = load { i32, i32 }* %a 21 %result = load { i32, i32 }, { i32, i32 }* %a
23 ret { i32, i32 } %result 22 ret { i32, i32 } %result
24 } 23 }
25 24
26 define { i32, i32 } @test1(i32 %x, i32 %y) { 25 define { i32, i32 } @test1(i32 %x, i32 %y) {
27 ; FIXME: This may be too conservative. Duncan argues that we are allowed to 26 ; FIXME: This may be too conservative. Duncan argues that we are allowed to
28 ; split the volatile load and store here but must produce volatile scalar loads 27 ; split the volatile load and store here but must produce volatile scalar loads
29 ; and stores from them. 28 ; and stores from them.
30 ; CHECK-LABEL: @test1( 29 ; CHECK-LABEL: @test1(
31 ; CHECK: alloca 30 ; CHECK: alloca
32 ; CHECK: alloca 31 ; CHECK: alloca
33 ; CHECK: load volatile { i32, i32 }* 32 ; CHECK: load volatile { i32, i32 }, { i32, i32 }*
34 ; CHECK: store volatile { i32, i32 } 33 ; CHECK: store volatile { i32, i32 }
35 ; CHECK: ret { i32, i32 } 34 ; CHECK: ret { i32, i32 }
36 35
37 entry: 36 entry:
38 %a = alloca { i32, i32 } 37 %a = alloca { i32, i32 }
39 %b = alloca { i32, i32 } 38 %b = alloca { i32, i32 }
40 39
41 %gep1 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 0 40 %gep1 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 0
42 store i32 %x, i32* %gep1 41 store i32 %x, i32* %gep1
43 %gep2 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 1 42 %gep2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 1
44 store i32 %y, i32* %gep2 43 store i32 %y, i32* %gep2
45 44
46 %result = load volatile { i32, i32 }* %a 45 %result = load volatile { i32, i32 }, { i32, i32 }* %a
47 store volatile { i32, i32 } %result, { i32, i32 }* %b 46 store volatile { i32, i32 } %result, { i32, i32 }* %b
48 ret { i32, i32 } %result 47 ret { i32, i32 } %result
49 } 48 }