This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [killloop] Ivopts cleanups & improvements
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 31 Aug 2005 12:14:18 +0200
- Subject: Re: [killloop] Ivopts cleanups & improvements
- References: <20050831100809.GA666@atrey.karlin.mff.cuni.cz>
! /* The expected number of loop iterations. The plus one is because
! expected_loop_iterations returns number of executions of latch
! edge, not of loop body. */
! #define AVG_LOOP_NITER(LOOP) (expected_loop_iterations (LOOP) + 1)
+ /* Cost accounted for computations that are performed before the loop. */
+
+ #define BEFORE_LOOP_COST(LOOP, COST) \
+ (((COST) + AVG_LOOP_NITER (LOOP) - 1) / AVG_LOOP_NITER (LOOP))
Do these really need to be #defines?
Paolo