The problem is that given code like this: a = b + c d = a + e ... ... (use of a) ... Lowering may produce code like this, at least on x86: T1 = b T1 += c a = T1 T2 = a T2 += e d = T2 ... ... (use of a) ... If "a" has a long live range, it may not get a register, resulting in clumsy code in the middle of the sequence like "a=reg; reg=a". Normally one might expect store forwarding to make the clumsy code fast, but it does presumably add an extra instruction-retirement cycle to the critical path in a pointer-chasing loop, and makes a big difference on some benchmarks. The simple fix here is, at the end of lowering "a=b+c", keep track of the final "a=T1" assignment. Then, when lowering "d=a+e" and we look up "a", we can substitute "T1". This slightly increases the live range of T1, but it does a great job of avoiding the redundant reload of the register from the stack location. A more general fix (in the future) might be to do live range splitting and let the register allocator handle it. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4095 R=kschimpf@google.com Review URL: https://codereview.chromium.org/1385433002 .
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| Input | Loading commit data... | |
| 64bit.pnacl.ll | Loading commit data... | |
| 8bit.pnacl.ll | Loading commit data... | |
| abi-atomics.ll | Loading commit data... | |
| addr-opt-multi-def-var.ll | Loading commit data... | |
| address-mode-opt.ll | Loading commit data... | |
| adv-switch-opt.ll | Loading commit data... | |
| align-spill-locations.ll | Loading commit data... | |
| alloc.ll | Loading commit data... | |
| arith-opt.ll | Loading commit data... | |
| arith.ll | Loading commit data... | |
| asm-verbose.ll | Loading commit data... | |
| bitcast.ll | Loading commit data... | |
| bool-folding.ll | Loading commit data... | |
| bool-opt.ll | Loading commit data... | |
| branch-opt.ll | Loading commit data... | |
| branch-simple.ll | Loading commit data... | |
| callindirect.pnacl.ll | Loading commit data... | |
| cmp-opt.ll | Loading commit data... | |
| cond-br-same-target.ll | Loading commit data... | |
| contract.ll | Loading commit data... | |
| convert.ll | Loading commit data... | |
| div_legalization.ll | Loading commit data... | |
| ebp_args.ll | Loading commit data... | |
| elf_container.ll | Loading commit data... | |
| elf_function_sections.ll | Loading commit data... | |
| elf_nodata.ll | Loading commit data... | |
| fp.arith.ll | Loading commit data... | |
| fp.arm.call.ll | Loading commit data... | |
| fp.call_ret.ll | Loading commit data... | |
| fp.cmp.ll | Loading commit data... | |
| fp.convert.ll | Loading commit data... | |
| fp.load_store.ll | Loading commit data... | |
| fp_const_pool.ll | Loading commit data... | |
| fpcall.ll | Loading commit data... | |
| fpconst.pnacl.ll | Loading commit data... | |
| function_aligned.ll | Loading commit data... | |
| globalinit.pnacl.ll | Loading commit data... | |
| globalrelocs.ll | Loading commit data... | |
| ias-data-reloc.ll | Loading commit data... | |
| ias-multi-reloc.ll | Loading commit data... | |
| int-arg.ll | Loading commit data... | |
| invalid.test | Loading commit data... | |
| large_stack_offs.ll | Loading commit data... | |
| load.ll | Loading commit data... | |
| load_cast.ll | Loading commit data... | |
| loop-nest-depth.ll | Loading commit data... | |
| mangle.ll | Loading commit data... | |
| nacl-atomic-cmpxchg-optimization.ll | Loading commit data... | |
| nacl-atomic-errors.ll | Loading commit data... | |
| nacl-atomic-fence-all.ll | Loading commit data... | |
| nacl-atomic-intrinsics.ll | Loading commit data... | |
| nacl-mem-intrinsics.ll | Loading commit data... | |
| nacl-other-intrinsics.ll | Loading commit data... | |
| nop-insertion.ll | Loading commit data... | |
| phi.ll | Loading commit data... | |
| phi_invalid.test | Loading commit data... | |
| prune_unreachable.ll | Loading commit data... | |
| randomize-pool-immediate-basic.ll | Loading commit data... | |
| randomize-regalloc.ll | Loading commit data... | |
| regalloc_evict_non_overlap.ll | Loading commit data... | |
| reorder-basic-blocks.ll | Loading commit data... | |
| reorder-functions.ll | Loading commit data... | |
| reorder-global-variables.ll | Loading commit data... | |
| reorder-pooled-constants.ll | Loading commit data... | |
| return_immediates.ll | Loading commit data... | |
| returns_twice_no_coalesce.ll | Loading commit data... | |
| rmw.ll | Loading commit data... | |
| rng.ll | Loading commit data... | |
| sdiv.ll | Loading commit data... | |
| select-opt.ll | Loading commit data... | |
| shift.ll | Loading commit data... | |
| simple-loop.ll | Loading commit data... | |
| store.ll | Loading commit data... | |
| strength-reduce.ll | Loading commit data... | |
| struct-arith.pnacl.ll | Loading commit data... | |
| switch-opt.ll | Loading commit data... | |
| test_i1.ll | Loading commit data... | |
| undef.ll | Loading commit data... | |
| unreachable.ll | Loading commit data... | |
| vector-align.ll | Loading commit data... | |
| vector-arg.ll | Loading commit data... | |
| vector-arith.ll | Loading commit data... | |
| vector-bitcast.ll | Loading commit data... | |
| vector-cast.ll | Loading commit data... | |
| vector-fcmp.ll | Loading commit data... | |
| vector-icmp.ll | Loading commit data... | |
| vector-ops.ll | Loading commit data... | |
| vector-select.ll | Loading commit data... |