<div dir="ltr"><div>Huh, that appears to do it - preventing `noinline` from showing up on defined functions. Thanks.<br><br></div>Out of curiosity, what does that do? And what changed to require this?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 1:47 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
<div class="m_4335446004089132090moz-cite-prefix">On 5/19/2017 12:42 PM, Matthew O'Connor
via llvm-dev wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>All,<br>
<br>
I'm in the process of upgrading an LLVM client from using
3.8 to using 4.0 and am running into the following issue:<br>
<br>
</div>
<span style="font-family:monospace,monospace">// compile with:<br>
// clang++ -std=c++11 -Wno-c++14-extensions -S -emit-llvm<br>
// ~/chrono.cpp -o chrono.ll<br>
#include <chrono><br>
#include <ratio><br>
#include <thread><br>
using namespace std;<br>
using namespace std::chrono;<br>
<br>
using tick = ratio<1, 300>;<br>
using tick_duration = duration<long, tick>;<br>
<br>
class ticking_clock {<br>
public:<br>
using duration = tick_duration;<br>
using rep = duration::rep;<br>
using period = duration::period;<br>
using time_point = time_point<ticking_clock,
duration>;<br>
static constexpr bool is_steady = true;<br>
<br>
static time_point now() noexcept;<br>
};<br>
<br>
void f(long &elapsed_time) {<br>
auto start = ticking_clock::now();<br>
this_thread::sleep_for(tick_<wbr>duration(71));<br>
auto finish = ticking_clock::now();<br>
auto dur = finish - start;<br>
elapsed_time = dur.count();<br>
}</span><br>
<br>
</div>
<div>The functions defined in the resultant IR are marked
`noinline` in 4.0 but do not have that same attribute in 3.8.
Running the unoptimized IR through `opt -O2 <chrono.ll -S
>chrono.opt.ll` produces the expected 6 line function in
3.8 but does no inlining in 4.0 (respecting the attribute).<br>
</div>
<div><br>
</div>
<div>This appears to be a large change from where `clang++ -O2`
was roughly equal to `clang++ -O0 | opt -O2` in 3.8 but is not
in 4.0.<br>
<br>
</div>
<div>Is there a way to obtain that previous functionality in
4.0?</div>
</div>
</blockquote>
<br></div></div>
Try "-O2 -Xclang -disable-llvm-passes".<span class="HOEnZb"><font color="#888888"><br>
<p>-Eli<br>
</p>
<pre class="m_4335446004089132090moz-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>
</font></span></div>
</blockquote></div><br></div>