Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update call-llvm-intrinsics test for Rust 1.94.0 IR#153285

Open
DeepeshWR wants to merge 1 commit intorust-lang:mainfrom
DeepeshWR:codegen-llvm-sqrt-call-1.94
Open

Update call-llvm-intrinsics test for Rust 1.94.0 IR#153285
DeepeshWR wants to merge 1 commit intorust-lang:mainfrom
DeepeshWR:codegen-llvm-sqrt-call-1.94

Conversation

@DeepeshWR
Copy link

@DeepeshWR DeepeshWR commented Mar 2, 2026

Rust 1.94 now passes constants directly to llvm.sqrt.f32 instead of
storing/loading via the stack.

  • Updated the FileCheck pattern to match the new IR:
    // CHECK: call float @llvm.sqrt.f32(float 4.000000e+00)
    The test intent is unchanged: it still ensures the intrinsic is
    emitted as a 'call' (not 'invoke').

  • Removed unnecessary local variables and Drop usage to work in
    #![no_core] mode with minicore.

  • Added required crate attributes:
    #![feature(no_core, lang_items)]
    #![no_std]
    #![no_core]

  • Replaced //@ only-riscv64 (host-based execution) with explicit
    revisions for:
    riscv32gc-unknown-linux-gnu
    riscv64gc-unknown-linux-gnu
    This ensures deterministic multi-target coverage in CI without
    relying on the host architecture.

  • Added //@ needs-llvm-components: riscv and
    //@ min-llvm-version: 21 for CI compatibility.

Fixes #153271

@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. labels Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@DeepeshWR DeepeshWR force-pushed the codegen-llvm-sqrt-call-1.94 branch from f51e581 to dee56f5 Compare March 2, 2026 12:50
@rust-log-analyzer

This comment has been minimized.

@DeepeshWR DeepeshWR force-pushed the codegen-llvm-sqrt-call-1.94 branch from dee56f5 to 5bb4a0a Compare March 2, 2026 13:22
@jieyouxu
Copy link
Member

jieyouxu commented Mar 2, 2026

r? folkertdev

@rustbot rustbot assigned folkertdev and unassigned jieyouxu Mar 2, 2026
@rust-log-analyzer

This comment has been minimized.

@DeepeshWR DeepeshWR force-pushed the codegen-llvm-sqrt-call-1.94 branch from 5bb4a0a to 04715b7 Compare March 2, 2026 14:43

//@ only-riscv64
//@ revisions: host riscv64gc
//@ [host] only-riscv64
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a host revision?

Copy link
Contributor

Choose a reason for hiding this comment

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

so that if you run on a particular riscv machine you'd use the host target?

That is what the test did originally. In this particular instance I'm not sure why behavior would vary for e.g. a 32-bit target, but the extra test is cheap.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to add 32-bit coverage we should to that using an explicit 32-bit revision.

IMHO we should only have host codegen tests if minicore tests for specific targets are not possible (e.g. due to std dependency).

Copy link
Contributor

Choose a reason for hiding this comment

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

I've been bitten in the past by some minicore test just not running for a relevant target. But, in this particular case it probably has little value

@DeepeshWR can you replace the host revision with some 32-bit riscv one (that will need its own line for the target, and also needs the llvm component).

Copy link
Author

@DeepeshWR DeepeshWR Mar 3, 2026

Choose a reason for hiding this comment

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

@folkertdev Thanks for the clarification. I’ve made the suggested changes and replaced the host revision with an explicit 32-bit RISC-V one, including the required LLVM component as well.

Rust 1.94 now passes constants directly to llvm.sqrt.f32 instead of
storing/loading via the stack.

- Updated the FileCheck pattern to match the new IR:
    // CHECK: call float @llvm.sqrt.f32(float 4.000000e+00)
  The test intent is unchanged: it still ensures the intrinsic is
  emitted as a 'call' (not 'invoke').

- Removed unnecessary local variables and Drop usage to work in
  `#![no_core]` mode with minicore.

- Added required crate attributes:
    #![feature(no_core, lang_items)]
    #![no_std]
    #![no_core]

- Replaced `//@ only-riscv64` (host-based execution) with explicit
  revisions for:
      riscv32gc-unknown-linux-gnu
      riscv64gc-unknown-linux-gnu
  This ensures deterministic multi-target coverage in CI without
  relying on the host architecture.

- Added `//@ needs-llvm-components: riscv` and
  `//@ min-llvm-version: 21` for CI compatibility.

Signed-off-by: Deepesh Varatharajan <[email protected]>
@DeepeshWR DeepeshWR force-pushed the codegen-llvm-sqrt-call-1.94 branch from 04715b7 to 1d678f6 Compare March 3, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Regression in codegen-llvm test riscv-abi/call-llvm-intrinsics.rs on riscv64 since 1.94-beta

6 participants