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

LoopVectorize: add test for crash in #72969 #74111

Merged
merged 1 commit into from
Feb 22, 2024
Merged

Conversation

artagnon
Copy link
Contributor

@artagnon artagnon commented Dec 1, 2023

No description provided.

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 1, 2023

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/74111.diff

1 Files Affected:

  • (added) llvm/test/Transforms/LoopVectorize/pr72969.ll (+26)
diff --git a/llvm/test/Transforms/LoopVectorize/pr72969.ll b/llvm/test/Transforms/LoopVectorize/pr72969.ll
new file mode 100644
index 000000000000000..47d3efc10fc4c49
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/pr72969.ll
@@ -0,0 +1,26 @@
+; RUN: not --crash opt -passes=loop-vectorize -S < %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+@h = global i32 0, align 4
+
+define void @test(ptr %p) {
+entry:
+  br label %for.body
+
+for.body:
+  %idx.ext.merge = phi i64 [ 1, %entry ], [ %idx, %for.body ]
+  %inc.merge = phi i16 [ 1, %entry ], [ %inc, %for.body ]
+  %idx.merge = phi i64 [ 0, %entry ], [ %idx.ext.merge, %for.body ]
+  %add = shl i64 %idx.merge, 1
+  %arrayidx = getelementptr [1 x i32], ptr %p, i64 0, i64 %add
+  %0 = load i32, ptr %arrayidx, align 4
+  %inc = add i16 %inc.merge, 1
+  %idx = zext i16 %inc to i64
+  %gep = getelementptr i32, ptr %p, i64 %idx
+  %cmp = icmp ugt ptr %gep, @h
+  br i1 %cmp, label %exit, label %for.body
+
+exit:
+  ret void
+}

@artagnon artagnon changed the title LoopVectorize/test: add test for crash in #72969 LoopVectorize: add test for crash in #72969 Dec 1, 2023
@nikic
Copy link
Contributor

nikic commented Dec 2, 2023

We don't use pre-commit tests for crashes. You can include it directly in the fix PR.

@artagnon artagnon changed the title LoopVectorize: add test for crash in #72969 LoopVectorize/X86: add test for crash in #72969 Dec 4, 2023
@artagnon artagnon changed the title LoopVectorize/X86: add test for crash in #72969 LoopVectorize/{X86,AArch64}: add test for crash in #72969 Dec 4, 2023
@artagnon artagnon changed the title LoopVectorize/{X86,AArch64}: add test for crash in #72969 LoopVectorize/X86: add test for crash in #72969 Dec 19, 2023
@artagnon artagnon changed the title LoopVectorize/X86: add test for crash in #72969 LoopVectorize: add test for crash in #72969 Jan 3, 2024
@david-arm
Copy link
Contributor

What's the best thing to do with this PR? The test seems fine, but if it should be added as part of the actual fix does it make sense to close this and just review #74456?

@artagnon
Copy link
Contributor Author

Hi @david-arm,

Sorry I'm behind on my PRs: I'm currently on vacation, due to return to work in mid-March.

As for this PR, since the test is fine, I think we can merge it as-is, to document the failure. I'll try to pick up #74456 soon and complete it. What do you think?

Copy link
Contributor

@david-arm david-arm left a comment

Choose a reason for hiding this comment

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

LGTM!

@david-arm
Copy link
Contributor

Hi @david-arm,

Sorry I'm behind on my PRs: I'm currently on vacation, due to return to work in mid-March.

As for this PR, since the test is fine, I think we can merge it as-is, to document the failure. I'll try to pick up #74456 soon and complete it. What do you think?

Yeah, seems reasonable. And no rush to finish the other patch - enjoy your vacation!

@artagnon artagnon merged commit 695a9d8 into llvm:main Feb 22, 2024
3 of 4 checks passed
@artagnon artagnon deleted the lv-crash-test branch February 22, 2024 16:00
@artagnon
Copy link
Contributor Author

I got a buildbot failure post-merge, although the native CI seems to have passed it.

@nikic
Copy link
Contributor

nikic commented Feb 22, 2024

And this is why I told you not to pre-commit tests for crashes :) If you do this, you need to at least make it a REQUIRES: asserts test, to be reasonably confident that it will always crash.

@artagnon
Copy link
Contributor Author

Thanks for the suggestion; will attempt a quick fix. [I really shouldn't have merged something while on vacation: this is what I get]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants