Subzero: Change -asm-verbose output to print more useful info.
Frame offsets for variables are emitted using a symbolic name based on the variable's name. This makes it a bit easier to digest the asm code.
For example, if variable Foo gets an esp offset 24, asm like this:
... 24(%esp) ...
will instead be emitted like this:
lv$Foo = 24
...
... lv$Foo(%esp) ...
Predecessor labels are printed for each basic block.
Loop nest depth is printed for each basic block. (Would be nice if we had loop header info as well.)
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/1377323002 .
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index eaebd1e..d89fa49 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -743,6 +743,14 @@
emitTextHeader(MangledName, Ctx, Asm);
deleteJumpTableInsts();
+ if (Ctx->getFlags().getDecorateAsm()) {
+ for (Variable *Var : getVariables()) {
+ if (Var->getStackOffset()) {
+ Str << "\t" << Var->getSymbolicStackOffset(this) << " = "
+ << Var->getStackOffset() << "\n";
+ }
+ }
+ }
for (CfgNode *Node : Nodes) {
if (NeedSandboxing && Node->needsAlignment()) {
Str << "\t" << Asm->getAlignDirective() << " "