[polly] r297147 - [tests] Make sure tests do not end in 'unreachable'

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 08:47:30 PST 2017


On Tue, Mar 7, 2017, at 04:52 PM, Michael Kruse via llvm-commits wrote:
> Hi Tobias,
> 
> can you elaborate how/when in Polly `unreachable` and `ret` makes a
> difference?

Hi Michael,

I just read your email. I should have probably explained this a little
better in the commit message. This was the first set of patches.
Subsequent patches (r297151) prevent Polly from detecting scops that end
in unreachables to reduce compile time and to ensure that bugpoint does
not move towards such cases. This is useful by itself, but makes Polly
also less sensitive to changes in the post-dominator construction
algorithm that I currently discuss with Daniel Berlin on the LLVM
commits mailing list. While working with (variations of) his patches, I
had to test with Polly and wanted to make sure the test results really
highlight the important differences rather than noise that arose due to
different handling of unreachables.

I pushed these patches immediately as they touch mostly parts that I
feel very comfortable with and the patches do not change any fundamental
design we have taken earlier. However, please feel very much invited to
provide post-commit reviews! Your comments are always very helpful and
consequently very much appreciated.

Best,
Tobias

> 
> Michael
> 
> 
> 2017-03-07 16:17 GMT+01:00 Tobias Grosser via llvm-commits
> <llvm-commits at lists.llvm.org>:
> > Author: grosser
> > Date: Tue Mar  7 09:17:23 2017
> > New Revision: 297147
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=297147&view=rev
> > Log:
> > [tests] Make sure tests do not end in 'unreachable'
> >
> > There is no point in optimizing unreachable code, hence our test cases should
> > always return.
> >
> > This commit is part of a series that makes Polly more robust on the presence of
> > unreachables.
> >
> > Modified:
> >     polly/trunk/test/GPGPU/remove-dead-instructions-in-stmt-2.ll
> >     polly/trunk/test/Isl/CodeGen/20120403-RHS-type-mismatch.ll
> >     polly/trunk/test/Isl/CodeGen/OpenMP/reference-argument-from-non-affine-region.ll
> >     polly/trunk/test/ScopInfo/memcpy-raw-source.ll
> >     polly/trunk/test/ScopInfo/parameter_with_constant_factor_in_add.ll
> >
> > Modified: polly/trunk/test/GPGPU/remove-dead-instructions-in-stmt-2.ll
> > URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/GPGPU/remove-dead-instructions-in-stmt-2.ll?rev=297147&r1=297146&r2=297147&view=diff
> > ==============================================================================
> > --- polly/trunk/test/GPGPU/remove-dead-instructions-in-stmt-2.ll (original)
> > +++ polly/trunk/test/GPGPU/remove-dead-instructions-in-stmt-2.ll Tue Mar  7 09:17:23 2017
> > @@ -35,5 +35,5 @@ for.end:
> >    br label %for.cond1.loopexit
> >
> >  for.inc55:                                        ; preds = %for.cond1.loopexit
> > -  unreachable
> > +  ret void
> >  }
> >
> > Modified: polly/trunk/test/Isl/CodeGen/20120403-RHS-type-mismatch.ll
> > URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/20120403-RHS-type-mismatch.ll?rev=297147&r1=297146&r2=297147&view=diff
> > ==============================================================================
> > --- polly/trunk/test/Isl/CodeGen/20120403-RHS-type-mismatch.ll (original)
> > +++ polly/trunk/test/Isl/CodeGen/20120403-RHS-type-mismatch.ll Tue Mar  7 09:17:23 2017
> > @@ -22,5 +22,5 @@ for.body7:
> >    br i1 false, label %for.body7, label %for.end18
> >
> >  for.end18:                                        ; preds = %for.body7
> > -  unreachable
> > +  ret void
> >  }
> >
> > Modified: polly/trunk/test/Isl/CodeGen/OpenMP/reference-argument-from-non-affine-region.ll
> > URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/OpenMP/reference-argument-from-non-affine-region.ll?rev=297147&r1=297146&r2=297147&view=diff
> > ==============================================================================
> > --- polly/trunk/test/Isl/CodeGen/OpenMP/reference-argument-from-non-affine-region.ll (original)
> > +++ polly/trunk/test/Isl/CodeGen/OpenMP/reference-argument-from-non-affine-region.ll Tue Mar  7 09:17:23 2017
> > @@ -16,7 +16,7 @@ for.cond.463.preheader:
> >    br label %for.cond.499.preheader
> >
> >  for.cond.533.preheader:                           ; preds = %for.inc.530
> > -  unreachable
> > +  ret void
> >
> >  for.cond.499.preheader:                           ; preds = %for.inc.530, %for.cond.463.preheader
> >    %indvars.iv140 = phi i64 [ 0, %for.cond.463.preheader ], [ %indvars.iv.next141, %for.inc.530 ]
> >
> > Modified: polly/trunk/test/ScopInfo/memcpy-raw-source.ll
> > URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/memcpy-raw-source.ll?rev=297147&r1=297146&r2=297147&view=diff
> > ==============================================================================
> > --- polly/trunk/test/ScopInfo/memcpy-raw-source.ll (original)
> > +++ polly/trunk/test/ScopInfo/memcpy-raw-source.ll Tue Mar  7 09:17:23 2017
> > @@ -50,7 +50,7 @@ for.body74:
> >    br i1 %exitcond57, label %for.body74, label %for.inc104
> >
> >  for.inc104:                                       ; preds = %for.body74
> > -  unreachable
> > +  ret void
> >  }
> >
> >  attributes #0 = { argmemonly nounwind }
> >
> > Modified: polly/trunk/test/ScopInfo/parameter_with_constant_factor_in_add.ll
> > URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/parameter_with_constant_factor_in_add.ll?rev=297147&r1=297146&r2=297147&view=diff
> > ==============================================================================
> > --- polly/trunk/test/ScopInfo/parameter_with_constant_factor_in_add.ll (original)
> > +++ polly/trunk/test/ScopInfo/parameter_with_constant_factor_in_add.ll Tue Mar  7 09:17:23 2017
> > @@ -41,7 +41,7 @@ for.body276:
> >    br i1 false, label %for.body276, label %for.end291
> >
> >  for.end291:                                       ; preds = %for.body276
> > -  unreachable
> > +  ret void
> >
> >  for.inc299:                                       ; preds = %for.cond261.preheader
> >    %indvars.iv.next190 = add i64 %indvars.iv189, %2
> >
> >
> > _______________________________________________
> > 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


More information about the llvm-commits mailing list