[PATCH] D19675: [InstCombine][AVX2] Add support for simplifying AVX2 per-element shifts to native shifts

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 09:44:15 PDT 2016


RKSimon added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:339-354
@@ +338,18 @@
+    return nullptr;
+  case Intrinsic::x86_avx2_psrav_d:
+  case Intrinsic::x86_avx2_psrav_d_256:
+    LogicalShift = false;
+    ShiftLeft = false;
+    break;
+  case Intrinsic::x86_avx2_psrlv_d:
+  case Intrinsic::x86_avx2_psrlv_d_256:
+  case Intrinsic::x86_avx2_psrlv_q:
+  case Intrinsic::x86_avx2_psrlv_q_256:
+    LogicalShift = true;
+    ShiftLeft = false;
+    break;
+  case Intrinsic::x86_avx2_psllv_d:
+  case Intrinsic::x86_avx2_psllv_d_256:
+  case Intrinsic::x86_avx2_psllv_q:
+  case Intrinsic::x86_avx2_psllv_q_256:
+    LogicalShift = true;
----------------
This would work for the SSE2/AVX2 shift by immediate intrinsics (_mm_slli_epi32 etc.) but not for the AVX2 variable shifts being discussed here. I'm happy to deal with those in another patch.


Repository:
  rL LLVM

http://reviews.llvm.org/D19675





More information about the llvm-commits mailing list