<div dir="ltr">Opps, the IR is <div><br></div><div><div style="font-size:14px">  %2 = call i32 @llvm.foo(i32 %a, i32 1)</div><div style="font-size:14px">  %3 = call i32 @_Z5func2ii(i32 %b, i32 %2)</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-01 15:59 GMT-05:00 Xiangyang Guo <span dir="ltr"><<a href="mailto:eceguo@gmail.com" target="_blank">eceguo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Actually, no such information is attached to "func2". <div><br></div><div>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<span class=""><div><br></div><div><div style="font-size:14px"> %2 = call i32 @llvm.foo(i32 %a, i32 1)</div><div style="font-size:14px"> %3 = call i32 @_Z5func2ii(i32 %b, i32 %2)</div></div></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-12-01 15:51 GMT-05:00 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 1 December 2015 at 12:33, Xiangyang Guo via llvm-dev<br>
<span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> if I have the following IR, LICM doesn't work again, even if I use<br>
> '-loop-rotate' firstly. In this IR, the return value of intrinsic function<br>
> "foo" is used by another function "func2" as parameter.  However, for the<br>
> intrinsic function "foo", the parameters are still loop invariant. Do you<br>
> know why this happens? Thanks a lot.<br>
<br>
</span>Is there anything telling LLVM that func2 won't write to memory and<br>
change the value returned by llvm.foo?<br>
<br>
Cheers.<br>
<span><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>