diff --git a/runtime/compiler/codegen/CodeGenPhaseToPerform.hpp b/runtime/compiler/codegen/CodeGenPhaseToPerform.hpp index 2eeb924b32..5b6989728c 100644 --- a/runtime/compiler/codegen/CodeGenPhaseToPerform.hpp +++ b/runtime/compiler/codegen/CodeGenPhaseToPerform.hpp @@ -41,7 +41,6 @@ LowerTreesPhase, InsertDebugCountersPhase, CompressedReferenceRematerializationPhase, - SplitWarmAndColdBlocksPhase, AllocateLinkageRegisters, IdentifyUnneededByteConvsPhase, diff --git a/runtime/compiler/codegen/J9CodeGenPhase.cpp b/runtime/compiler/codegen/J9CodeGenPhase.cpp index b6f9b3afd2..63044aa452 100644 --- a/runtime/compiler/codegen/J9CodeGenPhase.cpp +++ b/runtime/compiler/codegen/J9CodeGenPhase.cpp @@ -118,12 +118,6 @@ J9::CodeGenPhase::performCompressedReferenceRematerializationPhase(TR::CodeGener cg->compressedReferenceRematerialization(); } -void -J9::CodeGenPhase::performSplitWarmAndColdBlocksPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *) - { - cg->splitWarmAndColdBlocks(); - } - const char * J9::CodeGenPhase::getName() { @@ -145,8 +139,6 @@ J9::CodeGenPhase::getName(TR::CodeGenPhase::PhaseValue phase) return "InsertEpilogueYieldPoints"; case CompressedReferenceRematerializationPhase: return "CompressedReferenceRematerialization"; - case SplitWarmAndColdBlocksPhase: - return "SplitWarmAndColdBlocks"; case IdentifyUnneededByteConvsPhase: return "IdentifyUnneededByteConvsPhase"; case LateSequentialConstantStoreSimplificationPhase: diff --git a/runtime/compiler/codegen/J9CodeGenPhase.hpp b/runtime/compiler/codegen/J9CodeGenPhase.hpp index 541e1a6142..7d4ce8b8ae 100644 --- a/runtime/compiler/codegen/J9CodeGenPhase.hpp +++ b/runtime/compiler/codegen/J9CodeGenPhase.hpp @@ -53,7 +53,6 @@ class OMR_EXTENSIBLE CodeGenPhase: public OMR::CodeGenPhaseConnector static void performMoveUpArrayLengthStoresPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *); static void performInsertEpilogueYieldPointsPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *); static void performCompressedReferenceRematerializationPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *); - static void performSplitWarmAndColdBlocksPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *); static void performIdentifyUnneededByteConvsPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *); static void performLateSequentialConstantStoreSimplificationPhase(TR::CodeGenerator * cg, TR::CodeGenPhase *); diff --git a/runtime/compiler/codegen/J9CodeGenPhaseEnum.hpp b/runtime/compiler/codegen/J9CodeGenPhaseEnum.hpp index 60023faff2..42253ef551 100644 --- a/runtime/compiler/codegen/J9CodeGenPhaseEnum.hpp +++ b/runtime/compiler/codegen/J9CodeGenPhaseEnum.hpp @@ -35,7 +35,6 @@ MoveUpArrayLengthStoresPhase, InsertEpilogueYieldPointsPhase, CompressedReferenceRematerializationPhase, - SplitWarmAndColdBlocksPhase, IdentifyUnneededByteConvsPhase, LateSequentialConstantStoreSimplificationPhase, // all LastJ9Phase = LateSequentialConstantStoreSimplificationPhase, diff --git a/runtime/compiler/codegen/J9CodeGenPhaseFunctionTable.hpp b/runtime/compiler/codegen/J9CodeGenPhaseFunctionTable.hpp index 857651a83a..e433513518 100644 --- a/runtime/compiler/codegen/J9CodeGenPhaseFunctionTable.hpp +++ b/runtime/compiler/codegen/J9CodeGenPhaseFunctionTable.hpp @@ -34,6 +34,5 @@ TR::CodeGenPhase::performMoveUpArrayLengthStoresPhase, //MoveUpArrayLengthStoresPhase TR::CodeGenPhase::performInsertEpilogueYieldPointsPhase, //InsertEpilogueYieldPointsPhase TR::CodeGenPhase::performCompressedReferenceRematerializationPhase, - TR::CodeGenPhase::performSplitWarmAndColdBlocksPhase, TR::CodeGenPhase::performIdentifyUnneededByteConvsPhase, //IdentifyUnneededByteConvsPhase TR::CodeGenPhase::performLateSequentialConstantStoreSimplificationPhase, //LateSequentialConstantStoreSimplificationPhase diff --git a/runtime/compiler/codegen/J9CodeGenerator.cpp b/runtime/compiler/codegen/J9CodeGenerator.cpp index f40baa4d63..58513a533d 100644 --- a/runtime/compiler/codegen/J9CodeGenerator.cpp +++ b/runtime/compiler/codegen/J9CodeGenerator.cpp @@ -2266,143 +2266,6 @@ J9::CodeGenerator::doInstructionSelection() diagnostic("\n"); } - -// J9, Z -// -// This can surely be done more efficiently. Walk the CFG and go block by block -// rather than iterating through TreeTops looking for BBStarts. -// -void -J9::CodeGenerator::splitWarmAndColdBlocks() - { - if (!self()->allowSplitWarmAndColdBlocks() || self()->comp()->compileRelocatableCode()) - { - return; - } - - TR::Block * block = NULL; - TR::TreeTop * tt; - TR::Node * node; - TR::Block * firstColdBlock = NULL, * firstColdExtendedBlock = NULL; - - for (tt = self()->comp()->getStartTree(); tt; tt = tt->getNextTreeTop()) - { - node = tt->getNode(); - - if (node->getOpCodeValue() == TR::BBStart) - { - block = node->getBlock(); - - // If this is the first cold block, remember where the warm blocks ended. - // If it is a warm block and cold blocks have already been found, they - // are treated as warm. - // - if (block->isCold()) - { - if (!firstColdBlock) - firstColdBlock = block; - } - else - { - firstColdBlock = NULL; - firstColdExtendedBlock = NULL; - } - - if (!block->isExtensionOfPreviousBlock()) - { - if (firstColdBlock && !firstColdExtendedBlock) - { - if (!block->getPrevBlock() || - !block->getPrevBlock()->canFallThroughToNextBlock()) - firstColdExtendedBlock = block; - else - firstColdBlock = NULL; - } - } - } - } - - // Mark the split point between warm and cold blocks, so they can be - // allocated in different code sections. - // - TR::Block *lastWarmBlock; - if (firstColdExtendedBlock) - { - lastWarmBlock = firstColdExtendedBlock->getPrevBlock(); - if (!lastWarmBlock) - { - // All the blocks are cold: insert a new goto block ahead of real blocks - lastWarmBlock = TR::TransformUtil::insertNewFirstBlockForCompilation(self()->comp()); - } - } - else - { - // All the blocks are warm - the split point is between the last - // instruction and the snippets. - // - lastWarmBlock = block; - } - - // If the last tree in the last warm block is not a TR::Goto, insert a goto tree - // at the end of the block. - // If there is a following block the goto will branch to it so that when the - // code is split any fall-through will go to the right place. - // If there is no following block the goto will branch to the first block; in - // this case the goto should never be reached, it is there only to - // make sure that the instruction following the last real treetop will be in - // warm code, so if it is a helper call (e.g. for a throw) the return address - // is in this method's code. - // - if (lastWarmBlock->getNumberOfRealTreeTops() == 0) - tt = lastWarmBlock->getEntry(); - else - tt = lastWarmBlock->getLastRealTreeTop(); - - node = tt->getNode(); - - if (!(node->getOpCode().isGoto() || node->getOpCode().isJumpWithMultipleTargets() || node->getOpCode().isReturn())) - { - // Find the block to be branched to - // - TR::TreeTop * targetTreeTop = lastWarmBlock->getExit()->getNextTreeTop(); - if (targetTreeTop) - { - // Branch to following block. Make sure it is not marked as an - // extension block so that it will get a label generated. - // - targetTreeTop->getNode()->getBlock()->setIsExtensionOfPreviousBlock(false); - } - else - { - // Branch to the first block. This will not be marked as an extension - // block. - targetTreeTop = self()->comp()->getStartBlock()->getEntry(); - } - - // Generate the goto and insert it into the end of the last warm block. - // - TR::TreeTop *gotoTreeTop = TR::TreeTop::create(self()->comp(), TR::Node::create(node, TR::Goto, 0, targetTreeTop)); - - // Move reg deps from BBEnd to goto - // - TR::Node *bbEnd = lastWarmBlock->getExit()->getNode(); - if (bbEnd->getNumChildren() > 0) - { - TR::Node *glRegDeps = bbEnd->getChild(0); - - gotoTreeTop->getNode()->setNumChildren(1); - gotoTreeTop->getNode()->setChild(0, glRegDeps); - - bbEnd->setChild(0,NULL); - bbEnd->setNumChildren(0); - } - - tt->insertAfter(gotoTreeTop); - } - - } - - void J9::CodeGenerator::populateOSRBuffer() { diff --git a/runtime/compiler/codegen/J9CodeGenerator.hpp b/runtime/compiler/codegen/J9CodeGenerator.hpp index 7a035fc642..233bfb4274 100644 --- a/runtime/compiler/codegen/J9CodeGenerator.hpp +++ b/runtime/compiler/codegen/J9CodeGenerator.hpp @@ -101,8 +101,6 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGeneratorConnector void insertEpilogueYieldPoints(); - void splitWarmAndColdBlocks(); // J9 & Z - void allocateLinkageRegisters(); void fixUpProfiledInterfaceGuardTest(); diff --git a/runtime/compiler/z/codegen/CodeGenPhaseToPerform.hpp b/runtime/compiler/z/codegen/CodeGenPhaseToPerform.hpp index c28fb50585..6d821251e1 100644 --- a/runtime/compiler/z/codegen/CodeGenPhaseToPerform.hpp +++ b/runtime/compiler/z/codegen/CodeGenPhaseToPerform.hpp @@ -42,7 +42,6 @@ LowerTreesPhase, InsertDebugCountersPhase, CompressedReferenceRematerializationPhase, - SplitWarmAndColdBlocksPhase, AllocateLinkageRegisters, markLoadAsZeroOrSignExtension, diff --git a/runtime/compiler/z/codegen/J9CodeGenerator.hpp b/runtime/compiler/z/codegen/J9CodeGenerator.hpp index d37c31d001..ed09dfdf9d 100644 --- a/runtime/compiler/z/codegen/J9CodeGenerator.hpp +++ b/runtime/compiler/z/codegen/J9CodeGenerator.hpp @@ -231,8 +231,6 @@ class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator bool canCopyWithOneOrTwoInstrs(char *lit, size_t size); bool inlineSmallLiteral(size_t srcSize, char *srcLiteral, size_t destSize, bool trace); - bool allowSplitWarmAndColdBlocks() { return true; } - #if defined(J9VM_JIT_FREE_SYSTEM_STACK_POINTER) /** \brief * Determines whether the JIT supports freeing up the system stack pointer (SSP) for register allocation.