Hi, This patch is aimed to perform conditional load hoisting (in tree level), to increase opportunities for if-conversion (in RTL, ifcvt.c), It was written for a GCC 4.1.1 based compiler, and I'm posting it, as a reference, for a discussion I want to raise with respect tree-ssa-if-conversion improvements (coming up) . I'm not submitting this for inclusion in GCC as is, since I think it should be rewritten to be part of tree-if-conv (details will followed). This patch performs hoisting of a load insn from the THEN or the ELSE block (one of them, where it appears) to the IF block above. It has several restrictions when to hoist, including a checking that the BBs are if-convertable. For example: Replace: bb0: if (c) goto bb1; else goto bb2; bb1: a = arr[index]; bb2: with bb0: a' = arr[index]; if (c) goto bb1; else goto bb2; bb1: tmp = a'; bb2: In order to activate this transformation, 2 flags should be enabled: 1. -ftree-clhoist (the pass flag) 2. -fsched-spec-load-dangerous - since we create speculative loads, which is dangerous. Tehila. (See attached file: cond_load_hoist.diff) ----------------------------------------------------------------------------- Tehila Meyzels Tel: 972-4-829-6190 Email: tehila@il.ibm.com