Commit 9838117b by Segher Boessenkool Committed by Segher Boessenkool

* combine.c (distribute_links): Handle multiple SETs.

From-SVN: r218242
parent 66d4b012
2014-12-01 Segher Boessenkool <segher@kernel.crashing.org> 2014-12-01 Segher Boessenkool <segher@kernel.crashing.org>
* combine.c (distribute_links): Handle multiple SETs.
2014-12-01 Segher Boessenkool <segher@kernel.crashing.org>
* combine.c (struct insn_link): New field `regno'. * combine.c (struct insn_link): New field `regno'.
(alloc_insn_link): New parameter `regno'. Use it. (alloc_insn_link): New parameter `regno'. Use it.
(find_single_use): Check the new field. (find_single_use): Check the new field.
...@@ -13817,24 +13817,46 @@ distribute_links (struct insn_link *links) ...@@ -13817,24 +13817,46 @@ distribute_links (struct insn_link *links)
next_link = link->next; next_link = link->next;
/* If the insn that this link points to is a NOTE or isn't a single /* If the insn that this link points to is a NOTE, ignore it. */
set, ignore it. In the latter case, it isn't clear what we if (NOTE_P (link->insn))
can do other than ignore the link, since we can't tell which continue;
register it was for. Such links wouldn't be used by combine
anyway. set = 0;
rtx pat = PATTERN (link->insn);
It is not possible for the destination of the target of the link to if (GET_CODE (pat) == SET)
have been changed by combine. The only potential of this is if we set = pat;
replace I3, I2, and I1 by I3 and I2. But in that case the else if (GET_CODE (pat) == PARALLEL)
destination of I2 also remains unchanged. */ {
int i;
if (NOTE_P (link->insn) for (i = 0; i < XVECLEN (pat, 0); i++)
|| (set = single_set (link->insn)) == 0) {
set = XVECEXP (pat, 0, i);
if (GET_CODE (set) != SET)
continue;
reg = SET_DEST (set);
while (GET_CODE (reg) == ZERO_EXTRACT
|| GET_CODE (reg) == STRICT_LOW_PART
|| GET_CODE (reg) == SUBREG)
reg = XEXP (reg, 0);
if (!REG_P (reg))
continue;
if (REGNO (reg) == link->regno)
break;
}
if (i == XVECLEN (pat, 0))
continue;
}
else
continue; continue;
reg = SET_DEST (set); reg = SET_DEST (set);
while (GET_CODE (reg) == SUBREG || GET_CODE (reg) == ZERO_EXTRACT
|| GET_CODE (reg) == STRICT_LOW_PART) while (GET_CODE (reg) == ZERO_EXTRACT
|| GET_CODE (reg) == STRICT_LOW_PART
|| GET_CODE (reg) == SUBREG)
reg = XEXP (reg, 0); reg = XEXP (reg, 0);
/* A LOG_LINK is defined as being placed on the first insn that uses /* A LOG_LINK is defined as being placed on the first insn that uses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment