View | Details | Raw Unified | Return to bug 53125
Collapse All | Expand All

(-)regstat.c (-14 / +10 lines)
Lines 119-125 size_t reg_info_p_size; Link Here
119
static void
119
static void
120
regstat_bb_compute_ri (unsigned int bb_index,
120
regstat_bb_compute_ri (unsigned int bb_index,
121
		       bitmap live, bitmap do_not_gen, bitmap artificial_uses,
121
		       bitmap live, bitmap do_not_gen, bitmap artificial_uses,
122
		       bitmap local_live, bitmap local_processed)
122
		       bitmap local_processed, int *local_live_last_luid)
123
{
123
{
124
  basic_block bb = BASIC_BLOCK (bb_index);
124
  basic_block bb = BASIC_BLOCK (bb_index);
125
  rtx insn;
125
  rtx insn;
Lines 168-180 regstat_bb_compute_ri (unsigned int bb_i Link Here
168
      if (!NONDEBUG_INSN_P (insn))
168
      if (!NONDEBUG_INSN_P (insn))
169
	continue;
169
	continue;
170
170
171
      /* Increment the live_length for all of the registers that
172
	 are are referenced in this block and live at this
173
	 particular point.  */
174
      EXECUTE_IF_SET_IN_BITMAP (local_live, 0, regno, bi)
175
	{
176
	  REG_LIVE_LENGTH (regno)++;
177
	}
178
      luid++;
171
      luid++;
179
172
180
      bitmap_clear (do_not_gen);
173
      bitmap_clear (do_not_gen);
Lines 262-268 regstat_bb_compute_ri (unsigned int bb_i Link Here
262
		  if (bitmap_bit_p (local_processed, dregno))
255
		  if (bitmap_bit_p (local_processed, dregno))
263
		    {
256
		    {
264
		      if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
257
		      if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
265
			bitmap_clear_bit (local_live, dregno);
258
			{
259
			  int len2add = (luid - local_live_last_luid[regno]);
260
			  REG_LIVE_LENGTH (regno) += len2add;
261
			}
266
		    }
262
		    }
267
		  else
263
		  else
268
		    {
264
		    {
Lines 320-326 regstat_bb_compute_ri (unsigned int bb_i Link Here
320
		 since just a ref inside the block does not effect the
316
		 since just a ref inside the block does not effect the
321
		 calculations.  */
317
		 calculations.  */
322
	      REG_LIVE_LENGTH (uregno) ++;
318
	      REG_LIVE_LENGTH (uregno) ++;
323
	      bitmap_set_bit (local_live, uregno);
319
	      local_live_last_luid[uregno] = luid;
324
	      bitmap_set_bit (local_processed, uregno);
320
	      bitmap_set_bit (local_processed, uregno);
325
	    }
321
	    }
326
	}
322
	}
Lines 333-339 regstat_bb_compute_ri (unsigned int bb_i Link Here
333
    REG_LIVE_LENGTH (regno) += luid;
329
    REG_LIVE_LENGTH (regno) += luid;
334
330
335
  bitmap_clear (local_processed);
331
  bitmap_clear (local_processed);
336
  bitmap_clear (local_live);
337
}
332
}
338
333
339
334
Lines 345-354 regstat_compute_ri (void) Link Here
345
  bitmap live = BITMAP_ALLOC (&df_bitmap_obstack);
340
  bitmap live = BITMAP_ALLOC (&df_bitmap_obstack);
346
  bitmap do_not_gen = BITMAP_ALLOC (&df_bitmap_obstack);
341
  bitmap do_not_gen = BITMAP_ALLOC (&df_bitmap_obstack);
347
  bitmap artificial_uses = BITMAP_ALLOC (&df_bitmap_obstack);
342
  bitmap artificial_uses = BITMAP_ALLOC (&df_bitmap_obstack);
348
  bitmap local_live = BITMAP_ALLOC (&df_bitmap_obstack);
349
  bitmap local_processed = BITMAP_ALLOC (&df_bitmap_obstack);
343
  bitmap local_processed = BITMAP_ALLOC (&df_bitmap_obstack);
350
  unsigned int regno;
344
  unsigned int regno;
351
  bitmap_iterator bi;
345
  bitmap_iterator bi;
346
  int *local_live_last_luid;
352
347
353
  /* Initialize everything.  */
348
  /* Initialize everything.  */
354
349
Lines 359-374 regstat_compute_ri (void) Link Here
359
  max_regno = max_reg_num ();
354
  max_regno = max_reg_num ();
360
  reg_info_p_size = max_regno;
355
  reg_info_p_size = max_regno;
361
  reg_info_p = XCNEWVEC (struct reg_info_t, max_regno);
356
  reg_info_p = XCNEWVEC (struct reg_info_t, max_regno);
357
  local_live_last_luid = XNEWVEC (int, max_regno);
362
358
363
  FOR_EACH_BB (bb)
359
  FOR_EACH_BB (bb)
364
    {
360
    {
365
      regstat_bb_compute_ri (bb->index, live, do_not_gen, artificial_uses,
361
      regstat_bb_compute_ri (bb->index, live, do_not_gen, artificial_uses,
366
			     local_live, local_processed);
362
			     local_processed, local_live_last_luid);
367
    }
363
    }
368
364
369
  BITMAP_FREE (live);
365
  BITMAP_FREE (live);
370
  BITMAP_FREE (do_not_gen);
366
  BITMAP_FREE (do_not_gen);
371
  BITMAP_FREE (artificial_uses);
367
  BITMAP_FREE (artificial_uses);
368
  free (local_live_last_luid);
372
369
373
  /* See the setjmp comment in regstat_ri_bb_compute.  */
370
  /* See the setjmp comment in regstat_ri_bb_compute.  */
374
  EXECUTE_IF_SET_IN_BITMAP (setjmp_crosses, FIRST_PSEUDO_REGISTER, regno, bi)
371
  EXECUTE_IF_SET_IN_BITMAP (setjmp_crosses, FIRST_PSEUDO_REGISTER, regno, bi)
Lines 377-383 regstat_compute_ri (void) Link Here
377
      REG_LIVE_LENGTH (regno) = -1;
374
      REG_LIVE_LENGTH (regno) = -1;
378
    }
375
    }
379
376
380
  BITMAP_FREE (local_live);
381
  BITMAP_FREE (local_processed);
377
  BITMAP_FREE (local_processed);
382
  timevar_pop (TV_REG_STATS);
378
  timevar_pop (TV_REG_STATS);
383
}
379
}

Return to bug 53125