• Seth Brenith's avatar
    Iterate in assembly order for jump threading · fcc81d9a
    Seth Brenith authored
    While reading through the jump threading implementation, I noticed
    something strange: ApplyForwarding iterates through the block list in
    reverse post-order, not in assembly order. Thus, the value prev_fallthru
    might not refer to the previous block in assembly order. Obviously it
    works fine this way or we would have noticed by now, but I think that
    this step would be a little easier to read and reason about if the
    iteration used assembly order instead.
    
    I've added a test case to demonstrate the difference when using
    assembly order: in a diamond where the right side starts with an empty
    deferred block, the current implementation would fail to replace that
    block with a nop. I doubt this case would have any real-world impact.
    
    Change-Id: I28abe2043434debb54896871d15c540ad52c6368
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3039261
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#76067}
    fcc81d9a
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
riscv64 Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
code-generator-impl.h Loading commit data...
code-generator.cc Loading commit data...
code-generator.h Loading commit data...
frame-elider.cc Loading commit data...
frame-elider.h Loading commit data...
gap-resolver.cc Loading commit data...
gap-resolver.h Loading commit data...
instruction-codes.h Loading commit data...
instruction-scheduler.cc Loading commit data...
instruction-scheduler.h Loading commit data...
instruction-selector-impl.h Loading commit data...
instruction-selector.cc Loading commit data...
instruction-selector.h Loading commit data...
instruction.cc Loading commit data...
instruction.h Loading commit data...
jump-threading.cc Loading commit data...
jump-threading.h Loading commit data...
mid-tier-register-allocator.cc Loading commit data...
mid-tier-register-allocator.h Loading commit data...
move-optimizer.cc Loading commit data...
move-optimizer.h Loading commit data...
register-allocation.h Loading commit data...
register-allocator-verifier.cc Loading commit data...
register-allocator-verifier.h Loading commit data...
register-allocator.cc Loading commit data...
register-allocator.h Loading commit data...
spill-placer.cc Loading commit data...
spill-placer.h Loading commit data...
unwinding-info-writer.h Loading commit data...