summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-09-01 00:27:03 +0300
committerBrian Anderson <banderson@mozilla.com>2016-09-21 20:56:55 +0000
commit56b1a0792dba0bf39911ee3c314f57ec900846c6 (patch)
treefb79a4b38452836d6a87990b2eb89d7a154c99de
parentc6f7c2a72143a76547b21d187f0a8e958ff3c369 (diff)
downloadrust-56b1a0792dba0bf39911ee3c314f57ec900846c6.tar.gz
rust-56b1a0792dba0bf39911ee3c314f57ec900846c6.zip
Fix optimization regressions for operations on [x; n]-initialized arrays.
-rw-r--r--src/librustc_trans/tvec.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_trans/tvec.rs b/src/librustc_trans/tvec.rs
index 92a2d3787bf..11fe9c98d90 100644
--- a/src/librustc_trans/tvec.rs
+++ b/src/librustc_trans/tvec.rs
@@ -349,7 +349,7 @@ fn iter_vec_loop<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
     let plusone = Add(bcx, loop_counter, C_uint(bcx.ccx(), 1usize), DebugLoc::None);
     AddIncomingToPhi(loop_counter, plusone, bcx.llbb);
 
-    let cond_val = ICmp(bcx, llvm::IntULT, plusone, count, DebugLoc::None);
+    let cond_val = ICmp(bcx, llvm::IntNE, plusone, count, DebugLoc::None);
     CondBr(bcx, cond_val, loop_bcx.llbb, next_bcx.llbb, DebugLoc::None);
 
     next_bcx
@@ -381,7 +381,7 @@ pub fn iter_vec_raw<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
         let data_ptr =
             Phi(header_bcx, val_ty(data_ptr), &[data_ptr], &[bcx.llbb]);
         let not_yet_at_end =
-            ICmp(header_bcx, llvm::IntULT, data_ptr, data_end_ptr, DebugLoc::None);
+            ICmp(header_bcx, llvm::IntNE, data_ptr, data_end_ptr, DebugLoc::None);
         let body_bcx = fcx.new_temp_block("iter_vec_loop_body");
         let next_bcx = fcx.new_temp_block("iter_vec_next");
         CondBr(header_bcx, not_yet_at_end, body_bcx.llbb, next_bcx.llbb, DebugLoc::None);