This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH Version 2][RFA]Improving register pressure directed hoist

I posted a patch improving register pressure directed hoist at
Turns out it has a mistake in update_bb_reg_pressure resulting in changing
register pressure incorrectly. Here comes the 2nd version patch for review.
Unfortunately and strangely, this correct patch isn't as good as the bogus
one. The improvement is as below:

Thumb1		0.17% (0.13% before)
ARM		0.15% (0.12% before)
AARCH64	0.33%
MIPS		0.24%
PowerPC	0.62%
Thumb2		X
x86		X
x86_64		X
X means no obvious effect on the corresponding target.

Though the effect is not as good as expected, I still think it worth to be
reviewed, because:
  a) it does improve code size a little bit on ARM target and introduces
fewer regression.
  b) it makes further optimization possible (for example, computing VBE
optimistically in compute_code_hoist_vbeinout). 

Also I don't understand why the bogus patch can catch more hoist
opportunities and improve code size, so please help if you have any idea
about this.

It is re-tested on x86. OK?

Thanks very much.

2012-11-02  Bin Cheng  <>

	* gcse.c: (struct bb_data): Add new fields, old_pressure, live_in
	and backup.
	(calculate_bb_reg_pressure): Initialize live_in and backup.
	(update_bb_reg_pressure): New.
	(should_hoist_expr_to_dom): Add new parameter from.
	Monitor the change of reg pressure and use it to drive hoisting.
	(hoist_code): Update LIVE and reg pressure information.

2012-11-02  Bin Cheng  <>

	* gcc.dg/hoist-register-pressure-3.c: New test.

Attachment: hoist-reg-pressure-20121101.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]