> But that's the problem with trying to do the optimisation in this way. > We first simplify a truncation of an SImode addition X. Then we simplify > a zero extension of that truncation. Then we have the opportunity to > realise that the zero extension wasn't necessary after all, so we actually > want to undo both simplifications and go back to the original addition > pattern. So undoing the simplifications is precisely what we're aiming for > here, again regardless of RISCness.
In other words, you want to add the reverse transformation in combine.c to undo the effects of the simplication in simplify-rtx.c? And move the latter simplification back to combine.c in the process? -- Eric Botcazou