<div dir="ltr"><div>What do we want do with masking of the amount on this proposed intrinsic. Do we need an explicit AND to keep it in bounds? X86 can delete the AND during isel since the hardware is well behaved for out of range values. Hardware only masks to 5-bits for 8/16 bit rotates for the purpose of flags, but the data will be modulo the bit width. Since we don't use the flags from rotates we can remove the mask. But if the mask is explicit in IR, then LICM might hoist it and isel won't see it to remove it.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 16, 2018 at 1:21 PM John Regehr via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 5/16/18 1:58 PM, Sanjay Patel via llvm-dev wrote:<br>
<br>
> An informal metric might be: if the operation is supported as a <br>
> primitive op or built-in in source languages and it is supported as a <br>
> single target instruction, can we guarantee that 1-to-1 translation <br>
> through optimization?<br>
<br>
It seems perfectly reasonable for LLVM users to expect this to happen <br>
reliably.<br>
<br>
I'd like to take a look at the other side of the equation: the cost of <br>
adding a new intrinsic in terms of teaching passes to see through it, so <br>
we don't lose optimizations that worked before the intrinsic was added.<br>
<br>
For example, clearly ValueTracking needs a few lines added so that <br>
computeKnownBits and friends don't get stopped by a rotate. Anyone have <br>
a reasonably complete list of files that need similar changes?<br>
<br>
John<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>