Skip to content

tests: adapt array-cmp for llvm/llvm-project@f7b65011de51 #144749

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

durin42
Copy link
Contributor

@durin42 durin42 commented Jul 31, 2025

The referenced commit adds a new llvm.loop.estimated_trip_count metadata entry, which shows up in this test. It was being erroneously captured by a too-broad regular expression, which this fixes such that the test passes both before and after the upstream change.

@rustbot label llvm-main

@rustbot
Copy link
Collaborator

rustbot commented Jul 31, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) labels Jul 31, 2025
@rustbot

This comment has been minimized.

The referenced commit adds a new llvm.loop.estimated_trip_count metadata
entry, which shows up in this test. It was being erroneously captured by
a too-broad regular expression, which this fixes such that the test
passes both before and after the upstream change.
@durin42 durin42 force-pushed the llvm-22-loop-thing branch from 8f0fee6 to 3ec23cb Compare July 31, 2025 19:39
@@ -46,7 +46,7 @@ pub fn array_of_tuple_le(a: &[(i16, u16); 2], b: &[(i16, u16); 2]) -> bool {
// CHECK: %[[B01:.+]] = load i16, ptr %[[PB01]]
// CHECK-NOT: cmp
// CHECK: %[[EQ01:.+]] = icmp eq i16 %[[A01]], %[[B01]]
// CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]]
// CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]]{{(, !llvm.loop ![0-9+])?}}
Copy link
Member

Choose a reason for hiding this comment

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

Does the test care about the attribute? Would it be fine if we just did something simpler like

Suggested change
// CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]]{{(, !llvm.loop ![0-9+])?}}
// CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]]{{,|$}}

or maybe it'd be sufficient to just

Suggested change
// CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]]{{(, !llvm.loop ![0-9+])?}}
// CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]]{{,?}}

Though I'm not sure exactly how FileCheck handles something like that.

@scottmcm scottmcm assigned scottmcm and unassigned Mark-Simulacrum Jul 31, 2025
@nikic
Copy link
Contributor

nikic commented Aug 1, 2025

(Note that the change has been reverted for now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants