[LLVMdev] [Polly] Assert in Scope construction
Tobias Grosser
tobias at grosser.es
Thu Jul 4 19:40:54 PDT 2013
On 07/04/2013 07:20 PM, Hongbin Zheng wrote:
> Hi Sergei,
>
>
> On Thu, Jul 4, 2013 at 1:36 AM, Sergei Larin <slarin at codeaurora.org> wrote:
>
>> Should have changed the subject line...
>>
>> ---
>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
>> by
>> The Linux Foundation
>>
>>
>>> -----Original Message-----
>>> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
>>> On Behalf Of Sergei Larin
>>> Sent: Wednesday, July 03, 2013 12:29 PM
>>> To: 'Tobias Grosser'
>>> Cc: 'llvmdev'
>>> Subject: Re: [LLVMdev] [LNT] Question about results reliability in LNT
>>> infrustructure
>>>
>>>
>>> Tobias,
>>>
>>> I seem to trigger an assert in Polly lib/Analysis/TempScopInfo.cpp
>>>
>>> void TempScopInfo::buildAffineCondition(Value &V, bool inverted,
>>> Comparison **Comp) const { ...
>>> ICmpInst *ICmp = dyn_cast<ICmpInst>(&V);
>>> assert(ICmp && "Only ICmpInst of constant as condition supported!");
>> ...
>>>
>>> The code it chokes on looks like this (see below). The problem is this
>> OR-ed
>>> compare result:
>>>
>>> %cmp3 = icmp sgt i32 %j.0, 2
>>> %cmp5 = icmp eq i32 %j.0, 1
>>> %or.cond13 = or i1 %cmp3, %cmp5
>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ==
>>> Value V
>>>
>>>
>>> My question - is this a bug or a (missing) feature?
>
> I think it is a bug.
>
>
>> ...and how it should
>> be
>>> handled in theory?
>>
> Such condition should be filtered out by ScopDetection (line 188 of
> ScopDetection.cpp).
Hongbin is right. Running your test case gives:
$ polly-opt -polly-detect -analyze /tmp/test.ll -debug-only=polly-detect
Checking region: entry => <Function Return>
Top level region is invalid
Checking region: for.cond2 => for.end8
Condition in BB 'for.cond2' neither constant nor an icmp
instruction
Did you try this test case on the open source version of Polly? In case
you want to support this code in the open source version of Polly, the
way to go is pretty simple. You first enhance -polly-detect to allow
boolean operations like 'and' and 'or'. You then change TempScop and
ScopInfo to support those. The changes are pretty straightforward. You
just need to keep track of a list of conditions and then and/or the
conditions with isl when generating the iteration space.
Cheers,
Tobias
More information about the llvm-dev
mailing list