mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
Covnert testcases to not use indexed loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0fd5bfd79d
commit
ac2cbb847d
@ -20,7 +20,8 @@ implementation
|
|||||||
int "foo"(int %blah)
|
int "foo"(int %blah)
|
||||||
begin
|
begin
|
||||||
store int %blah, int *%MyVar
|
store int %blah, int *%MyVar
|
||||||
store int 12, { \2 *, int } * %MyIntList, uint 0, ubyte 1
|
%idx = getelementptr { \2 *, int } * %MyIntList, uint 0, ubyte 1
|
||||||
|
store int 12, int* %idx
|
||||||
|
|
||||||
%ack = load int * %0 ;; Load from the unnamed constant
|
%ack = load int * %0 ;; Load from the unnamed constant
|
||||||
%fzo = add int %ack, %blah
|
%fzo = add int %ack, %blah
|
||||||
|
@ -15,7 +15,8 @@ implementation
|
|||||||
|
|
||||||
int "test"([20 x [10 x [5 x int]]] * %A)
|
int "test"([20 x [10 x [5 x int]]] * %A)
|
||||||
begin
|
begin
|
||||||
%i = load [20 x [10 x [5 x int]]] * %A, uint 1, uint 2, uint 3, uint 4
|
%idx = getelementptr [20 x [10 x [5 x int]]] * %A, uint 1, uint 2, uint 3, uint 4
|
||||||
|
%i = load int* %idx
|
||||||
|
|
||||||
;; same as above but via a GEP
|
;; same as above but via a GEP
|
||||||
%iptr = getelementptr [20 x [10 x [5 x int]]] * %A, uint 1, uint 2, uint 3, uint 4
|
%iptr = getelementptr [20 x [10 x [5 x int]]] * %A, uint 1, uint 2, uint 3, uint 4
|
||||||
@ -37,7 +38,8 @@ bb0: ;[#uses=2]
|
|||||||
%reg164-idxcast = cast int %reg112 to uint ; <uint> [#uses=1]
|
%reg164-idxcast = cast int %reg112 to uint ; <uint> [#uses=1]
|
||||||
|
|
||||||
;; Store to a structure field
|
;; Store to a structure field
|
||||||
store sbyte 81, %Mixed_struct * %M, uint 0, ubyte 3, uint %reg164-idxcast, ubyte 0
|
%idx1 = getelementptr %Mixed_struct * %M, uint 0, ubyte 3, uint %reg164-idxcast, ubyte 0
|
||||||
|
store sbyte 81, sbyte* %idx1
|
||||||
|
|
||||||
;; EXPECTED RESULT: decomposed indices for above STORE
|
;; EXPECTED RESULT: decomposed indices for above STORE
|
||||||
;; %ptr1 = getelementptr %Mixed_struct * %M, uint 0, ubyte 3
|
;; %ptr1 = getelementptr %Mixed_struct * %M, uint 0, ubyte 3
|
||||||
@ -45,7 +47,8 @@ bb0: ;[#uses=2]
|
|||||||
;; store sbyte 81, {sbyte,float}* %ptr2, uint 0, ubyte 0
|
;; store sbyte 81, {sbyte,float}* %ptr2, uint 0, ubyte 0
|
||||||
|
|
||||||
;; Store to an array field within a structure
|
;; Store to an array field within a structure
|
||||||
store double 2.17, %Mixed_struct * %M, uint 0, ubyte 1, uint %reg164-idxcast
|
%idx2 = getelementptr %Mixed_struct * %M, uint 0, ubyte 1, uint %reg164-idxcast
|
||||||
|
store double 2.17, double* %idx2
|
||||||
|
|
||||||
;; EXPECTED RESULT: decomposed indices for above STORE
|
;; EXPECTED RESULT: decomposed indices for above STORE
|
||||||
;; %ptr1 = getelementptr %Mixed_struct * %M, uint 0, ubyte 1
|
;; %ptr1 = getelementptr %Mixed_struct * %M, uint 0, ubyte 1
|
||||||
@ -73,13 +76,15 @@ end
|
|||||||
int "ArrayRef"([100 x int] * %Array, uint %I, uint %J)
|
int "ArrayRef"([100 x int] * %Array, uint %I, uint %J)
|
||||||
begin
|
begin
|
||||||
bb0: ;[#uses=3]
|
bb0: ;[#uses=3]
|
||||||
%reg121 = load [100 x int]* %Array, uint %I, uint %J ; <int> [#uses=1]
|
%idx = getelementptr [100 x int]* %Array, uint %I, uint %J ; <int> [#uses=1]
|
||||||
|
%reg121 = load int* %idx
|
||||||
ret int %reg121;
|
ret int %reg121;
|
||||||
end
|
end
|
||||||
|
|
||||||
sbyte "PtrRef"(sbyte** %argv, uint %I, uint %J)
|
sbyte "PtrRef"(sbyte** %argv, uint %I, uint %J)
|
||||||
begin
|
begin
|
||||||
bb0: ;[#uses=3]
|
bb0: ;[#uses=3]
|
||||||
%reg222 = load sbyte** %argv, uint %I, uint %J ; <sbyte> [#uses=1]
|
%idx = getelementptr sbyte** %argv, uint %I, uint %J
|
||||||
|
%reg222 = load sbyte* %idx
|
||||||
ret sbyte %reg222;
|
ret sbyte %reg222;
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user