[LLVMdev] [RFC] Somewhat unrelated code in lib/MC

Jim Grosbach grosbach at apple.com
Mon Jun 30 16:03:27 PDT 2014


Hi Rafael,

There have been a few attempts to do CFG (and more) analysis up from MC. Getting disassembly annotations is one of the interesting use cases, to be sure, but it There’s nothing intrinsically linking the logic to disassembly other than that being the most common source from which one would want to do this sort of reverse compilation sort of analysis. There’s no inherent reason I know of to not split it out into something separate. Looks like it’ll be a nontrivial win for code size, too.

-Jim

> On Jun 28, 2014, at 10:25 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> Now with a compressed patch. Sorry for the duplication.
> 
> Working on another patch I noticed quiet a bit of code in lib/MC that
> uses MC types, but is not used by MC itself or by any MC clients other
> than llvm-objdump.
> 
> As an experiment to see how big this was, I created a MC2 library
> (patch attached).  The results are interesting. In a Release+Asserts
> shared build I get
> 
> 811464 lib/libLLVMMC.so
> 272296 lib/libLLVMMCParser.so
> 152744 lib/libLLVMMC2.so
> 61248  lib/libLLVMMCJIT.so
> 22008  lib/libLLVMMCDisassembler.so
> 
> Note how the new library is the third largest.
> 
> Now, what is this code? From the the commit messages it looks like it
> is for "fancy" disassembly with CFG reconstruction. Is it
> complementary to the existing MCDisassembler library? Should the code
> be moved there instead? Should we have a MCDisassemblerCFG library?
> 
> Splitting this library would also make it trivial to remove the MC ->
> Object dependency.
> 
> Cheers,
> Rafael
> <t.patch.bz2>_______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list