On Wed, Mar 21, 2012 at 1:13 AM, Ian Lance Taylor wrote: > On Tue, Mar 20, 2012 at 2:06 PM, Steven Bosscher wrote: >> >> This patch splits a couple of pieces of cse_insn out to new functions. >> There are no functional changes, and no code generation differences as >> far as I could tell on x86_64 (-m64 and -m32). Likewise for the attached patch. >> The purpose of the patch is and, loto hopefully make cse_insn easier >> to understand. In a follow-up patch, I will make canonicalize_insn run >> only once per insn (it currently, i.e. before and after this patch, >> runs multiple times for CSE on extended basic blocks if a block is in >> multiple extended basic blocks). That is what the attached patch does. Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk? Ciao! Steven * cse.c (cse_canonicalized_basic_blocks): New simple bitmap to tag basic blocks that have already been traversed at least once, so that all insns have been canonicalized. (cse_insn): Call canonicalize_insn only if the basic block that contains insn is visited for the first time. (cse_extended_basic_block): After visiting all insns in a basic block, mark the block in cse_canonicalized_basic_blocks. (cse_main): Setup and destroy cse_canonicalized_basic_blocks. (cse_find_path): Micro-optimization, reorder one condition to avoid a reference to cfun.