Mercurial > hg > CbC > CbC_llvm
comparison test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll @ 0:95c75e76d11b LLVM3.4
LLVM 3.4
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 12 Dec 2013 13:56:28 +0900 |
parents | |
children | afa8332a0e37 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:95c75e76d11b |
---|---|
1 ; This testcase makes sure that size is taken to account when alias analysis | |
2 ; is performed. It is not legal to delete the second load instruction because | |
3 ; the value computed by the first load instruction is changed by the store. | |
4 | |
5 ; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s | |
6 | |
7 define i32 @test() { | |
8 ; CHECK: %Y.DONOTREMOVE = load i32* %A | |
9 ; CHECK: %Z = sub i32 0, %Y.DONOTREMOVE | |
10 %A = alloca i32 | |
11 store i32 0, i32* %A | |
12 %X = load i32* %A | |
13 %B = bitcast i32* %A to i8* | |
14 %C = getelementptr i8* %B, i64 1 | |
15 store i8 1, i8* %C ; Aliases %A | |
16 %Y.DONOTREMOVE = load i32* %A | |
17 %Z = sub i32 %X, %Y.DONOTREMOVE | |
18 ret i32 %Z | |
19 } | |
20 |