<div dir="ltr">I tend to agree. Probably still need to make sure that passing too large of an immediate to the software exposed intrinsics returns 0 instead of being undefined behavior since that is the instruction spec.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 12:53 PM, David Majnemer via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">majnemer added a subscriber: majnemer.<br>
<br>
================<br>
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:339-354<br>
@@ +338,18 @@<br>
+    return nullptr;<br>
+  case Intrinsic::x86_avx2_psrav_d:<br>
+  case Intrinsic::x86_avx2_psrav_d_256:<br>
+    LogicalShift = false;<br>
+    ShiftLeft = false;<br>
+    break;<br>
+  case Intrinsic::x86_avx2_psrlv_d:<br>
+  case Intrinsic::x86_avx2_psrlv_d_256:<br>
+  case Intrinsic::x86_avx2_psrlv_q:<br>
+  case Intrinsic::x86_avx2_psrlv_q_256:<br>
+    LogicalShift = true;<br>
+    ShiftLeft = false;<br>
+    break;<br>
+  case Intrinsic::x86_avx2_psllv_d:<br>
+  case Intrinsic::x86_avx2_psllv_d_256:<br>
+  case Intrinsic::x86_avx2_psllv_q:<br>
+  case Intrinsic::x86_avx2_psllv_q_256:<br>
+    LogicalShift = true;<br>
----------------<br>
Er, why do we even have these intrinsics?<br>
They seem sorta pointless, it seems way better to get rid of these and replace their use in clang's headers with a generic shift which sanitizes the shift amount.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D19675" rel="noreferrer" target="_blank">http://reviews.llvm.org/D19675</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>