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

LLVM 21: issue-114312.rs fails after llvm-project@36f0838a3dd1 #137799

Closed
durin42 opened this issue Feb 28, 2025 · 3 comments · Fixed by #137818
Closed

LLVM 21: issue-114312.rs fails after llvm-project@36f0838a3dd1 #137799

durin42 opened this issue Feb 28, 2025 · 3 comments · Fixed by #137818
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@durin42
Copy link
Contributor

durin42 commented Feb 28, 2025

Starting with llvm/llvm-project@36f0838 tests/codegen/issues/issue-114312.rs fails thus:

---- [codegen] tests/codegen/issues/issue-114312.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/tmp/rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/tmp/rust/build/x86_64-unknown-linux-gnu/test/codegen/issues/issue-114312/issue-114312.ll" "/tmp/rust/tests/codegen/issues/issue-114312.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/tmp/rust/tests/codegen/issues/issue-114312.rs:18:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: readonly
               ^
/tmp/rust/build/x86_64-unknown-linux-gnu/test/codegen/issues/issue-114312/issue-114312.ll:7:47: note: found here
define void @issue_114312(ptr noalias noundef readonly byval([24 x i8]) align 8 captures(none) dereferenceable(24) %expr) unnamed_addr #0 {
                                              ^~~~~~~~

Input file: /tmp/rust/build/x86_64-unknown-linux-gnu/test/codegen/issues/issue-114312/issue-114312.ll
Check file: /tmp/rust/tests/codegen/issues/issue-114312.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        1: ; ModuleID = 'issue_114312.979b24920b4087eb-cgu.0'
        2: source_filename = "issue_114312.979b24920b4087eb-cgu.0"
        3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
        4: target triple = "x86_64-unknown-linux-gnu"
        5:
        6: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: read) uwtable
        7: define void @issue_114312(ptr noalias noundef readonly byval([24 x i8]) align 8 captures(none) dereferenceable(24) %expr) unnamed_addr #0 {
not:18                                                   !~~~~~~~                                                                                       error: no match expected
        8: start:
        9:  ret void
       10: }
       11:
       12: attributes #0 = { mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: read) uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" }
       13:
       14: !llvm.module.flags = !{!0, !1}
       15: !llvm.ident = !{!2}
       16:
       17: !0 = !{i32 8, !"PIC Level", i32 2}
       18: !1 = !{i32 2, !"RtLibUseGOT", i32 1}
       19: !2 = !{!"rustc version 1.87.0-dev"}
>>>>>>
------------------------------------------

Given that the test is explicitly looking for the lack of readonly it seems like this must be a bug in LLVM? But I'm filing this bug so we can keep track of this and make sure our CI stays green.

@durin42 durin42 added the C-bug Category: This is a bug. label Feb 28, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 28, 2025
@durin42
Copy link
Contributor Author

durin42 commented Feb 28, 2025

fyi @nikic

@nikic
Copy link
Contributor

nikic commented Feb 28, 2025

It's fine to drop the CHECK-NOT: readonly from this test, the remaining check lines are sufficient.

The readonly check was testing the internal reason why the original issue happened in the first place, but having the attribute is not actually incorrect. (It's an empty function after optimization.)

@jieyouxu jieyouxu added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 28, 2025
@durin42
Copy link
Contributor Author

durin42 commented Feb 28, 2025

Oh, nice. I'll prepare a patch!

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 1, 2025
…=jieyouxu

tests: adapt for LLVM 21 changes

Per discussion in rust-lang#137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21.

Fixes rust-lang#137799.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 1, 2025
…=jieyouxu

tests: adapt for LLVM 21 changes

Per discussion in rust-lang#137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21.

Fixes rust-lang#137799.
@bors bors closed this as completed in 2d3639d Mar 2, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 2, 2025
Rollup merge of rust-lang#137818 - durin42:llvm-21-remove-readonly, r=jieyouxu

tests: adapt for LLVM 21 changes

Per discussion in rust-lang#137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21.

Fixes rust-lang#137799.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants