This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: missing conditional propagation in cprop.c pass


> 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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]