DescriptionSubzero: Fix labels for block profiling.
The problem is that the block profiling pass runs at the very beginning and commits to particular label strings, but the actual label names might change by emission time because of node reordering.
There was actually something of a workaround - given a label string from the profile output, inspect the *profiled* asm code and search for the block containing the increment of the counter location, as the name of the counter location label is related to the label string in the profile output. However, it's tedious to mentally filter out the counter update code, and the counter update code has a huge impact on register allocation.
The solution is to use a persistent number in CfgNode for constructing the label string, which doesn't change when the nodes are reordered.
One note (independent of this change): Without block profiling, empty basic blocks are deleted and don't appear in the asm output. But with block profiling, these blocks are never empty because they contain profile update instructions. This means the profile output may contain labels that don't exist in the non-profiled asm.
Another note: New nodes created as a result of edge splitting from advanced phi lowering are not profiled.
BUG= none
R=ascull@google.com, jpp@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=e7dbc0bcab159a2c64d7d8dff746d273bf80fa36
Patch Set 1 #
Total comments: 2
Patch Set 2 : Code review changes #
Messages
Total messages: 8 (1 generated)
|