moved crates in lib/ to src/, renamed crates, modified some files' text (#660)
moved crates in lib/ to src/, renamed crates, modified some files' text (#660)
This commit is contained in:
41
cranelift/filetests/filetests/simple_gvn/basic.clif
Normal file
41
cranelift/filetests/filetests/simple_gvn/basic.clif
Normal file
@@ -0,0 +1,41 @@
|
||||
test simple-gvn
|
||||
|
||||
function %simple_redundancy(i32, i32) -> i32 {
|
||||
ebb0(v0: i32, v1: i32):
|
||||
v2 = iadd v0, v1
|
||||
v3 = iadd v0, v1
|
||||
v4 = imul v2, v3
|
||||
; check: v4 = imul v2, v2
|
||||
return v4
|
||||
}
|
||||
|
||||
function %cascading_redundancy(i32, i32) -> i32 {
|
||||
ebb0(v0: i32, v1: i32):
|
||||
v2 = iadd v0, v1
|
||||
v3 = iadd v0, v1
|
||||
v4 = imul v2, v3
|
||||
v5 = imul v2, v2
|
||||
v6 = iadd v4, v5
|
||||
; check: v6 = iadd v4, v4
|
||||
return v6
|
||||
}
|
||||
|
||||
function %redundancies_on_some_paths(i32, i32, i32) -> i32 {
|
||||
ebb0(v0: i32, v1: i32, v2: i32):
|
||||
v3 = iadd v0, v1
|
||||
brz v3, ebb1
|
||||
v4 = iadd v0, v1
|
||||
jump ebb2(v4)
|
||||
; check: jump ebb2(v3)
|
||||
|
||||
ebb1:
|
||||
v5 = iadd v0, v1
|
||||
jump ebb2(v5)
|
||||
; check: jump ebb2(v3)
|
||||
|
||||
ebb2(v6: i32):
|
||||
v7 = iadd v0, v1
|
||||
v8 = iadd v6, v7
|
||||
; check: v8 = iadd v6, v3
|
||||
return v8
|
||||
}
|
||||
25
cranelift/filetests/filetests/simple_gvn/readonly.clif
Normal file
25
cranelift/filetests/filetests/simple_gvn/readonly.clif
Normal file
@@ -0,0 +1,25 @@
|
||||
test simple-gvn
|
||||
|
||||
target x86_64
|
||||
|
||||
function %eliminate_redundant_global_loads(i32, i64 vmctx) {
|
||||
gv0 = vmctx
|
||||
gv1 = load.i64 notrap aligned readonly gv0
|
||||
heap0 = static gv1, min 0x1_0000, bound 0x1_0000_0000, offset_guard 0x8000_0000, index_type i32
|
||||
|
||||
ebb0(v0: i32, v1: i64):
|
||||
v2 = heap_addr.i64 heap0, v0, 1
|
||||
v3 = heap_addr.i64 heap0, v0, 1
|
||||
|
||||
v4 = iconst.i32 0
|
||||
store.i32 notrap aligned v4, v2
|
||||
store.i32 notrap aligned v4, v3
|
||||
|
||||
return
|
||||
}
|
||||
; check: v2 = heap_addr.i64 heap0, v0, 1
|
||||
; check: v3 -> v2
|
||||
; check: v4 = iconst.i32 0
|
||||
; check: store notrap aligned v4, v2
|
||||
; check: store notrap aligned v4, v2
|
||||
; check: return
|
||||
56
cranelift/filetests/filetests/simple_gvn/reject.clif
Normal file
56
cranelift/filetests/filetests/simple_gvn/reject.clif
Normal file
@@ -0,0 +1,56 @@
|
||||
test simple-gvn
|
||||
|
||||
function %other_side_effects(i32) -> i32 {
|
||||
ebb0(v0: i32):
|
||||
regmove v0, %10 -> %20
|
||||
regmove v0, %10 -> %20
|
||||
regmove v0, %20 -> %10
|
||||
; check: regmove v0, %10 -> %20
|
||||
; check: regmove v0, %10 -> %20
|
||||
return v0
|
||||
}
|
||||
|
||||
function %differing_typevars() -> i64 {
|
||||
ebb0:
|
||||
v0 = iconst.i32 7
|
||||
v1 = iconst.i64 7
|
||||
v2 = iconst.i64 8
|
||||
; check: v0 = iconst.i32 7
|
||||
; check: v1 = iconst.i64 7
|
||||
; check: v2 = iconst.i64 8
|
||||
v3 = uextend.i64 v0
|
||||
v4 = iadd v2, v1
|
||||
v5 = iadd v4, v3
|
||||
return v5
|
||||
}
|
||||
|
||||
function %cpu_flags() -> b1 {
|
||||
ebb0:
|
||||
v0 = iconst.i32 7
|
||||
v1 = iconst.i32 8
|
||||
v2 = ifcmp v0, v1
|
||||
v3 = trueif eq v2
|
||||
v4 = ifcmp v0, v1
|
||||
v5 = trueif eq v4
|
||||
v6 = bor v3, v5
|
||||
; check: v2 = ifcmp v0, v1
|
||||
; check: v3 = trueif eq v2
|
||||
; check: v4 = ifcmp v0, v1
|
||||
; check: v5 = trueif eq v4
|
||||
return v6
|
||||
}
|
||||
|
||||
function %spill() -> i32 {
|
||||
ebb0:
|
||||
v0 = iconst.i32 7
|
||||
v1 = spill v0
|
||||
v2 = fill v1
|
||||
v3 = spill v0
|
||||
v4 = fill v1
|
||||
v5 = bor v2, v4
|
||||
; check: v1 = spill v0
|
||||
; check: v2 = fill v1
|
||||
; check: v3 = spill v0
|
||||
; check: v4 = fill v1
|
||||
return v5
|
||||
}
|
||||
76
cranelift/filetests/filetests/simple_gvn/scopes.clif
Normal file
76
cranelift/filetests/filetests/simple_gvn/scopes.clif
Normal file
@@ -0,0 +1,76 @@
|
||||
test simple-gvn
|
||||
|
||||
function %two_diamonds(i32, i32, i32, i32, i32) {
|
||||
ebb0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32):
|
||||
v5 = iconst.i32 16
|
||||
; check: v5 = iconst.i32 16
|
||||
brz v0, ebb1
|
||||
v6 = iconst.i32 17
|
||||
; check: v6 = iconst.i32 17
|
||||
v7 = iconst.i32 16
|
||||
; not: v7 = iconst.i32 16
|
||||
jump ebb2
|
||||
|
||||
ebb1:
|
||||
v8 = iconst.i32 18
|
||||
; check: v8 = iconst.i32 18
|
||||
v9 = iconst.i32 17
|
||||
; check: v9 = iconst.i32 17
|
||||
v10 = iconst.i32 16
|
||||
; not: v10 = iconst.i32 16
|
||||
jump ebb2
|
||||
|
||||
ebb2:
|
||||
v11 = iconst.i32 19
|
||||
; check: v11 = iconst.i32 19
|
||||
v12 = iconst.i32 18
|
||||
; check: v12 = iconst.i32 18
|
||||
v13 = iconst.i32 17
|
||||
; check: v13 = iconst.i32 17
|
||||
v14 = iconst.i32 16
|
||||
; not: v14 = iconst.i32 16
|
||||
brz v1, ebb3
|
||||
v15 = iconst.i32 20
|
||||
; check: v15 = iconst.i32 20
|
||||
v16 = iconst.i32 19
|
||||
; not: v16 = iconst.i32 19
|
||||
v17 = iconst.i32 18
|
||||
; not: v17 = iconst.i32 18
|
||||
v18 = iconst.i32 17
|
||||
; not: v18 = iconst.i32 17
|
||||
v19 = iconst.i32 16
|
||||
; not: v19 = iconst.i32 16
|
||||
jump ebb4
|
||||
|
||||
ebb3:
|
||||
v20 = iconst.i32 21
|
||||
; check: v20 = iconst.i32 21
|
||||
v21 = iconst.i32 20
|
||||
; check: v21 = iconst.i32 20
|
||||
v22 = iconst.i32 19
|
||||
; not: v22 = iconst.i32 19
|
||||
v23 = iconst.i32 18
|
||||
; not: v23 = iconst.i32 18
|
||||
v24 = iconst.i32 17
|
||||
; not: v24 = iconst.i32 17
|
||||
v25 = iconst.i32 16
|
||||
; not: v25 = iconst.i32 16
|
||||
jump ebb4
|
||||
|
||||
ebb4:
|
||||
v26 = iconst.i32 22
|
||||
; check: v26 = iconst.i32 22
|
||||
v27 = iconst.i32 21
|
||||
; check: v27 = iconst.i32 21
|
||||
v28 = iconst.i32 20
|
||||
; check: v28 = iconst.i32 20
|
||||
v29 = iconst.i32 19
|
||||
; not: v29 = iconst.i32 19
|
||||
v30 = iconst.i32 18
|
||||
; not: v30 = iconst.i32 18
|
||||
v31 = iconst.i32 17
|
||||
; not: v31 = iconst.i32 17
|
||||
v32 = iconst.i32 16
|
||||
; not: v32 = iconst.i32 16
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user