[PATCH] D73674: Propeller: LLVM support for basic block sections (Base Patch - Part 2)

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 10:03:12 PST 2020


tmsriram marked 3 inline comments as done.
tmsriram added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBasicBlock.cpp:73
+    // compress the symbol names significantly.  The basic blocks for function
+    // foo are named a.BB.foo, aa.BB.foo, and so on.
+    if (BasicBlockSymbols) {
----------------
davidxl wrote:
> Is this the best encoding scheme?  I suppose in many cases, a single byte is enough? (e.g. total number of blocks in a func is small). Or this allows better string compression?
This works great for ".strtab" size and we tried a few other simple encoding schemes like "1.BB", "2.BB", etc.   While the simple encoding schemes are small, what we have is much smaller.  The ".strtab" bloat even when turned on for all basic blocks is only 8%.    The symtab bloat remains the same irrespective of the encoding.  Please note that symtab and strtab are not ALLOCed and do not affect performance.


================
Comment at: llvm/test/CodeGen/X86/basicblock-sections-eh.ll:84
+;LINUX-SECTIONS: .section	.text._Z3foob.eh,"ax", at progbits
+;LINUX-SECTIONS: l{{[a|r]*}}.BB._Z3foob:
----------------
davidxl wrote:
> Make test more strict to test landing pad blocks are in the same section?
The character "l" denotes if this is a landing pad or not.  Here there is only one.  I can modify it to have more landing pads.


================
Comment at: llvm/test/CodeGen/X86/basicblock-sections-listbb.ll:35
+; LINUX-SECTIONS-NOT: .section        .text._Z3bazb.r.BB._Z3bazb,"ax", at progbits,unique
+; LINUX-SECTIONS: r.BB._Z3bazb:
+; LINUX-SECTIONS: .section        .text._Z3bazb.rr.BB._Z3bazb,"ax", at progbits,unique
----------------
davidxl wrote:
> how to tell if this is the id 2 section?
The id is the count of the number of characters before ".BB".  For instance, this is "r.BB._Z3bazb" and is the "id 1" basic block.  That's why we explicitly check in the line before that this does not get a section.  The entry block is "id 0'.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73674/new/

https://reviews.llvm.org/D73674





More information about the llvm-commits mailing list