On 2/24/2017 12:24 PM, Ilya Skapenko via llvm-dev wrote:> Hello,
> I decided to implement some of code compaction
> <http://llvm.org/OpenProjects.html#compaction> passes. To start, I
> chose basic block factoring out, suggested in article
>
<http://users.elis.ugent.be/%7Ebrdsutte/research/publications/2000TOPLASdebray.pdf>
(Section
> 3.3). Unlike the article, I implemented procedural abstraction for
> basic blocks on LLVM-IR level (probably it was not the best choice)
> and faced a problem: Is there any efficient way to determine, what
> size will instruction take in some particular architecture?
> Reference to the pass: https://github.com/skapix/codeCompaction
> <https://github.com/skapix/codeCompaction>
> It is my first project, connected to LLVM infrastructure, I would
> appreciate any help.
llvm/Analysis/CodeMetrics.h is what the inliner/unroller/etc. use to
estimate cost. It's not particularly precise, but it's good enough for
most purposes.
-Eli
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
Foundation Collaborative Project
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20170224/3583a323/attachment.html>