Skip to content

Commit

Permalink
Auto merge of #36124 - eddyb:fast-array-init, r=alexcrichton
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors authored Sep 4, 2016
2 parents 70598e0 + f5c7752 commit 1ca1de6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc_trans/tvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub fn slice_for_each<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
let current = Phi(header_bcx, val_ty(start), &[start], &[bcx.llbb]);

let keep_going =
ICmp(header_bcx, llvm::IntULT, current, end, DebugLoc::None);
ICmp(header_bcx, llvm::IntNE, current, end, DebugLoc::None);
CondBr(header_bcx, keep_going, body_bcx.llbb, next_bcx.llbb, DebugLoc::None);

let body_bcx = f(body_bcx, if zst { data_ptr } else { current });
Expand Down
2 changes: 1 addition & 1 deletion src/llvm
2 changes: 1 addition & 1 deletion src/rustllvm/llvm-auto-clean-trigger
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
# The actual contents of this file do not matter, but to trigger a change on the
# build bots then the contents should be changed so git updates the mtime.
2016-08-23
2016-08-30

0 comments on commit 1ca1de6

Please sign in to comment.