-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #116119 - GuillaumeGomez:rollup-ohwianb, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - #114454 (Replace `HashMap` with `IndexMap` in pattern binding resolve ) - #116069 (Fix debug printing of tuple) - #116076 (Add Zba, Zbb, and Zbs as target features for riscv64-linux-android) - #116078 (Add assembly test to make sure that inlining works as expected when closures inherit target features) - #116096 (Make FnDef 1-ZST in LLVM debuginfo.) - #116116 (Rename the legacy feature gating macro) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
10 changed files
with
197 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// only-x86_64 | ||
// assembly-output: emit-asm | ||
// make sure the feature is not enabled at compile-time | ||
// compile-flags: -C target-feature=-sse4.1 -C llvm-args=-x86-asm-syntax=intel | ||
|
||
#![feature(target_feature_11)] | ||
#![crate_type = "rlib"] | ||
|
||
use std::arch::x86_64::{__m128, _mm_blend_ps}; | ||
|
||
#[no_mangle] | ||
pub unsafe fn sse41_blend_nofeature(x: __m128, y: __m128) -> __m128 { | ||
let f = { | ||
// check that _mm_blend_ps is not being inlined into the closure | ||
// CHECK-LABEL: {{sse41_blend_nofeature.*closure.*:}} | ||
// CHECK-NOT: blendps | ||
// CHECK: {{call .*_mm_blend_ps.*}} | ||
// CHECK-NOT: blendps | ||
// CHECK: ret | ||
#[inline(never)] |x, y| _mm_blend_ps(x, y, 0b0101) | ||
}; | ||
f(x, y) | ||
} | ||
|
||
#[target_feature(enable = "sse4.1")] | ||
pub fn sse41_blend_noinline(x: __m128, y: __m128) -> __m128 { | ||
let f = { | ||
// check that _mm_blend_ps is being inlined into the closure | ||
// CHECK-LABEL: {{sse41_blend_noinline.*closure.*:}} | ||
// CHECK-NOT: _mm_blend_ps | ||
// CHECK: blendps | ||
// CHECK-NOT: _mm_blend_ps | ||
// CHECK: ret | ||
#[inline(never)] |x, y| unsafe { | ||
_mm_blend_ps(x, y, 0b0101) | ||
} | ||
}; | ||
f(x, y) | ||
} | ||
|
||
#[no_mangle] | ||
#[target_feature(enable = "sse4.1")] | ||
pub fn sse41_blend_doinline(x: __m128, y: __m128) -> __m128 { | ||
// check that the closure and _mm_blend_ps are being inlined into the function | ||
// CHECK-LABEL: sse41_blend_doinline: | ||
// CHECK-NOT: {{sse41_blend_doinline.*closure.*}} | ||
// CHECK-NOT: _mm_blend_ps | ||
// CHECK: blendps | ||
// CHECK-NOT: {{sse41_blend_doinline.*closure.*}} | ||
// CHECK-NOT: _mm_blend_ps | ||
// CHECK: ret | ||
let f = { | ||
#[inline] |x, y| unsafe { | ||
_mm_blend_ps(x, y, 0b0101) | ||
} | ||
}; | ||
f(x, y) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Verify that `i32::cmp` FnDef type is declared with size 0 and align 1 in LLVM debuginfo. | ||
// compile-flags: -O -g -Cno-prepopulate-passes | ||
|
||
use std::cmp::Ordering; | ||
|
||
fn foo<F: FnOnce(&i32, &i32) -> Ordering>(v1: i32, v2: i32, compare: F) -> Ordering { | ||
compare(&v1, &v2) | ||
} | ||
|
||
pub fn main() { | ||
foo(0, 1, i32::cmp); | ||
} | ||
|
||
// CHECK: %compare.dbg.spill = alloca {}, align 1 | ||
// CHECK: call void @llvm.dbg.declare(metadata ptr %compare.dbg.spill, metadata ![[VAR:.*]], metadata !DIExpression()), !dbg !{{.*}} | ||
// CHECK: ![[TYPE:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "fn(&i32, &i32) -> core::cmp::Ordering", baseType: !{{.*}}, align: 1, dwarfAddressSpace: {{.*}}) | ||
// CHECK: ![[VAR]] = !DILocalVariable(name: "compare", scope: !{{.*}}, file: !{{.*}}, line: {{.*}}, type: ![[TYPE]], align: 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.