This is the mail archive of the gcc-bugs@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]

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
To summarize IRC discussions about this, the first step should be to introduce
SEXT_EXPR (split from Prathamesh's patch, improve), then add match.pd
canonicalization of these range testing to SEXT_EXPR + EQ_EXPR/NE_EXPR or
BIT_AND_EXPR + EQ/NE, recognize those in range discovery for reassoc.
Combine probably isn't able to handle transformation of one seq to the other,
and in any case, combiner would be only one way (it simplifies/canonicalizes
the IL to something, but doesn't have easy way to try two completely different
but equivalent sequences; also, often it is more than 4 instructions).
So we should try to do something in the expansion to try both sequences and
pick the less costly.

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