On 03/17/2016 02:02 PM, Jeff Law wrote:
On 03/17/2016 12:23 PM, Bernd Schmidt wrote:
On 03/17/2016 06:37 PM, Jeff Law wrote:
+ bitmap seen_insns;
+ seen_insns = BITMAP_ALLOC (NULL);
You could save an allocation here by making this a bitmap_head and using
bitmap_initialize.
+ bitmap_set_bit (seen_insns, INSN_UID (insn));
+
if (! INSN_P (insn))
continue;
@@ -3646,7 +3656,8 @@ update_equiv_regs (void)
&& ! find_reg_note (XEXP (reg_equiv[regno].init_insns, 0),
REG_EQUIV, NULL_RTX)
&& ! contains_replace_regs (XEXP (dest, 0))
- && ! pdx_subregs[regno])
+ && ! pdx_subregs[regno]
+ && ! bitmap_bit_p (seen_insns, INSN_UID (insn)))
This looks odd to me. Isn't this condition always false? Did you want to
test the init_insn?
And thinking about this a bit more, I can't see how this code was
correct to begin with -- a linear scan of the insns between init_insn
and insn does not necessarily correspond to actual control flow during
execution.
We could have a jump between those points that targets a label that is
outside those points. At that target label we might load from DEST.
I guess the fact that the reg is only used in a single basic block is
probably what saves us here. I do need to check that if the set of a
reg is in one block and uses are in another that we don't set
REG_BASIC_BLOCK.
jeff