Skip to content

Commit

Permalink
Deprecate changeRegisterKind
Browse files Browse the repository at this point in the history
This API as indicated by the comment is lightly tested. In fact the
code generator should now have the ability to change the register kind
as this is a highly complex topic only the register allocator
understands. Deprecating this API to avoid shooting ourselves in the
foot by mistakenly using this API without understanding what it does.

Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
  • Loading branch information
fjeremic committed Jan 21, 2019
1 parent 4ff0508 commit 959d71c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
11 changes: 0 additions & 11 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Expand Up @@ -1193,17 +1193,6 @@ OMR::Z::CodeGenerator::canUseImmedInstruction( int64_t value )
return false;
}


// Use with care, lightly tested
// Z
void OMR::Z::CodeGenerator::changeRegisterKind(TR::Register * temp, TR_RegisterKinds rk)
{
if (rk == temp->getKind()) return;
if (_liveRegisters[temp->getKind()] && _liveRegisters[rk])
TR_LiveRegisters::moveRegToList(_liveRegisters[temp->getKind()], _liveRegisters[rk], temp);
temp->setKind(rk);
}

bool
OMR::Z::CodeGenerator::isAddMemoryUpdate(TR::Node * node, TR::Node * valueChild)
{
Expand Down
2 changes: 0 additions & 2 deletions compiler/z/codegen/OMRCodeGenerator.hpp
Expand Up @@ -225,8 +225,6 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGenerator
bool shouldValueBeInACommonedNode(int64_t value);
int64_t getLargestNegConstThatMustBeMaterialized() {return ((-1ll) << 31) - 1;} // min 32bit signed integer minus 1
int64_t getSmallestPosConstThatMustBeMaterialized() {return ((int64_t)0x000000007FFFFFFF) + 1;} // max 32bit signed integer plus 1

void changeRegisterKind(TR::Register * temp, TR_RegisterKinds rk);

void beginInstructionSelection();
void endInstructionSelection();
Expand Down

0 comments on commit 959d71c

Please sign in to comment.