This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81502] In some cases the data is moved to memory unnecessarily [partial regression]
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Jul 2017 12:12:50 +0000
- Subject: [Bug middle-end/81502] In some cases the data is moved to memory unnecessarily [partial regression]
- Auto-submitted: auto-generated
- References: <bug-81502-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81502
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the rewrite into SSA should work now. I'm not sure the pattern combining
BIT_INSERT_EXPR and VECTOR_CST into a CONSTRUCTOR is desirable, a single insert
into a loaded constant vector is likely cheaper so some cost modeling would be
in order.
So from
int bar(void*) (void * ptr)
{
int res;
__m128i word;
long long int _2;
unsigned int _4;
<bb 2> [100.00%] [count: INV]:
_2 = (long long int) ptr_6(D);
word_3 = BIT_INSERT_EXPR <{ 0, 0 }, _2, 0 (64 bits)>;
_4 = BIT_FIELD_REF <word_3, 32, 0>;
res_5 = (int) _4;
return res_5;
the desired pattern is combining BIT_FIELD_REF and BIT_INSERT_EXPR. We'd
combine
that into
_4 = BIT_FIELD_REF <_2, 32, 0>;
will try to come up with a match.pd rule once time permits.