Skip to content

Commit aec8364

Browse files
authored
Merge pull request #36634 from brson/beta-next
[beta] Fix optimization regressions for operations on [x; n]-initialized arr…
2 parents c6f7c2a + 56b1a07 commit aec8364

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_trans/tvec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ fn iter_vec_loop<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
349349
let plusone = Add(bcx, loop_counter, C_uint(bcx.ccx(), 1usize), DebugLoc::None);
350350
AddIncomingToPhi(loop_counter, plusone, bcx.llbb);
351351

352-
let cond_val = ICmp(bcx, llvm::IntULT, plusone, count, DebugLoc::None);
352+
let cond_val = ICmp(bcx, llvm::IntNE, plusone, count, DebugLoc::None);
353353
CondBr(bcx, cond_val, loop_bcx.llbb, next_bcx.llbb, DebugLoc::None);
354354

355355
next_bcx
@@ -381,7 +381,7 @@ pub fn iter_vec_raw<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
381381
let data_ptr =
382382
Phi(header_bcx, val_ty(data_ptr), &[data_ptr], &[bcx.llbb]);
383383
let not_yet_at_end =
384-
ICmp(header_bcx, llvm::IntULT, data_ptr, data_end_ptr, DebugLoc::None);
384+
ICmp(header_bcx, llvm::IntNE, data_ptr, data_end_ptr, DebugLoc::None);
385385
let body_bcx = fcx.new_temp_block("iter_vec_loop_body");
386386
let next_bcx = fcx.new_temp_block("iter_vec_next");
387387
CondBr(header_bcx, not_yet_at_end, body_bcx.llbb, next_bcx.llbb, DebugLoc::None);

0 commit comments

Comments
 (0)