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 thisOR-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? ...and how it shouldbe> handled in theory? > > Thanks. > > Sergei > > define i32 @main() #0 { > entry: > %j.0.lcssa.reg2mem = alloca i32, align 8 > br label %entry.split > > entry.split: ; preds = %entry > %call = tail call i32 @foo(i32 0, i32 0) #2 > %call1 = tail call i32 @foo(i32 %call, i32 %call) #2 > br label %for.cond2 > > for.cond2: ; preds = %for.inc, > %entry.split > %j.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.inc ] > %cmp3 = icmp sgt i32 %j.0, 2 > %cmp5 = icmp eq i32 %j.0, 1 > %or.cond13 = or i1 %cmp3, %cmp5 > store i32 %j.0, i32* %j.0.lcssa.reg2mem, align 8 > br i1 %or.cond13, label %for.end8, label %for.inc, > !llvm.listen.preserve.while.opt !0 > > for.inc: ; preds = %for.cond2 > %inc = add nsw i32 %j.0, 1 > br label %for.cond2 > > for.end8: ; preds = %for.cond2 > %j.0.lcssa.reload = load i32* %j.0.lcssa.reg2mem, align 8 > %cmp10 = icmp eq i32 %j.0.lcssa.reload, 1 > %add = add nsw i32 %j.0.lcssa.reload, 1 > %retval.0 = select i1 %cmp10, i32 1, i32 %add > ret i32 %retval.0 > } > > > --- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > hosted by The Linux Foundation > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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). Thanks Hongbin> > > Thanks. > > > > Sergei > > > > define i32 @main() #0 { > > entry: > > %j.0.lcssa.reg2mem = alloca i32, align 8 > > br label %entry.split > > > > entry.split: ; preds = %entry > > %call = tail call i32 @foo(i32 0, i32 0) #2 > > %call1 = tail call i32 @foo(i32 %call, i32 %call) #2 > > br label %for.cond2 > > > > for.cond2: ; preds = %for.inc, > > %entry.split > > %j.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.inc ] > > %cmp3 = icmp sgt i32 %j.0, 2 > > %cmp5 = icmp eq i32 %j.0, 1 > > %or.cond13 = or i1 %cmp3, %cmp5 > > store i32 %j.0, i32* %j.0.lcssa.reg2mem, align 8 > > br i1 %or.cond13, label %for.end8, label %for.inc, > > !llvm.listen.preserve.while.opt !0 > > > > for.inc: ; preds = %for.cond2 > > %inc = add nsw i32 %j.0, 1 > > br label %for.cond2 > > > > for.end8: ; preds = %for.cond2 > > %j.0.lcssa.reload = load i32* %j.0.lcssa.reg2mem, align 8 > > %cmp10 = icmp eq i32 %j.0.lcssa.reload, 1 > > %add = add nsw i32 %j.0.lcssa.reload, 1 > > %retval.0 = select i1 %cmp10, i32 1, i32 %add > > ret i32 %retval.0 > > } > > > > > > --- > > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > > hosted by The Linux Foundation > > > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130705/309413b1/attachment.html>
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
Possibly Parallel Threads
- [LLVMdev] [Polly] Assert in Scope construction
- [LLVMdev] [LNT] Question about results reliability in LNT infrustructure
- [LLVMdev] [LNT] Question about results reliability in LNT infrustructure
- [LLVMdev] [Polly] Analysis of extra compile-time overhead for simple nested loops
- [LLVMdev] [Polly] Analysis of extra compile-time overhead for simple nested loops