DescriptionSubzero: Make optimizations more resilient for early Target development.
A good trick for implementing lowering for a new target is, for not-yet-implemented instructions, to insert a FakeUse of each instruction variable followed by a FakeDef of the dest variable. Otherwise one risks running afoul of liveness analysis integrity checks.
However, if all the high-level instructions in a basic block lack variables (e.g. unconditional branches, or void calls with only constant arguments), the resulting block may be completely empty. In O2 mode, this triggers a couple of assertions/errors that wouldn't normally occur:
1. CfgNode::contractIfEmpty() finds a block with a single out-edge that does *not* end with an unconditional branch.
2. CfgNode::livenessAddIntervals() tries to add a bogus liveness interval to a variable because the empty block contains no actual instruction numbers to form a valid interval from.
This adds some fixes/workarounds for those problems.
Another workaround for the empty basic block problem may be to just to add a FakeUse of the stack pointer when lowering an unconditional branch, which combined with the trick above, should prevent empty blocks. However, these fixes seem reasonable apart from that.
BUG= none
R=sehr@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=6f7ad6c28af7985b690d6e5b39bb916ba9e6333b
Patch Set 1 #
Messages
Total messages: 7 (4 generated)
|