[PATCH] D14945: Expose isXxxConstant() functions from TargetLowering base class (NFC)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 16:00:28 PST 2015


MatzeB added a comment.

In http://reviews.llvm.org/D14945#296244, @tyomitch wrote:

> In http://reviews.llvm.org/D14945#296197, @MatzeB wrote:
>
> > I don't have a really good answer as there is no existing header/class that I would describe as containing shared utility functions for lowering
> >  and adding a new header just for these 4 functions here seems overkill.
> >
> > The best thing I can think of right now is adding something like "static bool isOneConstant(SDValue Value)" to the ConstantSDNode class.
>
>
> That would require qualifying each invocation with a `ConstantSDNode::`, which is a bit of a mouthful...
>
> Would it be reasonable to define a new class in TargetLowering.h with the four static methods, and to inherit the six affected TargetLowerings, as well as DAGCombiner, from the new class?


Then add them as a normal functions (outside of the ConstantSDNode class). Adding new classes and inheritance is overkill for those 4 functions.


http://reviews.llvm.org/D14945





More information about the llvm-commits mailing list