~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/SCCP/apint-load.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; This test makes sure that these instructions are properly constant propagated.
 
2
 
 
3
; RUN: opt < %s -ipsccp -S | not grep load
 
4
; RUN: opt < %s -ipsccp -S | not grep fdiv
 
5
 
 
6
@X = constant i212 42
 
7
@Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, 
 
8
                                     { i212, float } { i212 37, float 0x3FF3B2FEC0000000 } ]
 
9
define i212 @test1() {
 
10
        %B = load i212, i212* @X
 
11
        ret i212 %B
 
12
}
 
13
 
 
14
define internal float @test2() {
 
15
        %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1
 
16
        %B = load float, float* %A
 
17
        ret float %B
 
18
}
 
19
 
 
20
define internal i212 @test3() {
 
21
        %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0
 
22
        %B = load i212, i212* %A
 
23
        ret i212 %B
 
24
}
 
25
 
 
26
define float @All()
 
27
{
 
28
   %A = call float @test2()
 
29
   %B = call i212 @test3()
 
30
   %C = mul i212 %B, -1234567
 
31
   %D = sitofp i212 %C to float
 
32
   %E = fdiv float %A, %D
 
33
   ret float %E
 
34
}
 
35
 
 
36