[PATCH][Polly] Re: 0001-Fixup-assert-fails-caused-by-incorrect-LoopInfo-update

Star Tan tanmx_star at yeah.net
Mon Sep 2 09:51:49 PDT 2013


At 2013-09-03 00:16:19,"Tobias Grosser" <tobias at grosser.es> wrote:>On 09/02/2013 08:30 AM, Star Tan wrote:
>> At 2013-09-02 16:34:24,"Tobias Grosser" <tobias at grosser.es> wrote:
>>
>>> On 09/01/2013 08:01 PM, Star Tan wrote:
>>>> At 2013-08-25 02:10:02,"Tobias Grosser" <tobias at grosser.es> wrote:
>>>>> On 08/23/2013 08:25 AM, Star Tan wrote:
>>>>>>    Hi all,
>>>>>>
>>>>>>
>>>>>>    I have attached a patch file to fix up the CodeGen assert fail, which is also reported in a recent bug  http://llvm.org/bugs/show_bug.cgi?id=16944
>>>>>
>>>>> Hi Star Tan,
>>>>>
>>>>> thanks for looking into this bug. The patch itself looks good and the
>>>>> testcase is nicely small.
>>>>>
>>>>> However, when running the test with 'opt' I get:
>>>>>
>>>>> PHINode should have one entry for each predecessor of its parent basic
>>>>> block!
>>>>>      %indvar = phi i64 [ 0, %entry ], [ %0, %for.inc ]
>>>>>
>>>>> So the IR in the test case itself is already incorrect.
>>>>
>>>> Sorry for the stupid mistake. I have attached a new patch file!
>>>
>>> Great. This one looks correct.
>>>
>>>> Also, I am a little unhappy with the fact that we need to run
>>>>
>>>>> -polly-opt-isl to reproduce this bug. I would very much prefer to find a
>>>>> test case that only runs 'opt %loadPolly -polly-codegen  < %s'. This ensures
>>>>> that changes in -polly-opt-isl can not accidentally stop this test case
>>>>> from testing the code path you fixed in this patch.
>>>>
>>>> Yes, you are right. But it seems difficult to construct a testcase that will show this bug using only "opt %loadPolly -polly-codegen".
>>>> Our testcase fails with the following command:
>>>> $ opt %loadPolly -basicaa -polly-opt-isl -polly-codegen test.ll
>>>>
>>>> but it works well with the following commands:
>>>> $ opt %loadPolly -basicaa -polly-opt-isl -S -o test_1.ll test.ll
>>>> $ opt %loadPolly -basicaa -polly-codegen test_1.ll
>>>>
>>>> The key of producing the bug is to construct a stmt_guard statment, so it will call codegen((clast_guard *)). Preliminary investigation shows that the  'stmt_guard' occurs only if we run opt-isl before codegen.  Sorry I have not found such a testcase by now.
>>>
>>> I just looked into this and I could also not find a trivial test case
>>> that yields a guard statement. However, you can use
>>>
>>> opt -polly-opt-isl -polly-export-jscop
>>>
>>> to get a jscop file and the use opt -polly-import-jscop to read in this
>>> jscop file instead of running polly-opt-isl. This at least removes the
>>> dependency on the isl scheduler.
>>>
>>> test/Cloog/CodeGen/simple_vec_stride_one.ll
>>>
>>> The above test case should give an example how to use the import/export
>>> of jscops.
>>
>> Thank you so much for your very helpful suggestion.  Yes, Jscop is a very help tool~
>> I have attached a new patch file that reads Jscop file to avoid dependence to polly-opt-isl.
>
>Great. This one looks perfect. I committed it in r189764.
>
>Please feel free to close the related bug reports.
>
>Cheers,
>Tobias

Thank you. I have closed the bug 16944.

Star
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130903/104ea43a/attachment.html>


More information about the llvm-commits mailing list