* Function names should start with % * Create FunctionName from string * Implement displaying of FunctionName as %nnnn with fallback to #xxxx * Run rustfmt and fix FunctionName::with_string in parser * Implement FunctionName::new as a generic function * Binary function names should start with # * Implement NameRepr for function name * Fix examples in docs to reflect that function names start with % * Rebase and fix filecheck tests
22 lines
419 B
Plaintext
22 lines
419 B
Plaintext
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
|
|
}
|