@@ -675,6 +675,7 @@ class FlowGraph
675
675
bool isStackCallFunc; // indicates the function itself is a STACK_CALL function
676
676
unsigned int autoLabelId;
677
677
G4_Kernel* pKernel; // back pointer to the kernel object
678
+ G4_Kernel* m_prevKernel; // back pointer to the previous kernel object
678
679
679
680
// map each BB to its local RA GRF usage summary, populated in local RA
680
681
std::map<G4_BB*, PhyRegSummary*> bbLocalRAMap;
@@ -852,6 +853,11 @@ class FlowGraph
852
853
return pKernel;
853
854
}
854
855
856
+ G4_Kernel* getPrevKernel ()
857
+ {
858
+ return m_prevKernel;
859
+ }
860
+
855
861
void mergeFReturns ();
856
862
857
863
G4_Declare*& getFramePtrDcl () {return framePtrDcl;}
@@ -926,6 +932,7 @@ class FlowGraph
926
932
927
933
// functions for structure analysis
928
934
G4_Kernel *getKernel () const { return pKernel; }
935
+ G4_Kernel* getPrevKernel () const { return m_prevKernel; }
929
936
G4_Label* insertEndif ( G4_BB* bb, unsigned char execSize, bool createLabel );
930
937
void setJIPForEndif ( G4_INST* endif, G4_INST* target, G4_BB* targetBB);
931
938
void convertGotoToJmpi (G4_INST *gotoInst)
@@ -963,10 +970,10 @@ class FlowGraph
963
970
FlowGraph (const FlowGraph&) = delete ;
964
971
FlowGraph& operator =(const FlowGraph&) = delete ;
965
972
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) :
967
974
traversalNum (0 ), numBBId(0 ), reducible(true ),
968
975
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),
970
977
kernelInfo(NULL ), builder(NULL ), globalOpndHT(m), framePtrDcl(NULL ),
971
978
stackPtrDcl(NULL ), scratchRegDcl(NULL ), pseudoVCEDcl(NULL ) {}
972
979
@@ -1461,15 +1468,15 @@ class G4_Kernel
1461
1468
unsigned char minor_version;
1462
1469
1463
1470
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 )
1465
1472
: m_options(options), RAType(RA_Type::UNKNOWN_RA),
1466
1473
asmInstCount (0 ), kernelID(0 ), tokenInstructionCount(0 ), tokenReuseCount(0 ),
1467
1474
AWTokenReuseCount(0 ), ARTokenReuseCount(0 ), AATokenReuseCount(0 ),
1468
1475
mathInstCount(0 ), syncInstCount(0 ),mathReuseCount(0 ),
1469
1476
ARSyncInstCount(0 ), AWSyncInstCount(0 ), ARSyncAllCount(0 ), AWSyncAllCount(0 ),
1470
1477
prunedDepEdges(0 ), prunedGlobalEdgeNum(0 ), prunedDiffBBEdgeNum(0 ), prunedDiffBBSameTokenEdgeNum(0 ),
1471
1478
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)
1473
1480
{
1474
1481
ASSERT_USER (
1475
1482
major < COMMON_ISA_MAJOR_VER ||
0 commit comments