Skip to content

Commit 1ca1de6

Browse files
authored
Auto merge of #36124 - eddyb:fast-array-init, r=alexcrichton
Fix optimization regressions for operations on [x; n]-initialized arrays. Fixes #35662 by using `!=` instead of `<` as the stop condition for `[x; n]` initialization loops. Also included is eddyb/llvm@cc2009f, a hack to run the GVN pass twice, another time after InstCombine. This hack results in removal of redundant `memset` and `memcpy` calls (from loops over arrays). cc @nrc Can we get performance numbers on this? Not sure if it regresses anything else.
2 parents 70598e0 + f5c7752 commit 1ca1de6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc_trans/tvec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn slice_for_each<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
5252
let current = Phi(header_bcx, val_ty(start), &[start], &[bcx.llbb]);
5353

5454
let keep_going =
55-
ICmp(header_bcx, llvm::IntULT, current, end, DebugLoc::None);
55+
ICmp(header_bcx, llvm::IntNE, current, end, DebugLoc::None);
5656
CondBr(header_bcx, keep_going, body_bcx.llbb, next_bcx.llbb, DebugLoc::None);
5757

5858
let body_bcx = f(body_bcx, if zst { data_ptr } else { current });

src/llvm

src/rustllvm/llvm-auto-clean-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2016-08-23
4+
2016-08-30

0 commit comments

Comments
 (0)