compiler: Optimize renaming in SSA a little more.
authorTyler J. Stachecki <stachecki.tyler@gmail.com>
Sun, 23 Apr 2017 14:03:10 +0000 (10:03 -0400)
committerTyler J. Stachecki <stachecki.tyler@gmail.com>
Sun, 23 Apr 2017 14:03:10 +0000 (10:03 -0400)
commit06d1a523c5a81f0b5c381f2e2194b153ce206636
tree7c79f493754723cccf827c7caabf046c14df5cbe
parentdbf2022c1121b5eb57070d4b051231e704f71f8f
compiler: Optimize renaming in SSA a little more.

When populating phi nodes in immediate successors, we can
break out of the loop when scanning for our predecessor
index early (the compiler can't do this for us, as it does
not know that we're the only basic block in the list).

Also, augment the stack_top method so that it returns a
value if the stack does not currently have any items. In
most cases, this would be NULL... however, we can save a
conditional branch in mosts cases if it's not.

Signed-off-by: Tyler J. Stachecki <stachecki.tyler@gmail.com>
compiler/passes/ssa_conversion.c
compiler/stack.c
compiler/stack.h