Skip to content

Commit cc94b4f

Browse files
Auto merge of #147272 - nikic:disable-i2p-p2i-opt, r=<try>
Enable -disable-i2p-p2i-opt flag
2 parents 94ecb52 + c022413 commit cc94b4f

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ unsafe fn configure_llvm(sess: &Session) {
118118
// Use non-zero `import-instr-limit` multiplier for cold callsites.
119119
add("-import-cold-multiplier=0.1", false);
120120

121+
add("-disable-i2p-p2i-opt", false);
122+
121123
if sess.print_llvm_stats() {
122124
add("-stats", false);
123125
}

tests/codegen-llvm/iter-repeat-n-trivial-drop.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ pub fn iter_repeat_n_next(it: &mut std::iter::RepeatN<NotCopy>) -> Option<NotCop
4747
#[no_mangle]
4848
// CHECK-LABEL: @vec_extend_via_iter_repeat_n
4949
pub fn vec_extend_via_iter_repeat_n() -> Vec<u8> {
50+
// FIXME: Has extra inttoptr + ptrtoint pair
5051
// CHECK: %[[ADDR:.+]] = tail call {{(noalias )?}}noundef dereferenceable_or_null(1234) ptr @{{.*}}__rust_alloc(i64 noundef {{(range\(i64 1, 0\) )?}}1234, i64 noundef {{(range\(i64 1, -9223372036854775807\) )?}}1)
51-
// CHECK: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %[[ADDR]], i8 42, i64 1234,
52+
// CHECK: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %[[ADDR2:.+]], i8 42, i64 1234,
5253

5354
let n = 1234_usize;
5455
let mut v = Vec::with_capacity(n);

tests/codegen-llvm/try_question_mark_nop.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ pub fn control_flow_nop_traits_128(x: ControlFlow<i128, u128>) -> ControlFlow<i1
212212
#[no_mangle]
213213
pub fn result_nop_match_ptr(x: Result<usize, Box<()>>) -> Result<usize, Box<()>> {
214214
// CHECK: start:
215+
// CHECK-NEXT: ptrtoint
216+
// CHECK-NEXT: inttoptr
215217
// CHECK-NEXT: insertvalue { i{{[0-9]+}}, ptr }
216218
// CHECK-NEXT: insertvalue { i{{[0-9]+}}, ptr }
217219
// CHECK-NEXT: ret
@@ -225,6 +227,8 @@ pub fn result_nop_match_ptr(x: Result<usize, Box<()>>) -> Result<usize, Box<()>>
225227
#[no_mangle]
226228
pub fn result_nop_traits_ptr(x: Result<u64, NonNull<()>>) -> Result<u64, NonNull<()>> {
227229
// CHECK: start:
230+
// CHECK-NEXT: ptrtoint
231+
// CHECK-NEXT: inttoptr
228232
// CHECK-NEXT: insertvalue { i{{[0-9]+}}, ptr }
229233
// CHECK-NEXT: insertvalue { i{{[0-9]+}}, ptr }
230234
// CHECK-NEXT: ret

tests/codegen-llvm/vec-iter-collect-len.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
#[no_mangle]
55
pub fn get_len() -> usize {
6+
// FIXME: Allocation no longer optimized away.
67
// CHECK-LABEL: @get_len
78
// CHECK-NEXT: start:
89
// CHECK-NEXT: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2
910
// CHECK-NEXT: tail call void @_R{{.+}}__rust_no_alloc_shim_is_unstable_v2()
10-
// CHECK-NEXT: ret i{{[0-9]+}} 3
11+
// CHECK: ret i{{[0-9]+}} 3
1112
[1, 2, 3].iter().collect::<Vec<_>>().len()
1213
}

0 commit comments

Comments
 (0)