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

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 11:40:38 PDT 2015


This small patch is extracted from http://reviews.llvm.org/D8943 and the
test case is also in that patch. As requested by hfinkel I commit this
small patch ahead of that larger one. Could you please take a look as that
patch? Thanks!


thanks,
Cong

On Wed, Oct 28, 2015 at 11:21 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> 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/8dfb05ad/attachment.html>


More information about the llvm-commits mailing list