[llvm-dev] LICM doesn't work for IntrReadMem intrinsic function

Xiangyang Guo via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 12:59:20 PST 2015


Actually, no such information is attached to "func2".

For the following IR, if "func2" can only access the memory related to the
first parameter "%b" and it will not change the value related to second
parameter "%2", do you know how I can tell LLVM these information? And if I
can do this, probably the LICM will work for llvm.foo? Thanks

 %2 = call i32 @llvm.foo(i32 %a, i32 1)
 %3 = call i32 @_Z5func2ii(i32 %b, i32 %2)

2015-12-01 15:51 GMT-05:00 Tim Northover <t.p.northover at gmail.com>:

> On 1 December 2015 at 12:33, Xiangyang Guo via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > if I have the following IR, LICM doesn't work again, even if I use
> > '-loop-rotate' firstly. In this IR, the return value of intrinsic
> function
> > "foo" is used by another function "func2" as parameter.  However, for the
> > intrinsic function "foo", the parameters are still loop invariant. Do you
> > know why this happens? Thanks a lot.
>
> Is there anything telling LLVM that func2 won't write to memory and
> change the value returned by llvm.foo?
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151201/ff1931ac/attachment.html>


More information about the llvm-dev mailing list