[PATCH] D35594: [GISel]: ConstantFold operations when building MIR

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 14:04:47 PDT 2017


qcolombet added a comment.

> Is that one flag that basically enables/disables all optimizations/folding ?

Yes, I would go with that for now. But I could see your concerns that we are going to generate crapy code for no good reason, thus you'd like more control.

> Or we have some sort of API where the user opt's in/out into certain transformations..

Hi Aditya,

It feels to me that we are attacking the problem of the combine optimizations and I wouldn't want complicated APIs for this. Basically, the way I see it is with a dumb MachineIRBuilder base class that would be specialized with the combines that make sense for a target at a given point for a given optimization level. The challenge here is to define which combines are available and when they are valid to apply (e.g., ok before legalization, etc.) for each target. I can see a table gen path here.

To summarize, I'd like to keep the combiner logic as simple as possible (ideally none at all for O0) because I fear we are already touching something we haven't carefully thought yet.

Cheers,
-Quentin


https://reviews.llvm.org/D35594





More information about the llvm-commits mailing list