-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/29/11 09:26, Bernd Schmidt wrote: > On 09/29/11 16:43, Rahul Kharche wrote: >> >>> insn 882 : cc <- compare (r684, 0) jump_insn 883 : if >>> (cc != 0) goto insn 46 insn 49 : r291 <- r684 >>> ...... insn 46 >>> >>> cc contains the result of subtracting 0 from r684; control flow >>> goes to insn_49 only if (cc == 0), which implies (r684 == 0). >>> Then at insn_49 we have conditional const propagation "r684 <- >>> 0", is it right? >>> >> >> I believe, the optimization you may be referring to is value >> range propagation which does predication of values based on >> predicates of conditions. GCC definitely applies VRP at the tree >> stage, I am not sure if there is an RTL pass to do the same. > > ISTR cse.c has some support for this. cprop.c -- see references to implicit_sets.
jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOhJCbAAoJEBRtltQi2kC7qdQH/Rd/wTt53jgos8n7LLc5p0eD dDPCiAR6fHvJqiEBwhgxsQEiifd7NuZR6dW5qPkqhtkJI5HcSpfLqigW+7iNi3oL Bxx2FHc5Bdtf5QREOcx6XEfVYe6zZitJBkPJ8fuOLz/M8BqJjcZ/JUjs4lnezB9f RLynyf+JWmPjQHeeKKUp9EmYhozJ8f5kqbKq5S7VF/I2IASWZV02x6mUhaRseEhP xkFWJOCRKQ3YUP6n+H/eFn6ZMeZ+FvCfVJmy1GLVsb8UsytvPVYoiKO3NageC1rx 99QikyRL2nOE9O4WZn39Mj1PC2YL5lk1WRhDnuyXKcy+GuBnK1HuBrlcnfFady0= =/NYi -----END PGP SIGNATURE-----