llvm.org GIT mirror llvm / 7894d56
Add a sequence of GEPs with constant indices, for folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3247 91177308-0d34-0410-b5e6-96231b3b80d8 Vikram S. Adve 17 years ago
2 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2626 store float 3.1415, float* %fptrA
2727 store float 5.0, float* %fptrB
2828
29 ;; Test that a sequence of GEPs with constant indices are folded right
30 %fptrA1 = getelementptr %MixedA* %ArrayA, uint 3 ; &ArrayA[3]
31 %fptrA2 = getelementptr %MixedA* %fptrA1, uint 0, ubyte 1 ; &(*fptrA1).1
32 %fptrA3 = getelementptr [15 x int]* %fptrA2, uint 0, uint 8 ; &(*fptrA2)[8]
33 store int 5, int* %fptrA3 ; ArrayA[3].1[8] = 5
34
2935 %sqrtTwo = load %MixedA* %ScalarA, uint 0, ubyte 0
3036 %exp = load %MixedB* %ScalarB, uint 0, ubyte 1, ubyte 0
3137 %pi = load %MixedA* %ArrayA, uint 1, ubyte 0
2626 store float 3.1415, float* %fptrA
2727 store float 5.0, float* %fptrB
2828
29 ;; Test that a sequence of GEPs with constant indices are folded right
30 %fptrA1 = getelementptr %MixedA* %ArrayA, uint 3 ; &ArrayA[3]
31 %fptrA2 = getelementptr %MixedA* %fptrA1, uint 0, ubyte 1 ; &(*fptrA1).1
32 %fptrA3 = getelementptr [15 x int]* %fptrA2, uint 0, uint 8 ; &(*fptrA2)[8]
33 store int 5, int* %fptrA3 ; ArrayA[3].1[8] = 5
34
2935 %sqrtTwo = load %MixedA* %ScalarA, uint 0, ubyte 0
3036 %exp = load %MixedB* %ScalarB, uint 0, ubyte 1, ubyte 0
3137 %pi = load %MixedA* %ArrayA, uint 1, ubyte 0