Allow canonicalizing the array::map loop in trusted cases

This commit is contained in:
Scott McMurray 2023-02-03 03:27:51 -08:00
parent 52df0558ea
commit 5bc328fdef
14 changed files with 239 additions and 144 deletions

View file

@ -43,5 +43,7 @@ pub fn long_integer_map(x: [u32; 64]) -> [u32; 64] {
// CHECK-NEXT: alloca [64 x i32]
// CHECK-NEXT: alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 64]>"
// CHECK-NOT: alloca
x.map(|x| 2 * x + 1)
// CHECK: mul <{{[0-9]+}} x i32>
// CHECK: add <{{[0-9]+}} x i32>
x.map(|x| 13 * x + 7)
}