This is the mail archive of the
mailing list for the GCC project.
Re: Use predicates for RTL objects
On Thu, Aug 08, 2019 at 01:26:42PM -0500, Segher Boessenkool wrote:
> LABEL_REF_P works out nicely because it is referring to something that
> is data, is not an operator. "Leaves" in an RTL expression, if you want
> to look at it that way.
> Predicates for other RTX codes aren't always as obvious, see CONST_P as
> example. PLUS_P would be a bit borderline.
> Part of the reason why REG_P and MEM_P and the like are nice, is that
> these predicates are often used in bigger conditions, maybe together
> with some XEXP and whatnot. Is that the case for PLUS_P?
Yes, it's used quite often in more complex conditions checking the
operands (eg to see whether they're constants), or applied to XEXP's
But I'm in agreement that PLUS_P just seems odd somehow. The leaf/data
vs operator distinction makes sense, maybe RTXOP_PLUS_P, but then you'd
want that to check if it was being called on an operator, so I don't
know if you'd do it unless/until we eventually have an rtx_op class and
have done the other bits of converting to C++.