On Tue, Apr 10, 2007 at 10:53:19AM -0700, Ian Lance Taylor wrote: > As you know, we have a lot of basic optimizations in fold-const.c that > operatee on trees. We also have a lot of basic optimizations in > simplify-rtx.c that operate on RTL. These sets of optimizations are > independent implementations. What can we do to avoid implementing a > third set of basic optimizations that operate on GIMPLE?
Perhaps I misunderstood what Diego was proposing, but I would have thought the subcode would continue to be the tree PLUS_EXPR, and not a GS_PLUS something. With that, build_foldN does essentially what we want, without having to regenerate tree nodes on the input side. With a bit of effort, we could proably eliminate the trees generated on the output side, with some callbacks. At least, that's what I'd had in mind. r~