[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 12:00:00 PDT 2015


On Wed, Oct 28, 2015 at 11:58 AM, Cong Hou <congh at google.com> wrote:

> On Wed, Oct 28, 2015 at 11:52 AM, David Blaikie <dblaikie at gmail.com>
> wrote:
>
>>
>>
>> On Wed, Oct 28, 2015 at 11:40 AM, Cong Hou <congh at google.com> wrote:
>>
>>> 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!
>>>
>>
>> Does this small patch change any observable behavior? Or is it
>> generalizing/fixing some dormant code path to make it compatible with the
>> larger change? If it's fixing an existing issue, a test should go along
>> with it.
>>
>
> The bug will be exposed with the patch that hasn't been checked in, so I
> could not find a case that will fail now. It seems it won't change any
>  observable behavior now. So I think it is fixing a dormant code path for
> larger change.
>

OK, no worries. Thanks for the explanation!


>
> Cong
>
>
>>
>>
>>>
>>>
>>> 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/b841036d/attachment.html>


More information about the llvm-commits mailing list