Skip to content

[DependenceAnalysis] collectUpperBound triggers asserts #21959

@llvmbot

Description

@llvmbot
Bugzilla Link 21585
Resolution FIXED
Resolved on May 20, 2015 13:20
Version trunk
OS All
Attachments the test that triggers assertion failures
Reporter LLVM Bugzilla Contributor
CC @hfinkel,@sebpop

Extended Description

collectUpperBound assumes the type of the back edge count is no wider than the desired type (T). However, this assumption does not hold at least in strongSIVTest where the type of Delta may be narrower.

In the attached test case, the back edge count is i64 100, but the Delta (derived from i32 %i and i32 5) is of i32.

define void @​i32_subscript(i32* %a) {
entry:
br label %for.body

for.body:
%i = phi i32 [ 0, %entry ], [ %i.inc, %for.body ]
%a.addr = getelementptr i32* %a, i32 %i
%a.addr.2 = getelementptr i32* %a, i32 5
%0 = load i32* %a.addr, align 4
%1 = add i32 %0, 1
store i32 %1, i32* %a.addr.2, align 4
%i.inc = add nsw i32 %i, 1
%i.inc.ext = sext i32 %i to i64
%exitcond = icmp ne i64 %i.inc.ext, 100
br i1 %exitcond, label %for.body, label %for.end

for.end:
ret void
}

Note: this issue is similar to #18456 in that both are caused by sort of type mismatching. However, the type mismatch in #18456 is caused by removeMatchingExtensions, and this bug is not.

Jingyue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions