[LLVMdev] interesting LLVM code optimization issue regarding timer registers
Francois Pichet
pichet2000 at gmail.com
Fri Feb 21 11:22:23 PST 2014
I vaguely remember having the same problem... Removing [IntrNoMem] on the
intrinsic fixed it.
On Fri, Feb 21, 2014 at 2:12 PM, reed kotler <rkotler at mips.com> wrote:
> This problem was reported to me by a friend who has an LLVM port that is
> not put back to open source.
>
> Essentially, there is an intrinsic call _lr which is a load register.
>
> so then user code has something like:
>
> start_time = _lr(TIMER_REGISTER)
> .....
> some_code_to_time
> ....
> end_time = _lr(TIMER_REGISTER)
>
> So what happens is that LLVM moves the code as follows:
>
>
>
> start_time = _lr(TIMER_REGISTER)
> end_time = _lr(TIMER_REGISTER)
> .....
> some_code_to_time
> ......
>
> How would this intrinsic be implemented properly in llvm so this cannot
> happen?
>
> TIA.
>
> Reed
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140221/35cbad67/attachment.html>
More information about the llvm-dev
mailing list