[PATCH] D41373: [GISel][RFC]: GlobalISel Combiner prototype

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 16:23:46 PST 2017


aemerson added a comment.

I think it would be helpful to articulate here or in another patch/discussion the rationale for having a pre-legalize pass. While targets can of course do as they see fit, we should have some documentation on the source explaining what kind things are expected to be done there, and what kind of things are suggested to be done later. I.e. we can do some early canonicalization, early simplification to save compile time etc.



================
Comment at: include/llvm/CodeGen/GlobalISel/PreLegalizeCombiner.h:35
+
+class PreLegalizeCombiner : public MachineFunctionPass {
+public:
----------------
aditya_nandakumar wrote:
> qcolombet wrote:
> > The relationship between PreLegalizeCombiner and GICombiner looks strange to me.
> > In particular, before looking at the actual implementation of runOnMachineFunction, there is nothing showing that this pass uses GICombiner.
> > 
> > I would have expected something like GICombiner is a pass and PreLegalizeCombiner inherit from it and only set its custom PreLegalizeCombinerInfo thing.
> I went with the "has a" relationship with the GICombiner. Pretty much what the GICombiner does right now is the driving of the combines which felt like it belonged in a utility. Right now, there should be little/no difference to switch to each pass inheriting the GICombiner and I can do that if required.
I agree with Quentin that it seems having a generic GICombiner to inherit from seems clearer from a design point of view.


https://reviews.llvm.org/D41373





More information about the llvm-commits mailing list