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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 13:10:11 PDT 2016


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.

On Mon, May 16, 2016 at 12:53 PM, David Majnemer via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> majnemer added a subscriber: majnemer.
>
> ================
> 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;
> ----------------
> Er, why do we even have these intrinsics?
> 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.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D19675
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160516/79acfa46/attachment.html>


More information about the llvm-commits mailing list