[llvm] r251538 - [X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is simple before calling getSimpleVT().

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 11:21:51 PDT 2015


On Wed, Oct 28, 2015 at 11:15 AM, Cong Hou via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: conghou
> Date: Wed Oct 28 13:15:46 2015
> New Revision: 251538
>
> URL: http://llvm.org/viewvc/llvm-project?rev=251538&view=rev
> Log:
> [X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is
> simple before calling getSimpleVT().
>

Test case?


>
>
> Modified:
>     llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp?rev=251538&r1=251537&r2=251538&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp Wed Oct 28
> 13:15:46 2015
> @@ -895,8 +895,9 @@ int X86TTIImpl::getMaskedMemoryOpCost(un
>
>    // Legalize the type.
>    std::pair<int, MVT> LT = TLI->getTypeLegalizationCost(DL, SrcVTy);
> +  auto VT = TLI->getValueType(DL, SrcVTy);
>    int Cost = 0;
> -  if (LT.second != TLI->getValueType(DL, SrcVTy).getSimpleVT() &&
> +  if (VT.isSimple() && LT.second != VT.getSimpleVT() &&
>        LT.second.getVectorNumElements() == NumElem)
>      // Promotion requires expand/truncate for data and a shuffle for mask.
>      Cost += getShuffleCost(TTI::SK_Alternate, SrcVTy, 0, nullptr) +
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151028/b4cc7679/attachment-0001.html>


More information about the llvm-commits mailing list