[llvm] r312088 - [TableGen] Fix a range based for loop to take the value by reference so that SimplifyTree can modify the copy in the array if its needs to.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 10:38:33 PDT 2017


I hit this issue in D37286 where depending on the types, some of the
patterns start with a unnecessary bitconvert that SimplfiyTree is trying to
skip over. So it is currently being tested by the x86 backend.

I can try to write a unit test if you want. I've not really looked much at
our existing TableGen tests before.

~Craig

On Mon, Sep 4, 2017 at 10:22 AM, David Blaikie via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> No chance of a test case for this, I take it?
>
> On Tue, Aug 29, 2017 at 7:06 PM Craig Topper via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: ctopper
>> Date: Tue Aug 29 19:05:03 2017
>> New Revision: 312088
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=312088&view=rev
>> Log:
>> [TableGen] Fix a range based for loop to take the value by reference so
>> that SimplifyTree can modify the copy in the array if its needs to.
>>
>> Modified:
>>     llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
>>
>> Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
>> TableGen/CodeGenDAGPatterns.cpp?rev=312088&r1=312087&r2=312088&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)
>> +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Tue Aug 29 19:05:03
>> 2017
>> @@ -2304,7 +2304,7 @@ InferAllTypes(const StringMap<SmallVecto
>>    bool MadeChange = true;
>>    while (MadeChange) {
>>      MadeChange = false;
>> -    for (TreePatternNode *Tree : Trees) {
>> +    for (TreePatternNode *&Tree : Trees) {
>>        MadeChange |= Tree->ApplyTypeConstraints(*this, false);
>>        MadeChange |= SimplifyTree(Tree);
>>      }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
> _______________________________________________
> 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/20170904/b91fcf4c/attachment.html>


More information about the llvm-commits mailing list