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 cc2009f02d, 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.
This commit is contained in:
bors 2016-09-03 17:41:08 -07:00 committed by GitHub
commit 1ca1de6b26
3 changed files with 3 additions and 3 deletions

View file

@ -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 });

@ -1 +1 @@
Subproject commit eee68eafa7e8e4ce996b49f5551636639a6c331a
Subproject commit 16b79d01fd6d942cf3c9120b92df56b13ec92665

View file

@ -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