mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
merge some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
83f1136cfd
commit
c04d3d37e4
@ -1,9 +0,0 @@
|
|||||||
; RUN: opt < %s -instcombine -S | \
|
|
||||||
; RUN: not grep i8
|
|
||||||
|
|
||||||
define i32 @test1(i32 %X) {
|
|
||||||
%Y = trunc i32 %X to i8 ; <i8> [#uses=1]
|
|
||||||
%Z = zext i8 %Y to i32 ; <i32> [#uses=1]
|
|
||||||
ret i32 %Z
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
|||||||
; RUN: opt < %s -instcombine -globaldce -S | \
|
|
||||||
; RUN: not grep Array
|
|
||||||
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
|
|
||||||
|
|
||||||
; Pulling the cast out of the load allows us to eliminate the load, and then
|
|
||||||
; the whole array.
|
|
||||||
|
|
||||||
%op = type { float }
|
|
||||||
%unop = type { i32 }
|
|
||||||
@Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* @foo ] ; <[1 x %op* (%op*)*]*> [#uses=1]
|
|
||||||
|
|
||||||
define %op* @foo(%op* %X) {
|
|
||||||
ret %op* %X
|
|
||||||
}
|
|
||||||
|
|
||||||
define %unop* @caller(%op* %O) {
|
|
||||||
%tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1]
|
|
||||||
%tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1]
|
|
||||||
ret %unop* %tmp.2
|
|
||||||
}
|
|
||||||
|
|
@ -373,4 +373,11 @@ define i32* @test41(i32* %tmp1) {
|
|||||||
; CHECK: ret i32* %tmp1
|
; CHECK: ret i32* %tmp1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define i32 @test42(i32 %X) {
|
||||||
|
%Y = trunc i32 %X to i8 ; <i8> [#uses=1]
|
||||||
|
%Z = zext i8 %Y to i32 ; <i32> [#uses=1]
|
||||||
|
ret i32 %Z
|
||||||
|
; CHECK: @test42
|
||||||
|
; CHECK: %Z = and i32 %X, 255
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
; RUN: opt < %s -instcombine -S | grep bitcast | count 1
|
|
||||||
|
|
||||||
; InstCombine can not 'load (cast P)' -> cast (load P)' if the cast changes
|
|
||||||
; the address space.
|
|
||||||
|
|
||||||
|
|
||||||
define void @test2(i8 addrspace(1)* %source, <2 x i8> addrspace(1)* %dest) {
|
|
||||||
entry:
|
|
||||||
%arrayidx1 = bitcast <2 x i8> addrspace(1)* %dest to <2 x i8> addrspace(1)*
|
|
||||||
%conv = bitcast i8 addrspace(1)* %source to <16 x i8>*
|
|
||||||
%arrayidx22 = bitcast <16 x i8>* %conv to <16 x i8>*
|
|
||||||
%tmp3 = load <16 x i8>* %arrayidx22
|
|
||||||
%arrayidx223 = bitcast i8 addrspace(1)* %source to i8*
|
|
||||||
%tmp4 = load i8* %arrayidx223
|
|
||||||
%tmp5 = insertelement <2 x i8> undef, i8 %tmp4, i32 0
|
|
||||||
%splat = shufflevector <2 x i8> %tmp5, <2 x i8> undef, <2 x i32> zeroinitializer
|
|
||||||
store <2 x i8> %splat, <2 x i8> addrspace(1)* %arrayidx1
|
|
||||||
ret void
|
|
||||||
}
|
|
@ -45,3 +45,35 @@ define i1 @test4(i32 %A) {
|
|||||||
; CHECK-NEXT: %C = icmp eq i32 %A, 0
|
; CHECK-NEXT: %C = icmp eq i32 %A, 0
|
||||||
; CHECK-NEXT: ret i1 %C
|
; CHECK-NEXT: ret i1 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; Pulling the cast out of the load allows us to eliminate the load, and then
|
||||||
|
; the whole array.
|
||||||
|
|
||||||
|
%op = type { float }
|
||||||
|
%unop = type { i32 }
|
||||||
|
@Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* @foo ] ; <[1 x %op* (%op*)*]*> [#uses=1]
|
||||||
|
|
||||||
|
declare %op* @foo(%op* %X)
|
||||||
|
|
||||||
|
define %unop* @test5(%op* %O) {
|
||||||
|
%tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1]
|
||||||
|
%tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1]
|
||||||
|
ret %unop* %tmp.2
|
||||||
|
; CHECK: @test5
|
||||||
|
; CHECK: call %op* @foo(%op* %O)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; InstCombine can not 'load (cast P)' -> cast (load P)' if the cast changes
|
||||||
|
; the address space.
|
||||||
|
|
||||||
|
define i8 @test6(i8 addrspace(1)* %source) {
|
||||||
|
entry:
|
||||||
|
%arrayidx223 = bitcast i8 addrspace(1)* %source to i8*
|
||||||
|
%tmp4 = load i8* %arrayidx223
|
||||||
|
ret i8 %tmp4
|
||||||
|
; CHECK: @test6
|
||||||
|
; CHECK: load i8* %arrayidx223
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user