-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/29/11 08: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. There are also RTL optimizers which perform this kind of constant propagation. See cprop.c (in older versions of gcc this code was in gcse.c)
jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOhJDfAAoJEBRtltQi2kC7f1AH/RQZDQ5PAiTf3rZC9TSGLJhL zJCTBcmuJmSCyzb9Bk+FLxx9XAfDF3xbv3GZZq4m2qssiG96Qz1UZn28oUx2NShz a3SAlhucOZGGYxQ482j6ITDIM/y3auuM0obhH1sQtfHyN6A2ndfE4mQ0alhlhIk8 7aaCPQSMtZuJkEeJ41rZ36rEHMSPpgHqx/KhVe4csJ/jBe3/s6PPOCAQav1J5z4p muJI1CCVRY+XAsKieZYhse8JRF9/iXlKsLHstIJf0HwJRYrSc3JvahEhfNXd+kHk 83Xy8UHkpxn4tPTe3RR2qWdB0yii8WOdX/yH7o8QDZZKwBlhbSjs+wN+iUjbWs0= =3Bpc -----END PGP SIGNATURE-----