On Mon, May 13, 2019 at 1:39 PM bin.cheng <bin.ch...@linux.alibaba.com> wrote: > > Hi, > While working on other PR, I noticed that we can save lots of if-then-else in > accessing > cand_vec by placing an additional NULL element at front of it. > > Bootstrap and test on x86_64. Is it OK?
Nice. OK. Richard. > Thanks, > bin > > 2019-05-13 Bin Cheng <bin.ch...@linux.alibaba.com> > > * gimple-ssa-strength-reduction.c (lookup_cand): Adjust index by 1. > (alloc_cand_and_find_basis): Ditto. > (backtrace_base_for_ref, create_mul_ssa_cand): Remove if-then-else. > (create_mul_imm_cand, create_add_ssa_cand): Ditto. > (create_add_imm_cand, slsr_process_cast): Ditto. > (slsr_process_copy, replace_mult_candidate): Ditto. > (replace_rhs_if_not_dup, replace_one_candidate): Ditto. > (dump_cand_vec, analyze_candidates_and_replace): Skip NULL element. > (pass_strength_reduction::execute): Init the first NULL element.