<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2/24/2017 12:24 PM, Ilya Skapenko
via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:CALj6uP=p7Gno7pepOgnwubLtG2MUbyR=-z-6vtBaWgU3+dVw+g@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div>I decided to implement some of <a moz-do-not-send="true"
href="http://llvm.org/OpenProjects.html#compaction"
target="_blank">code compaction</a> passes. To start, I
chose basic block factoring out, suggested in <a
moz-do-not-send="true"
href="http://users.elis.ugent.be/%7Ebrdsutte/research/publications/2000TOPLASdebray.pdf"
target="_blank">article</a> (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?</div>
<div>Reference to the pass: <a moz-do-not-send="true"
href="https://github.com/skapix/codeCompaction"
target="_blank">https://github.com/<wbr>skapix/codeCompaction</a></div>
<div>It is my first project, connected to LLVM infrastructure, I
would appreciate any help.<br>
</div>
</div>
</blockquote>
<br>
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.<br>
<p>-Eli<br>
</p>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>