On Thu, Mar 31, 2011 at 12:39 AM, Steven Bosscher <stevenb....@gmail.com> wrote: > Hi, > > This is the first cleanup for cprop.c. These cleanups are only > possible now, thanks to splitting the CPROP code out from gcse.c > > The first change is to not treat unfolded conditions as constant in > gcse_constant_p(). This never happens because: > - during hash table building any such condition should have been > simplified by any prior pass > - during cprop the expression table is not updated because the > patterns are unshared > > This causes no changes in code generation for all cc1-i files on > x86_64-unknown-linux-gnu. I could add an assert to make sure this kind > of condition really never happens, but IMHO it's not worth it and the > bug would be elsewhere anyway. > > The second change is to remove oprs_available_p(). After the > gcse_constant_p() cleanup, we do not have to traverse the whole > pattern of a SET candidate for CPROP, because we know that SET_DEST is > a REG and SET_SRC is a REG or a shareable constant. Therefore a simple > check to see if the registers involved were set in the block is > sufficient, and a regset can be used instead of the last_set table. > See reg_available_p(). > > The third change is to compute_hash_table_work(), which now traverses > the insns in each basic block just once (instead of twice), in reverse > order to record all registers set between BB_END and the current insn. > This change allows further simplify hash_scan_set() which now doesn't > have to look at INSN+1 anymore (saving another half insns stream > traversal by avoiding next_nonnote_nondebug_insn()). > > Bootstrapped and tested on x86_64-unknown-linux-gnu. OK?
Ok. Thanks, Richard. > Ciao! > Steven >