mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 22:32:47 +00:00
d6aa02de10
to a few tests where it is required for the expected transformation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77290 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
1.2 KiB
LLVM
32 lines
1.2 KiB
LLVM
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
|
|
; RUN: not grep getelementptr
|
|
|
|
define i1 @test1(i16* %P, i32 %I, i32 %J) {
|
|
%X = getelementptr inbounds i16* %P, i32 %I ; <i16*> [#uses=1]
|
|
%Y = getelementptr inbounds i16* %P, i32 %J ; <i16*> [#uses=1]
|
|
%C = icmp ult i16* %X, %Y ; <i1> [#uses=1]
|
|
ret i1 %C
|
|
}
|
|
|
|
define i1 @test2(i16* %P, i32 %I) {
|
|
%X = getelementptr inbounds i16* %P, i32 %I ; <i16*> [#uses=1]
|
|
%C = icmp ult i16* %X, %P ; <i1> [#uses=1]
|
|
ret i1 %C
|
|
}
|
|
|
|
define i32 @test3(i32* %P, i32 %A, i32 %B) {
|
|
%tmp.4 = getelementptr inbounds i32* %P, i32 %A ; <i32*> [#uses=1]
|
|
%tmp.9 = getelementptr inbounds i32* %P, i32 %B ; <i32*> [#uses=1]
|
|
%tmp.10 = icmp eq i32* %tmp.4, %tmp.9 ; <i1> [#uses=1]
|
|
%tmp.11 = zext i1 %tmp.10 to i32 ; <i32> [#uses=1]
|
|
ret i32 %tmp.11
|
|
}
|
|
|
|
define i32 @test4(i32* %P, i32 %A, i32 %B) {
|
|
%tmp.4 = getelementptr inbounds i32* %P, i32 %A ; <i32*> [#uses=1]
|
|
%tmp.6 = icmp eq i32* %tmp.4, %P ; <i1> [#uses=1]
|
|
%tmp.7 = zext i1 %tmp.6 to i32 ; <i32> [#uses=1]
|
|
ret i32 %tmp.7
|
|
}
|
|
|