elementsInSet (theLoop->exits));
/* find out if we have a function call in this block */
- for (ic = lBlock->sch, fCallsInBlock=0; ic; ic = ic->next) {
- if (SKIP_IC(ic)) {
- fCallsInBlock++;
+ for (ic = lBlock->sch, fCallsInBlock=0; ic; ic = ic->next)
+ {
+ if (SKIP_IC(ic))
+ {
+ fCallsInBlock++;
+ }
}
- }
/* now we go thru the instructions of this block and */
/* collect those instructions with invariant operands */
here and the definition, but I am too lazy to do that now */
/* if there are function calls in this block */
- if (fCallsInBlock) {
+ if (fCallsInBlock)
+ {
+ /* if this is a pointer get */
+ if (POINTER_GET(ic))
+ {
+ continue;
+ }
- /* if this is a pointer get */
- if (POINTER_GET(ic)) {
- continue;
- }
+ /* if this is an assignment from a global */
+ if (ic->op=='=' && isOperandGlobal(IC_RIGHT(ic)))
+ {
+ continue;
+ }
- /* if this is an assignment from a global */
- if (ic->op=='=' && isOperandGlobal(IC_RIGHT(ic))) {
- continue;
+ /* Bug 1717943,
+ * if this is an assignment to a global */
+ if (ic->op=='=' && isOperandGlobal(IC_RESULT(ic)))
+ {
+ continue;
+ }
}
- }
if (SKIP_IC (ic) || POINTER_SET (ic) || ic->op == IFX)
continue;
if (ic->op == ADDRESS_OF &&
IS_SYMOP (IC_LEFT (ic)) &&
IS_AGGREGATE (operandType (IC_LEFT (ic))))
- lin++;
- else {
- /* check if left operand is an invariant */
- if ((lin = isOperandInvariant (IC_LEFT (ic), theLoop, lInvars)))
- /* if this is a pointer get then make sure
- that the pointer set does not exist in
- any of the blocks */
- if (POINTER_GET (ic) &&
- (applyToSet (theLoop->regBlocks,
- pointerAssigned, IC_LEFT (ic))))
- lin = 0;
- }
+ {
+ lin++;
+ }
+ else
+ {
+ /* check if left operand is an invariant */
+ if ((lin = isOperandInvariant (IC_LEFT (ic), theLoop, lInvars)) &&
+ /* if this is a pointer get then make sure
+ that the pointer set does not exist in
+ any of the blocks */
+ POINTER_GET (ic) &&
+ applyToSet (theLoop->regBlocks, pointerAssigned, IC_LEFT (ic)))
+ {
+ lin = 0;
+ }
+ }
/* do the same for right */
rin = isOperandInvariant (IC_RIGHT (ic), theLoop, lInvars);