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]

Re: 0005-Search-all-dominated-blocks-for-expressions-to-hoist.patch

On 7/19/10 10:39 PM, Maxim Kuvyrkov wrote:
On 7/19/10 10:08 PM, Jeff Law wrote:


+ if (!pre_p && MEM_P (e->expr))
+ /* Note memory references that can be clobbered by a call.
+ We do not split abnormal edges in HOIST, so would
+ a memory reference get hoisted along an abnormal edge,
+ it would be placed /before/ the call. Therefore, only
+ constant memory references can be hoisted along abnormal
+ edges. */
+ {
+ if (GET_CODE (XEXP (e->expr, 0)) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (XEXP (e->expr, 0)))
+ continue;

This is the only part I'm struggling with. It looks like you're trying to avoid setting prune_exprs if the MEM's address has certain properties (such as a reference to static memory). However, if my analysis of the problem is correct, that's not sufficient to solve the problem.

This code comes straight from compute_transpout.

Why do you think these checks aren't sufficient? A memory reference to a
constant pool is, well, a constant.

It may be that the second check

if (MEM_READONLY_P (e->expr)
&& !MEM_VOLATILE_P (e->expr)
&& MEM_NOTRAP_P (e->expr))
/* Constant memory reference, e.g., a PIC address. */

implies CONSTANT_POOL_ADDRESS_P, but I prefer to err on the side of
caution have both checks in place.

Maxim Kuvyrkov
(650) 331-3385 x724

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