Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSV: document hang reported in #37865 #102479

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ void reorder(Instruction *I) {
if (IM->getParent() != I->getParent())
continue;

assert(IM != I && "Unexpected cycle while re-ordering instructions");

if (!IM->comesBefore(I)) {
InstructionsToMove.insert(IM);
Worklist.push_back(IM);
Expand Down
15 changes: 15 additions & 0 deletions llvm/test/Transforms/LoadStoreVectorizer/AArch64/pr37865.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; REQUIRES: asserts
; RUN: not --crash opt -mtriple=aarch64 -passes=load-store-vectorizer \
; RUN: -disable-output %s 2>&1 | FileCheck %s

artagnon marked this conversation as resolved.
Show resolved Hide resolved
define i32 @load_cycle(ptr %x) {
; CHECK: Unexpected cycle while re-ordering instructions
entry:
%gep.x.1 = getelementptr inbounds [2 x i32], ptr %x, i32 0, i32 1
%load.x.1 = load i32, ptr %gep.x.1
%rem = urem i32 %load.x.1, 1
%gep.x.2 = getelementptr inbounds [2 x i32], ptr %x, i32 %rem, i32 0
Comment on lines +9 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this just failed to check that one of the vectorization pointer candidates actually depends on the other load, so these shouldn't be vectorization candidates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I figured that I have to fix the creation of the Chain.

%load.x.2 = load i32, ptr %gep.x.2
%ret = add i32 %load.x.2, %load.x.1
ret i32 %ret
}
Loading