D129370 introduced the idea that hoisting could skip over non-matching
instructions and continue to look for matching (hoistable) instructions,
but certain types of mismatch still aborted the whole hoisting attempt.
Fix this by splitting out some of the instruction matching checks into a
helper function.
Also forbid hoisting allocas past stacksave/stackrestore, completing the
fix started in D133730, to avoid regressing tests.
This looks wrong since this alloca was hoisted past a stacksave. D133730 was supposed to prevent this, according to its description, but in fact it only seems to prevent the converse: hoisting a stacksave past an alloca. @aeubanks