Add regression test for pclmulqdq inlining across target feature#157791
Add regression test for pclmulqdq inlining across target feature#157791kohsine wants to merge 1 commit into
Conversation
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
r? me
It would be better to use minicore for this test, so it runs regardless of the host. There are plenty of examples of this, these tests use
//@ add-minicore
//@ compile-flags: -Copt-level=3 --target x86_64-unknown-linux-gnu
//@ needs-llvm-components: x86
#![feature(no_core)]
#![no_core]
extern crate minicore;
use minicore::*;|
Ah sorry, this wants to test |
| // CHECK-LABEL: @reduce128_caller | ||
| // CHECK: call <2 x i64> @llvm.x86.pclmulqdq | ||
| // CHECK: call <2 x i64> @llvm.x86.pclmulqdq |
There was a problem hiding this comment.
Currently this only tests that
- the
reduce128_callerfunction exists call <2 x i64> @llvm.x86.pclmulqdqoccurs twice.
But this doesn't test that reduce128 actually got inlined.
| reduce128(a, b, keys) | ||
| } | ||
|
|
||
| unsafe fn reduce128(a: arch::__m128i, b: arch::__m128i, keys: arch::__m128i) -> arch::__m128i { |
There was a problem hiding this comment.
| unsafe fn reduce128(a: arch::__m128i, b: arch::__m128i, keys: arch::__m128i) -> arch::__m128i { | |
| // CHECK-LABEL: @reduce128 | |
| // CHECK: call <2 x i64> @llvm.x86.pclmulqdq | |
| // CHECK: call <2 x i64> @llvm.x86.pclmulqdq | |
| #[no_mangle] | |
| unsafe fn reduce128(a: arch::__m128i, b: arch::__m128i, keys: arch::__m128i) -> arch::__m128i { |
With these additional checks the call <2 x i64> @llvm.x86.pclmulqdq must occur 4 times in total, proving that inlining occurred.
|
|
||
| //! Regression test for https://github.com/rust-lang/rust/issues/139029 | ||
| //! | ||
| //! pclmulqdq intrinsics should inline across target_feature |
There was a problem hiding this comment.
| //! pclmulqdq intrinsics should inline across target_feature | |
| //! The pclmulqdq intrinsics should inline into functions with the required target features. | |
| *[View changes since the review](https://triagebot.infra.rust-lang.org/gh-changes-since/rust-lang/rust/157791/d2f24127d97d8c795d1cf5fbf6037f9885f34d39..e497947ec34512d57dd5fb3a0e24871c7c97337e)* |
|
Reminder, once the PR becomes ready for a review, use |
Regression test for #139029.
Checks that pclmulqdq intrinsics inline across target_feature.