This is the mail archive of the gcc@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: jump bypass confuses noce_try_minmax


> I would not have coded it this way, because on most architectures
> I would get worse code.

Right, but on the particular architecture I'm working on, you'd expect
to get optimal code.  But since neither test case works right, that's
a moot point.

> But if you do that, doesn't the code get worse on architectures that don't
> have min and max instructions (by increasing the number of tests)?

I don't know, that's why I'm asking.  There are a range of single-op
things ifcvt looks for (min, max, abs, setcc, etc).  I'd think you'd
want to maximize the use of those and minimize branches.  On platforms
without those, I don't know what swapping ifcvt and bypass would do.

> It seems it would be better to figure out how smin/smax could be used
> in the second case, since it would make the instructions match in more
> cases.

I looked into that, but after bypass if_info->b is "corrupted" by the
smax expression in the other branch, so it just loses.  It might be
possible to look for min/max pairs at that point and allow it though.


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