[polly] r219131 - [Fix] Dead statements should not confuse the RTC generation
Tobias Grosser
tobias at grosser.es
Tue Oct 7 10:01:03 PDT 2014
On 07/10/2014 17:16, Johannes Doerfert wrote:
> I don't know why this happens but the assertion is not crucial, thus we
> could just apply the attached patch.
>
> Thoughts?
The patch seems to ignore alias groups with one element. As far as I
understand those should not have been computed in the first place. I
would prefer to understand why they are computed and avoid computing
them, if possible. I reduced you a test case. Maybe this helps to
understand the bug:
polly-opt -basicaa -polly-scops -polly-code-generator=isl out4.ll -analyze
opt:
/home/grosser/Projects/polly/git/tools/polly/lib/Analysis/ScopInfo.cpp:1300:
bool polly::Scop::buildAliasGroups(llvm::AliasAnalysis &): Assertion
`AG.size() > 1 && "Alias groups should contain at least two accesses"'
failed.
Cheers,
Tobias
-------------- next part --------------
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@dct_luma_16x16.M4 = external global [4 x [4 x i32]], align 16
@dct_luma_16x16.M5 = external global [4 x i32], align 16
@dct_luma_16x16.M0 = external global [4 x [4 x [4 x [4 x i32]]]], align 16
define void @dct_luma_16x16() {
.preheader29.preheader: ; preds = %.split
br label %.preheader29
.preheader29: ; preds = %bb12, %.preheader29.preheader
%indvar253 = phi i64 [ %tmp13, %bb12 ], [ 0, %.preheader29.preheader ]
br label %.preheader28
.preheader28: ; preds = %bb10, %.preheader29
%indvar255 = phi i64 [ 0, %.preheader29 ], [ %tmp11, %bb10 ]
br label %bb6
bb6: ; preds = %bb6, %.preheader28
%indvar250 = phi i64 [ 0, %.preheader28 ], [ %tmp, %bb6 ]
%scevgep263 = getelementptr [4 x [4 x i32]]* @dct_luma_16x16.M4, i64 0, i64 %indvar250, i64 1
store i32 undef, i32* %scevgep263, align 4
%tmp = add i64 %indvar250, 1
%exitcond126 = icmp eq i64 %tmp, 4
br i1 %exitcond126, label %.preheader27.preheader, label %bb6
.preheader27.preheader: ; preds = %bb6
br label %.preheader27
.preheader27: ; preds = %.preheader27, %.preheader27.preheader
%indvar265 = phi i64 [ %tmp9, %.preheader27 ], [ 0, %.preheader27.preheader ]
%scevgep268 = getelementptr [4 x [4 x i32]]* @dct_luma_16x16.M4, i64 0, i64 0, i64 %indvar265
%tmp7 = load i32* %scevgep268, align 4
%tmp8 = add nsw i32 undef, %tmp7
store i32 %tmp8, i32* getelementptr inbounds ([4 x i32]* @dct_luma_16x16.M5, i64 0, i64 0), align 16
%tmp9 = add i64 %indvar265, 1
%exitcond135 = icmp eq i64 %tmp9, 4
br i1 %exitcond135, label %bb10, label %.preheader27
bb10: ; preds = %.preheader27
%tmp11 = add i64 %indvar255, 1
%exitcond144 = icmp eq i64 %tmp11, 4
br i1 %exitcond144, label %bb12, label %.preheader28
bb12: ; preds = %bb10
%tmp13 = add i64 %indvar253, 1
%exitcond159 = icmp eq i64 %tmp13, 4
br i1 %exitcond159, label %.preheader25.preheader, label %.preheader29
.preheader25.preheader: ; preds = %bb12
br label %.preheader25
.preheader25: ; preds = %bb16, %.preheader25.preheader
%indvar243 = phi i64 [ %tmp17, %bb16 ], [ 0, %.preheader25.preheader ]
br label %bb14
bb14: ; preds = %bb14, %.preheader25
%indvar240 = phi i64 [ 0, %.preheader25 ], [ %tmp15, %bb14 ]
%scevgep246 = getelementptr [4 x [4 x i32]]* @dct_luma_16x16.M4, i64 0, i64 %indvar243, i64 %indvar240
store i32 undef, i32* %scevgep246, align 4
%tmp15 = add i64 %indvar240, 1
%exitcond120 = icmp eq i64 %tmp15, 4
br i1 %exitcond120, label %bb16, label %bb14
bb16: ; preds = %bb14
%tmp17 = add i64 %indvar243, 1
%exitcond123 = icmp eq i64 %tmp17, 4
br i1 %exitcond123, label %.preheader24.preheader, label %.preheader25
.preheader24.preheader: ; preds = %bb16
br label %.preheader24
.preheader24: ; preds = %.preheader24, %.preheader24.preheader
%indvar233 = phi i64 [ %tmp18, %.preheader24 ], [ 0, %.preheader24.preheader ]
%scevgep238 = getelementptr [4 x [4 x i32]]* @dct_luma_16x16.M4, i64 0, i64 %indvar233, i64 1
store i32 undef, i32* %scevgep238, align 4
%tmp18 = add i64 %indvar233, 1
%exitcond115 = icmp eq i64 %tmp18, 4
br i1 %exitcond115, label %.preheader23.preheader, label %.preheader24
.preheader23.preheader: ; preds = %.preheader24
br label %.preheader23
.preheader23: ; preds = %.preheader23, %.preheader23.preheader
%indvar226 = phi i64 [ %tmp19, %.preheader23 ], [ 0, %.preheader23.preheader ]
%scevgep232 = getelementptr [4 x [4 x i32]]* @dct_luma_16x16.M4, i64 0, i64 2, i64 %indvar226
store i32 undef, i32* %scevgep232, align 4
%tmp19 = add i64 %indvar226, 1
%exitcond108 = icmp eq i64 %tmp19, 4
br i1 %exitcond108, label %.preheader22.preheader, label %.preheader23
.preheader22.preheader: ; preds = %.preheader23
br label %.preheader22
.preheader22: ; preds = %bb24, %.preheader22.preheader
ret void
}
More information about the llvm-commits
mailing list