(original) (raw)
On Jul 10, 2015, at 12:22 AM, Frédéric Heitzmann <frederic.heitzmann@gmail.com> wrote:2015-07-08 17:58 GMT+02:00 escha <escha@apple.com>:\[...\]
If you want to “revert" this sort of thing, you can do it at Select() time or PreprocessISelDAG(), which is what I did on an out-of-tree backend to turn add X, -C into sub X, C on selection time. This still lets all the intermediate optimizations take advantage of the canonicalization.
—eschaUnaware of your proposal, I used the TargetLowering::PerformDAGCombine hook.Is there a reason to prefere PreprocessISelDAG ?
If you write a target-specific combine that conflicts with a canonicalization, it’ll infinite loop because it’ll oscillate between the two forms.
—escha