This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Scalar masks 2/x] Use bool masks in if-conversion


On 08/21/2015 02:15 AM, Richard Biener wrote:

Indeed.  I don't remember my exact comments during the talk at the
Cauldron but the scheme used there was sth like

mask = GEN_MASK <vec1 < vec2>; b = a + 1; x = VEC_COND <mask, a, b>

to model conditional execution already at the if-conversion stage
(for all scalar stmts made executed unconditionally rather than just
the PHI results).  I was asking for the condition to be removed from
GEN_MASK (patch 1 has this fixed now AFAICS).  And I also asked why
it was necessary to do this "lowering" here and not simply do

mask = vec1 < vec2;  // regular vector mask! b = a + 1; x = VEC_COND
<mask, a, b>

and have the lowering to an integer mask done later.  You'd still
change if-conversion to predicate _all_ statements, not just those
with side-effects.  So I think there still needs to be a new target
hook to trigger this, similar to how the target capabilities trigger
the masked load/store path in if-conversion.

But I don't like changing our IL so much as to allow 'integer' masks
everywhere.
Right. I'd be *much* less concerned with a hook that tells the if-converter to predicate everything and for the expander to do the lowering.

We'd still have the same representation through gimple, what changes is how many statements have predication and the lowering from gimple to RTL.

Contrast to a introducing a totally new way to represent predication in if-conversion and beyond, which just seems like a nightmare.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]