Skip to content

Commit

Permalink
Auto merge of rust-lang#106660 - saethlin:destprop-move-codegen, r=tm…
Browse files Browse the repository at this point in the history
…iasko

Add a regression test for argument copies with DestinationPropagation

This example, as a codegen test: rust-lang#105813 (comment)

r? `@tmiasko`
  • Loading branch information
bors committed Jan 11, 2023
2 parents ef4046e + 13eec69 commit 1e4f900
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/codegen/move-operands.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// compile-flags: -C no-prepopulate-passes -Zmir-enable-passes=+DestinationPropagation

#![crate_type = "lib"]

type T = [u8; 256];

#[no_mangle]
pub fn f(a: T, b: fn(_: T, _: T)) {
// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
// CHECK-NOT: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
b(a, a)
}

0 comments on commit 1e4f900

Please sign in to comment.