Skip to content

Commit 7817fb8

Browse files
committed
Rename SideTableIndex to LocalIndex
The SideTableIndex isn't actually used to index a side table most of the time, but rather is used to hold optimization-local data. Rename methods getSideTableIndex, setSideTableIndex, incSideTableIndex, and decSideTableIndex (definitions and uses). Rename SideTableIndex variables, comments, and TR_ASSERT messages. Signed-off-by: Aman Kumar <amank@ca.ibm.com>
1 parent 781a2f6 commit 7817fb8

33 files changed

+716
-716
lines changed

compiler/codegen/CodeGenRA.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ OMR::CodeGenerator::estimateRegisterPressure(TR::Node *node, int32_t &registerPr
125125
{
126126
if (node->getVisitCount() == visitCount)
127127
{
128-
node->setSideTableIndex(node->getSideTableIndex()-1);
129-
if (node->getSideTableIndex() == 0)
128+
node->setLocalIndex(node->getLocalIndex()-1);
129+
if (node->getLocalIndex() == 0)
130130
{
131131

132132
if (node->getOpCode().isLoadVar() &&
@@ -161,9 +161,9 @@ OMR::CodeGenerator::estimateRegisterPressure(TR::Node *node, int32_t &registerPr
161161

162162
node->setVisitCount(visitCount);
163163
if (node->getReferenceCount() > 0)
164-
node->setSideTableIndex(node->getReferenceCount()-1);
164+
node->setLocalIndex(node->getReferenceCount()-1);
165165
else
166-
node->setSideTableIndex(0);
166+
node->setLocalIndex(0);
167167

168168
int32_t childCount;
169169
for (childCount = node->getNumChildren()-1; childCount >= 0; childCount--)
@@ -191,7 +191,7 @@ OMR::CodeGenerator::estimateRegisterPressure(TR::Node *node, int32_t &registerPr
191191
// Allow these call-like opcodes in cold blocks
192192
// as we can afford to spill in cold blocks
193193
//
194-
if (node->getSideTableIndex() > 0)
194+
if (node->getLocalIndex() > 0)
195195
{
196196
if (node->getOpCode().isLoadVar() &&
197197
node->getSymbol()->isAutoOrParm() &&

compiler/codegen/OMRCodeGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,11 @@ OMR::CodeGenerator::lowerTreesPropagateBlockToNode(TR::Node *node)
446446

447447
if (self()->comp()->getFlowGraph()->getNextNodeNumber() < SHRT_MAX)
448448
{
449-
node->setSideTableIndex(self()->getCurrentBlock()->getNumber());
449+
node->setLocalIndex(self()->getCurrentBlock()->getNumber());
450450
}
451451
else
452452
{
453-
node->setSideTableIndex(-1);
453+
node->setLocalIndex(-1);
454454
}
455455

456456
}

compiler/il/OMRNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ OMR::Node::Node(TR::Node *originatingByteCodeNode, TR::ILOpCodes op, uint16_t nu
151151
self()->setNodePoolIndex(comp->getNodePool().getLastPoolIndex());
152152
self()->setReferenceCount(0);
153153
self()->setVisitCount(0);
154-
self()->setSideTableIndex(0);
154+
self()->setLocalIndex(0);
155155
memset( &(self()->getOptAttributes()->_unionA), 0, sizeof( self()->getOptAttributes()->_unionA ) );
156156
if (self()->getGlobalIndex() == MAX_NODE_COUNT)
157157
{
@@ -241,7 +241,7 @@ OMR::Node::Node(TR::Node * from, uint16_t numChildren)
241241
// opt attributes are separate, and need separate initialization.
242242
self()->setReferenceCount(from->getReferenceCount());
243243
self()->setVisitCount(from->getVisitCount());
244-
self()->setSideTableIndex(from->getSideTableIndex());
244+
self()->setLocalIndex(from->getLocalIndex());
245245
self()->getOptAttributes()->_unionA = from->getOptAttributes()->_unionA;
246246

247247
if (self()->getGlobalIndex() == MAX_NODE_COUNT)

compiler/il/OMRNode.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ typedef uint32_t ncount_t;
7979
typedef uint32_t rcount_t;
8080
#define MAX_RCOUNT UINT_MAX
8181

82-
/// Node side table indexes
82+
/// Node local indexes
8383
///
8484
typedef uint32_t scount_t;
8585
#define MAX_SCOUNT UINT_MAX
8686
#define SCOUNT_HIGH_BIT 0x80000000
87-
#define NULL_USEDEF_SYMBOL_INDEX 0xFFFF //TODO: should be 0xFFFF until we change the date type of _sideTableIndex in Symbol.hpp
87+
#define NULL_USEDEF_SYMBOL_INDEX 0xFFFF //TODO: should be 0xFFFF until we change the date type of _localIndex in Symbol.hpp
8888

8989
/// Visit counts
9090
///
@@ -678,13 +678,13 @@ class OMR_EXTENSIBLE Node
678678
rcount_t recursivelyDecReferenceCount();
679679
void recursivelyDecReferenceCountFromCodeGen();
680680

681-
inline scount_t getSideTableIndex();
682-
inline scount_t setSideTableIndex(scount_t sti);
683-
inline scount_t incSideTableIndex();
684-
inline scount_t decSideTableIndex();
681+
inline scount_t getLocalIndex();
682+
inline scount_t setLocalIndex(scount_t li);
683+
inline scount_t incLocalIndex();
684+
inline scount_t decLocalIndex();
685685

686686
inline scount_t getFutureUseCount();
687-
inline scount_t setFutureUseCount(scount_t sti);
687+
inline scount_t setFutureUseCount(scount_t li);
688688
inline scount_t incFutureUseCount();
689689
inline scount_t decFutureUseCount();
690690

compiler/il/OMRNode_inlines.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,26 +309,26 @@ OMR::Node::decReferenceCount()
309309
}
310310

311311
scount_t
312-
OMR::Node::getSideTableIndex()
312+
OMR::Node::getLocalIndex()
313313
{
314314
return self()->getOptAttributes()->_localIndex;
315315
}
316316

317317
scount_t
318-
OMR::Node::setSideTableIndex(scount_t sti)
318+
OMR::Node::setLocalIndex(scount_t li)
319319
{
320-
return (self()->getOptAttributes()->_localIndex = sti);
320+
return (self()->getOptAttributes()->_localIndex = li);
321321
}
322322

323323
scount_t
324-
OMR::Node::incSideTableIndex()
324+
OMR::Node::incLocalIndex()
325325
{
326326
++self()->getOptAttributes()->_localIndex;
327327
TR_ASSERT(self()->getOptAttributes()->_localIndex>0, "assertion failure"); return self()->getOptAttributes()->_localIndex;
328328
}
329329

330330
scount_t
331-
OMR::Node::decSideTableIndex()
331+
OMR::Node::decLocalIndex()
332332
{
333333
TR_ASSERT(self()->getOptAttributes()->_localIndex > 0, "assertion failure"); return --self()->getOptAttributes()->_localIndex;
334334
}
@@ -340,9 +340,9 @@ OMR::Node::getFutureUseCount()
340340
}
341341

342342
scount_t
343-
OMR::Node::setFutureUseCount(scount_t sti)
343+
OMR::Node::setFutureUseCount(scount_t li)
344344
{
345-
return (self()->getOptAttributes()->_localIndex = (scount_t)sti);
345+
return (self()->getOptAttributes()->_localIndex = (scount_t)li);
346346
}
347347

348348
scount_t

compiler/il/symbol/OMRSymbol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ OMR::Symbol::Symbol(TR::DataTypes d) :
7676
_name(0),
7777
_flags(0),
7878
_flags2(0),
79-
_sideTableIndex(0),
79+
_localIndex(0),
8080
_restrictedRegisterNumber(-1)
8181
{
8282
self()->setDataType(d);
@@ -86,7 +86,7 @@ OMR::Symbol::Symbol(TR::DataTypes d, uint32_t size) :
8686
_name(0),
8787
_flags(0),
8888
_flags2(0),
89-
_sideTableIndex(0),
89+
_localIndex(0),
9090
_restrictedRegisterNumber(-1)
9191
{
9292
self()->setDataType(d);

compiler/il/symbol/OMRSymbol.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class OMR_EXTENSIBLE Symbol
100100
_name(0),
101101
_flags(0),
102102
_flags2(0),
103-
_sideTableIndex(0),
103+
_localIndex(0),
104104
_restrictedRegisterNumber(-1)
105105
{ }
106106

@@ -198,8 +198,8 @@ class OMR_EXTENSIBLE Symbol
198198
uint32_t getFlags2() { return _flags2.getValue(); }
199199
void setFlagValue(uint32_t v, bool b) { _flags.setValue(v, b); }
200200

201-
uint16_t getSideTableIndex() { return _sideTableIndex; }
202-
uint16_t setSideTableIndex(uint16_t sti) { return (_sideTableIndex = sti); }
201+
uint16_t getLocalIndex() { return _localIndex; }
202+
uint16_t setLocalIndex(uint16_t li) { return (_localIndex = li); }
203203

204204
uint8_t getRestrictedRegisterNumber() { return _restrictedRegisterNumber; }
205205

@@ -564,7 +564,7 @@ class OMR_EXTENSIBLE Symbol
564564
const char * _name;
565565
flags32_t _flags;
566566
flags32_t _flags2;
567-
uint16_t _sideTableIndex;
567+
uint16_t _localIndex;
568568
uint8_t _restrictedRegisterNumber;
569569

570570

compiler/infra/ILWalk.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ class ILValidator
367367
class LiveNodeWindow
368368
{
369369
// This is like a NodeChecklist, but more compact. Rather than track
370-
// node global indexes, which can be sparse, this tracks side table
370+
// node global indexes, which can be sparse, this tracks local
371371
// indexes, which are relatively dense. Furthermore, the _basis field
372372
// allows us not to waste space on nodes we saw in prior blocks.
373373

compiler/optimizer/CompactLocals.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ int32_t TR_CompactLocals::perform()
158158

159159
for (p = locals.getFirst(); p != NULL; p = locals.getNext())
160160
{
161-
p->setSideTableIndex(0);
161+
p->setLocalIndex(0);
162162
(*_localIndexToSymbolMap)[p->getLiveLocalIndex()] = p;
163163

164164
if (eligibleLocal(p))
@@ -316,7 +316,7 @@ void TR_CompactLocals::processNodeInPreorder(TR::Node *node,
316316
if (node->getVisitCount() != visitCount)
317317
{
318318
node->setVisitCount(visitCount);
319-
node->setSideTableIndex(node->getReferenceCount());
319+
node->setLocalIndex(node->getReferenceCount());
320320
}
321321

322322
if (trace())
@@ -341,7 +341,7 @@ void TR_CompactLocals::processNodeInPreorder(TR::Node *node,
341341
// This local is killed only if the live range of any loads of this symbol do not overlap
342342
// with this store.
343343
//
344-
if (local->getSideTableIndex() == 0)
344+
if (local->getLocalIndex() == 0)
345345
{
346346
_liveVars->reset(localIndex);
347347
if (trace())
@@ -362,12 +362,12 @@ void TR_CompactLocals::processNodeInPreorder(TR::Node *node,
362362

363363
// First visit to this node.
364364
//
365-
if (node->getSideTableIndex() == node->getReferenceCount())
365+
if (node->getLocalIndex() == node->getReferenceCount())
366366
{
367-
local->setSideTableIndex(local->getSideTableIndex() + node->getReferenceCount());
367+
local->setLocalIndex(local->getLocalIndex() + node->getReferenceCount());
368368
}
369369

370-
if ((node->getSideTableIndex() == 1 || node->getOpCodeValue() == TR::loadaddr) && !_liveVars->isSet(localIndex))
370+
if ((node->getLocalIndex() == 1 || node->getOpCodeValue() == TR::loadaddr) && !_liveVars->isSet(localIndex))
371371
{
372372
// First evaluation point of this node or loadaddr.
373373
//
@@ -389,14 +389,14 @@ void TR_CompactLocals::processNodeInPreorder(TR::Node *node,
389389
}
390390
}
391391

392-
local->setSideTableIndex(local->getSideTableIndex()-1);
393-
node->setSideTableIndex(node->getSideTableIndex()-1);
392+
local->setLocalIndex(local->getLocalIndex()-1);
393+
node->setLocalIndex(node->getLocalIndex()-1);
394394

395395
return;
396396
}
397397
}
398398
else if (node->exceptionsRaised() &&
399-
(node->getSideTableIndex() <= 1))
399+
(node->getLocalIndex() <= 1))
400400
{
401401
TR::Block *succ;
402402
for (auto edge = block->getExceptionSuccessors().begin(); edge != block->getExceptionSuccessors().end(); ++edge)
@@ -412,14 +412,14 @@ void TR_CompactLocals::processNodeInPreorder(TR::Node *node,
412412
createInterferenceBetween(_liveVars);
413413
}
414414

415-
if (node->getSideTableIndex() != 0)
415+
if (node->getLocalIndex() != 0)
416416
{
417-
node->setSideTableIndex(node->getSideTableIndex()-1);
417+
node->setLocalIndex(node->getLocalIndex()-1);
418418
}
419419

420420
// This is not the first evaluation point of this node.
421421
//
422-
if (node->getSideTableIndex() > 0)
422+
if (node->getLocalIndex() > 0)
423423
{
424424
return;
425425
}

compiler/optimizer/GeneralLoopUnroller.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ void TR_LoopUnroller::modifyOriginalLoop(TR_RegionStructure *loop, TR_StructureS
978978
TR::Node *gotoNode = TR::Node::create(branch, TR::Goto);
979979
TR::TreeTop *gotoTree = TR::TreeTop::create(comp(), gotoNode);
980980
gotoNode->setBranchDestination(destBlock->getEntry());
981-
gotoNode->setSideTableIndex(CREATED_BY_GLU);
981+
gotoNode->setLocalIndex(CREATED_BY_GLU);
982982

983983
TR::TransformUtil::removeTree(comp(), branchBlock->getLastRealTreeTop());
984984
branchBlock->append(gotoTree);
@@ -2325,7 +2325,7 @@ void TR_LoopUnroller::generateSpillLoop(TR_RegionStructure *loop,
23252325
TR::TreeTop *gotoTree = TR::TreeTop::create(comp(), gotoNode);
23262326
clonedBranchBlock->append(gotoTree);
23272327
gotoNode->setBranchDestination(newBranchBlock->getEntry());
2328-
gotoNode->setSideTableIndex(CREATED_BY_GLU);
2328+
gotoNode->setLocalIndex(CREATED_BY_GLU);
23292329
23302330
processSwingQueue();
23312331
@@ -2418,7 +2418,7 @@ void TR_LoopUnroller::addEdgeForSpillLoop(TR_RegionStructure *region,
24182418
{
24192419
TR::Node *gotoNode = TR::Node::create(lastNode, TR::Goto);
24202420
gotoNode->setBranchDestination(newTo->getEntry());
2421-
gotoNode->setSideTableIndex(CREATED_BY_GLU);
2421+
gotoNode->setLocalIndex(CREATED_BY_GLU);
24222422
newFrom->append(TR::TreeTop::create(comp(), gotoNode));
24232423
}
24242424
}
@@ -2453,10 +2453,10 @@ void TR_LoopUnroller::addEdgeForSpillLoop(TR_RegionStructure *region,
24532453
TR::Node *gotoNode = TR::Node::create(lastNode, TR::Goto);
24542454
TR::TreeTop *gotoTree = TR::TreeTop::create(comp(), gotoNode);
24552455
gotoNode->setBranchDestination(newTo->getEntry());
2456-
gotoNode->setSideTableIndex(CREATED_BY_GLU);
2456+
gotoNode->setLocalIndex(CREATED_BY_GLU);
24572457
TR::Block *gotoBlock = TR::Block::createEmptyBlock(lastNode, comp(), newFrom->getFrequency(), newFrom);
24582458
gotoBlock->append(gotoTree);
2459-
gotoBlock->getEntry()->getNode()->setSideTableIndex(CREATED_BY_GLU);
2459+
gotoBlock->getEntry()->getNode()->setLocalIndex(CREATED_BY_GLU);
24602460
_cfg->addNode(gotoBlock);
24612461

24622462

@@ -2639,10 +2639,10 @@ void TR_LoopUnroller::addExitEdgeAndFixEverything(TR_RegionStructure *region,
26392639
TR::Node *gotoNode = TR::Node::create(lastNode, TR::Goto);
26402640
TR::TreeTop *gotoTree = TR::TreeTop::create(comp(), gotoNode);
26412641
gotoNode->setBranchDestination(newTo->getEntry());
2642-
gotoNode->setSideTableIndex(CREATED_BY_GLU);
2642+
gotoNode->setLocalIndex(CREATED_BY_GLU);
26432643
TR::Block *gotoBlock = TR::Block::createEmptyBlock(lastNode, comp(), newTo->getFrequency(), newTo);
26442644
gotoBlock->append(gotoTree);
2645-
gotoBlock->getEntry()->getNode()->setSideTableIndex(CREATED_BY_GLU);
2645+
gotoBlock->getEntry()->getNode()->setLocalIndex(CREATED_BY_GLU);
26462646
_cfg->addNode(gotoBlock);
26472647

26482648
//fix the tree tops: insert the goto block in place
@@ -2756,7 +2756,7 @@ void TR_LoopUnroller::addEdgeAndFixEverything(TR_RegionStructure *region,
27562756
gotoTree->join(lastTreeTop->getNextTreeTop());
27572757
lastTreeTop->join(gotoTree);
27582758
gotoNode->setBranchDestination(newTo->getEntry());
2759-
gotoNode->setSideTableIndex(CREATED_BY_GLU);
2759+
gotoNode->setLocalIndex(CREATED_BY_GLU);
27602760
}
27612761
}
27622762
//SWITCH
@@ -2829,8 +2829,8 @@ bool TR_LoopUnroller::cfgEdgeAlreadyExists(TR::Block *from, TR::Block *to, EdgeC
28292829
// to the loop entry, so just checking the goto node is insufficient
28302830
//
28312831
if (dest->getNumber() == to->getNumber() &&
2832-
lastRealTree->getNode()->getSideTableIndex() == CREATED_BY_GLU &&
2833-
succ->getEntry()->getNode()->getSideTableIndex() == CREATED_BY_GLU)
2832+
lastRealTree->getNode()->getLocalIndex() == CREATED_BY_GLU &&
2833+
succ->getEntry()->getNode()->getLocalIndex() == CREATED_BY_GLU)
28342834
return true;
28352835
}
28362836
}
@@ -3187,7 +3187,7 @@ TR_LoopUnroller::prepareLoopStructure(TR_RegionStructure *loop)
31873187
{
31883188
TR::TreeTop *tt = block->getLastRealTreeTop();
31893189
if (tt->getNode()->getOpCodeValue() == TR::Goto)
3190-
tt->getNode()->setSideTableIndex(-1);
3190+
tt->getNode()->setLocalIndex(-1);
31913191
}
31923192
}
31933193

0 commit comments

Comments
 (0)