class ssa_block_ranges
{
public:
- virtual void set_bb_range (const basic_block bb, const irange &r) = 0;
+ virtual bool set_bb_range (const basic_block bb, const irange &r) = 0;
virtual bool get_bb_range (irange &r, const basic_block bb) = 0;
virtual bool bb_range_p (const basic_block bb) = 0;
public:
sbr_vector (tree t, irange_allocator *allocator);
- virtual void set_bb_range (const basic_block bb, const irange &r) OVERRIDE;
+ virtual bool set_bb_range (const basic_block bb, const irange &r) OVERRIDE;
virtual bool get_bb_range (irange &r, const basic_block bb) OVERRIDE;
virtual bool bb_range_p (const basic_block bb) OVERRIDE;
protected:
// Set the range for block BB to be R.
-void
+bool
sbr_vector::set_bb_range (const basic_block bb, const irange &r)
{
irange *m;
else
m = m_irange_allocator->allocate (r);
m_tab[bb->index] = m;
+ return true;
}
// Return the range associated with block BB in R. Return false if
{
public:
sbr_sparse_bitmap (tree t, irange_allocator *allocator, bitmap_obstack *bm);
- virtual void set_bb_range (const basic_block bb, const irange &r) OVERRIDE;
+ virtual bool set_bb_range (const basic_block bb, const irange &r) OVERRIDE;
virtual bool get_bb_range (irange &r, const basic_block bb) OVERRIDE;
virtual bool bb_range_p (const basic_block bb) OVERRIDE;
private:
// Set the range on entry to basic block BB to R.
-void
+bool
sbr_sparse_bitmap::set_bb_range (const basic_block bb, const irange &r)
{
if (r.undefined_p ())
{
bitmap_set_quad (bitvec, bb->index, SBR_UNDEF);
- return;
+ return true;
}
// Loop thru the values to see if R is already present.
if (!m_range[x])
m_range[x] = m_irange_allocator->allocate (r);
bitmap_set_quad (bitvec, bb->index, x + 1);
- return;
+ return true;
}
// All values are taken, default to VARYING.
bitmap_set_quad (bitvec, bb->index, SBR_VARYING);
- return;
+ return false;
}
// Return the range associated with block BB in R. Return false if
// Set the range for NAME on entry to block BB to R.
// If it has not been accessed yet, allocate it first.
-void
+bool
block_range_cache::set_bb_range (tree name, const basic_block bb,
const irange &r)
{
m_irange_allocator);
}
}
- m_ssa_ranges[v]->set_bb_range (bb, r);
+ return m_ssa_ranges[v]->set_bb_range (bb, r);
}
// If the range on entry has changed, update it.
if (new_range != current_range)
{
+ bool ok_p = m_on_entry.set_bb_range (name, bb, new_range);
if (DEBUG_RANGE_CACHE)
{
- fprintf (dump_file, " Updating range to ");
- new_range.dump (dump_file);
+ if (!ok_p)
+ fprintf (dump_file, " Cache failure to store value.");
+ else
+ {
+ fprintf (dump_file, " Updating range to ");
+ new_range.dump (dump_file);
+ }
fprintf (dump_file, "\n Updating blocks :");
}
- m_on_entry.set_bb_range (name, bb, new_range);
// Mark each successor that has a range to re-check its range
FOR_EACH_EDGE (e, ei, bb->succs)
if (m_on_entry.bb_range_p (name, e->dest))
fprintf (dump_file, "\n");
}
}
- if (DEBUG_RANGE_CACHE)
- {
- fprintf (dump_file, "DONE visiting blocks for ");
- print_generic_expr (dump_file, name, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
+ if (DEBUG_RANGE_CACHE)
+ {
+ fprintf (dump_file, "DONE visiting blocks for ");
+ print_generic_expr (dump_file, name, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
}
// Check to see if an update to the value for NAME in BB has any effect