comparison graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java @ 2722:23d0bcfa3c84

Removed two BlockBegin flags.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Thu, 19 May 2011 16:39:54 +0200
parents 3fbe58ac818d
children 173067211acb
comparison
equal deleted inserted replaced
2721:3fbe58ac818d 2722:23d0bcfa3c84
142 } 142 }
143 assert isVisited(cur) : "block must be visited when block is active"; 143 assert isVisited(cur) : "block must be visited when block is active";
144 assert parent != null : "must have parent"; 144 assert parent != null : "must have parent";
145 145
146 cur.setBlockFlag(BlockBegin.BlockFlag.LinearScanLoopHeader); 146 cur.setBlockFlag(BlockBegin.BlockFlag.LinearScanLoopHeader);
147 cur.setBlockFlag(BlockBegin.BlockFlag.BackwardBranchTarget);
148 147
149 parent.setBlockFlag(BlockBegin.BlockFlag.LinearScanLoopEnd); 148 parent.setBlockFlag(BlockBegin.BlockFlag.LinearScanLoopEnd);
150 149
151 loopEndBlocks.add(parent); 150 loopEndBlocks.add(parent);
152 return; 151 return;
378 for (BlockBegin sux : cur.end().blockSuccessors()) { 377 for (BlockBegin sux : cur.end().blockSuccessors()) {
379 assert sux.linearScanNumber() >= 0 && sux.linearScanNumber() == linearScanOrder.indexOf(sux) : "incorrect linearScanNumber"; 378 assert sux.linearScanNumber() >= 0 && sux.linearScanNumber() == linearScanOrder.indexOf(sux) : "incorrect linearScanNumber";
380 if (!cur.checkBlockFlag(BlockBegin.BlockFlag.LinearScanLoopEnd)) { 379 if (!cur.checkBlockFlag(BlockBegin.BlockFlag.LinearScanLoopEnd)) {
381 assert cur.linearScanNumber() < sux.linearScanNumber() : "invalid order"; 380 assert cur.linearScanNumber() < sux.linearScanNumber() : "invalid order";
382 } 381 }
383 //if (cur.loopDepth() == sux.loopDepth()) {
384 // assert cur.loopIndex() == sux.loopIndex() || sux.checkBlockFlag(BlockBegin.BlockFlag.LinearScanLoopHeader) : "successing blocks with same loop depth must have same loop index";
385 //}
386 } 382 }
387 383
388 for (Instruction pred : cur.blockPredecessors()) { 384 for (Instruction pred : cur.blockPredecessors()) {
389 BlockBegin begin = pred.block(); 385 BlockBegin begin = pred.block();
390 assert begin.linearScanNumber() >= 0 && begin.linearScanNumber() == linearScanOrder.indexOf(begin) : "incorrect linearScanNumber"; 386 assert begin.linearScanNumber() >= 0 && begin.linearScanNumber() == linearScanOrder.indexOf(begin) : "incorrect linearScanNumber";
391 if (!cur.checkBlockFlag(BlockBegin.BlockFlag.LinearScanLoopHeader)) { 387 if (!cur.checkBlockFlag(BlockBegin.BlockFlag.LinearScanLoopHeader)) {
392 assert cur.linearScanNumber() > begin.linearScanNumber() : "invalid order"; 388 assert cur.linearScanNumber() > begin.linearScanNumber() : "invalid order";
393 } 389 }
394 //if (cur.loopDepth() == begin.loopDepth()) { 390 }
395 // assert cur.loopIndex() == begin.loopIndex() || cur.checkBlockFlag(BlockBegin.BlockFlag.LinearScanLoopHeader) : "successing blocks with same loop depth must have same loop index"; 391 }
396 //}
397 }
398 }
399
400 // check that all loops are continuous
401 // for (int loopIdx = 0; loopIdx < numLoops; loopIdx++) {
402 // int blockIdx = 0;
403 // assert !isBlockInLoop(loopIdx, linearScanOrder.get(blockIdx)) : "the first block must not be present in any loop";
404 //
405 // // skip blocks before the loop
406 // while (blockIdx < numBlocks && !isBlockInLoop(loopIdx, linearScanOrder.get(blockIdx))) {
407 // blockIdx++;
408 // }
409 // // skip blocks of loop
410 // while (blockIdx < numBlocks && isBlockInLoop(loopIdx, linearScanOrder.get(blockIdx))) {
411 // blockIdx++;
412 // }
413 // // after the first non-loop block : there must not be another loop-block
414 // while (blockIdx < numBlocks) {
415 // assert !isBlockInLoop(loopIdx, linearScanOrder.get(blockIdx)) : "loop not continuous in linear-scan order";
416 // blockIdx++;
417 // }
418 // }
419 392
420 return true; 393 return true;
421 } 394 }
422 } 395 }