mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
- Many stylistic nits. - Removed blkmerge(). - Some minor bug fixes. - GCM reassoc is now "sink"; a pass that moves trivial ops in their target block with the same goal of reducing register pressure, but starting from instructions that benefit from having their inputs close.
32 lines
431 B
Plaintext
32 lines
431 B
Plaintext
# GVN 0/non-0 inference removes @yesyes, @yesno, @noyes, @nono
|
|
|
|
export
|
|
function w $test(w %c) {
|
|
@start
|
|
jnz %c, @yes, @no
|
|
@yes
|
|
%c0 =w cnew %c, 0
|
|
jnz %c0, @yesyes, @yesno
|
|
@yesyes
|
|
%rc =w copy 1
|
|
jmp @end
|
|
@yesno
|
|
%rc =w copy 111
|
|
jmp @end
|
|
@no
|
|
%c1 =w cnew %c, 0
|
|
jnz %c1, @noyes, @nono
|
|
@noyes
|
|
%rc =w copy 222
|
|
jmp @end
|
|
@nono
|
|
%rc =w copy 0
|
|
@end
|
|
ret %rc
|
|
}
|
|
|
|
# >>> driver
|
|
# int test(int);
|
|
# int main(void) { return test(0); }
|
|
# <<<
|