@@ -675,6 +675,7 @@ class FlowGraph
675675 bool isStackCallFunc; // indicates the function itself is a STACK_CALL function
676676 unsigned int autoLabelId;
677677 G4_Kernel* pKernel; // back pointer to the kernel object
678+ G4_Kernel* m_prevKernel; // back pointer to the previous kernel object
678679
679680 // map each BB to its local RA GRF usage summary, populated in local RA
680681 std::map<G4_BB*, PhyRegSummary*> bbLocalRAMap;
@@ -852,6 +853,11 @@ class FlowGraph
852853 return pKernel;
853854 }
854855
856+ G4_Kernel* getPrevKernel ()
857+ {
858+ return m_prevKernel;
859+ }
860+
855861 void mergeFReturns ();
856862
857863 G4_Declare*& getFramePtrDcl () {return framePtrDcl;}
@@ -926,6 +932,7 @@ class FlowGraph
926932
927933 // functions for structure analysis
928934 G4_Kernel *getKernel () const { return pKernel; }
935+ G4_Kernel* getPrevKernel () const { return m_prevKernel; }
929936 G4_Label* insertEndif ( G4_BB* bb, unsigned char execSize, bool createLabel );
930937 void setJIPForEndif ( G4_INST* endif, G4_INST* target, G4_BB* targetBB);
931938 void convertGotoToJmpi (G4_INST *gotoInst)
@@ -963,10 +970,10 @@ class FlowGraph
963970 FlowGraph (const FlowGraph&) = delete ;
964971 FlowGraph& operator =(const FlowGraph&) = delete ;
965972
966- FlowGraph (INST_LIST_NODE_ALLOCATOR& alloc, G4_Kernel* kernel, Mem_Manager& m) :
973+ FlowGraph (INST_LIST_NODE_ALLOCATOR& alloc, G4_Kernel* kernel, G4_Kernel* prevKernel, Mem_Manager& m) :
967974 traversalNum (0 ), numBBId(0 ), reducible(true ),
968975 doIPA (false ), hasStackCalls(false ), isStackCallFunc(false ), autoLabelId(0 ),
969- pKernel(kernel), mem(m), instListAlloc(alloc),
976+ pKernel(kernel), m_prevKernel(prevKernel), mem(m), instListAlloc(alloc),
970977 kernelInfo(NULL ), builder(NULL ), globalOpndHT(m), framePtrDcl(NULL ),
971978 stackPtrDcl(NULL ), scratchRegDcl(NULL ), pseudoVCEDcl(NULL ) {}
972979
@@ -1461,15 +1468,15 @@ class G4_Kernel
14611468 unsigned char minor_version;
14621469
14631470 G4_Kernel (INST_LIST_NODE_ALLOCATOR& alloc,
1464- Mem_Manager &m, Options *options, unsigned char major, unsigned char minor)
1471+ Mem_Manager &m, Options *options, unsigned char major, unsigned char minor, G4_Kernel *prevKernel )
14651472 : m_options(options), RAType(RA_Type::UNKNOWN_RA),
14661473 asmInstCount (0 ), kernelID(0 ), tokenInstructionCount(0 ), tokenReuseCount(0 ),
14671474 AWTokenReuseCount(0 ), ARTokenReuseCount(0 ), AATokenReuseCount(0 ),
14681475 mathInstCount(0 ), syncInstCount(0 ),mathReuseCount(0 ),
14691476 ARSyncInstCount(0 ), AWSyncInstCount(0 ), ARSyncAllCount(0 ), AWSyncAllCount(0 ),
14701477 prunedDepEdges(0 ), prunedGlobalEdgeNum(0 ), prunedDiffBBEdgeNum(0 ), prunedDiffBBSameTokenEdgeNum(0 ),
14711478 bank_good_num(0 ), bank_ok_num(0 ),
1472- bank_bad_num(0 ), fg(alloc, this , m), major_version(major), minor_version(minor)
1479+ bank_bad_num(0 ), fg(alloc, this , prevKernel, m), major_version(major), minor_version(minor)
14731480 {
14741481 ASSERT_USER (
14751482 major < COMMON_ISA_MAJOR_VER ||
0 commit comments