<div dir="ltr">I vaguely remember having the same problem... Removing [IntrNoMem] on the intrinsic fixed it.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 2:12 PM, reed kotler <span dir="ltr"><<a href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This problem was reported to me by a friend who has an LLVM port that is not put back to open source.<br>
<br>
Essentially, there is an intrinsic call _lr which is a load register.<br>
<br>
so then user code has something like:<br>
<br>
start_time = _lr(TIMER_REGISTER)<br>
.....<br>
some_code_to_time<br>
....<br>
end_time = _lr(TIMER_REGISTER)<br>
<br>
So what happens is that LLVM moves the code as follows:<br>
<br>
<br>
<br>
start_time = _lr(TIMER_REGISTER)<br>
end_time = _lr(TIMER_REGISTER)<br>
.....<br>
some_code_to_time<br>
......<br>
<br>
How would this intrinsic be implemented properly in llvm so this cannot happen?<br>
<br>
TIA.<br>
<br>
Reed<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>