Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the macros with the hardcoded prefixes #6945

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler/aarch64/codegen/OMRLinkage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "infra/IGNode.hpp"
#include "infra/InterferenceGraph.hpp"

#define OPT_DETAILS "O^O COMPACT LOCALS: "

typedef bool (*localSizeTestMethod) (uint32_t size);
static bool isLocalSize4Byte(uint32_t size)
{
Expand Down Expand Up @@ -148,7 +150,7 @@ void OMR::ARM64::Linkage::mapCompactedStack(TR::ResolvedMethodSymbol *method)
}
else
{
performSharing = performTransformation(comp, "O^O COMPACT LOCALS: Sharing slot for local %p\n", localCursor);
performSharing = performTransformation(comp, "%sSharing slot for local %p\n", OPT_DETAILS, localCursor);

if (performSharing)
localCursor->setOffset(colourToOffsetMap[colour]);
Expand Down Expand Up @@ -255,7 +257,7 @@ void OMR::ARM64::Linkage::mapCompactedStack(TR::ResolvedMethodSymbol *method)
else // share local with already mapped stack slot
{
if (comp->getOption(TR_TraceCG))
traceMsg(comp, "O^O COMPACT LOCALS: Sharing slot for local %p (colour = %d)\n", localCursor, colour);
traceMsg(comp, "%sSharing slot for local %p (colour = %d)\n", OPT_DETAILS, localCursor, colour);

localCursor->setOffset(colourToOffsetMap[colour]);
}
Expand Down
22 changes: 12 additions & 10 deletions compiler/arm/codegen/FPTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "il/TreeTop.hpp"
#include "il/TreeTop_inlines.hpp"

#define OPT_DETAILS "O^O FP Tree Evaluator: "

#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
// Helpers
static bool noFPRA = false; // The current RA *does* seem to assign FP regs. Shall we change this to false?
Expand Down Expand Up @@ -1636,7 +1638,7 @@ TR::Register *OMR::ARM::TreeEvaluator::faddEvaluator(TR::Node *node, TR::CodeGen
TR::Register *result = NULL;
if (((isFPStrictMul(node->getFirstChild(), comp) && (node->getSecondChild()->getReferenceCount() == 1)) ||
(isFPStrictMul(node->getSecondChild(), comp) && (node->getFirstChild()->getReferenceCount() == 1))) &&
performTransformation(comp, "O^O Changing [%p] to fmacs\n", node))
performTransformation(comp, "%sChanging [%p] to fmacs\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fmacs, cg);
}
Expand All @@ -1654,7 +1656,7 @@ TR::Register *OMR::ARM::TreeEvaluator::daddEvaluator(TR::Node *node, TR::CodeGen
TR::Compilation *comp = cg->comp();
if (((isFPStrictMul(node->getFirstChild(), comp) && (node->getSecondChild()->getReferenceCount() == 1)) ||
(isFPStrictMul(node->getSecondChild(), comp) && (node->getFirstChild()->getReferenceCount() == 1))) &&
performTransformation(comp, "O^O Changing [%p] to fmacd\n", node))
performTransformation(comp, "%sChanging [%p] to fmacd\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fmacd, cg);
}
Expand All @@ -1672,13 +1674,13 @@ TR::Register *OMR::ARM::TreeEvaluator::dsubEvaluator(TR::Node *node, TR::CodeGen
TR::Register *result = NULL;
if (isFPStrictMul(node->getFirstChild(), comp) &&
(node->getSecondChild()->getReferenceCount() == 1) &&
performTransformation(comp, "O^O Changing [%p] to fmscd\n",node))
performTransformation(comp, "%sChanging [%p] to fmscd\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fmscd, cg);
}
else if (isFPStrictMul(node->getSecondChild(), comp) &&
(node->getFirstChild()->getReferenceCount() == 1) &&
performTransformation(comp, "O^O Changing [%p] to fnmacd\n",node))
performTransformation(comp, "%sChanging [%p] to fnmacd\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fnmacd, cg);
}
Expand All @@ -1696,13 +1698,13 @@ TR::Register *OMR::ARM::TreeEvaluator::fsubEvaluator(TR::Node *node, TR::CodeGen
TR::Register *result = NULL;
if (isFPStrictMul(node->getFirstChild(), comp) &&
(node->getSecondChild()->getReferenceCount() == 1) &&
performTransformation(comp, "O^O Changing [%p] to fmscs\n",node))
performTransformation(comp, "%sChanging [%p] to fmscs\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fmscs, cg);
}
else if (isFPStrictMul(node->getSecondChild(), comp) &&
(node->getFirstChild()->getReferenceCount() == 1) &&
performTransformation(comp, "O^O Changing [%p] to fnmacs\n",node))
performTransformation(comp, "%sChanging [%p] to fnmacs\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fnmacs, cg);
}
Expand Down Expand Up @@ -1773,7 +1775,7 @@ TR::Register *OMR::ARM::TreeEvaluator::fnegEvaluator(TR::Node *node, TR::CodeGen
firstChild->getSecondChild()->getReferenceCount() == 1) ||
(isFPStrictMul(firstChild->getSecondChild(), comp) &&
firstChild->getFirstChild()->getReferenceCount() == 1)) &&
performTransformation(comp, "O^O Changing [%p] to fnmscs\n", node))
performTransformation(comp, "%sChanging [%p] to fnmscs\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fnmscs, cg);
firstChild->unsetRegister(); //unset as the first child isn't the result node
Expand All @@ -1786,7 +1788,7 @@ TR::Register *OMR::ARM::TreeEvaluator::fnegEvaluator(TR::Node *node, TR::CodeGen
else if (isFPStrictMul(firstChild, comp) &&
firstChild->getReferenceCount() < 2 &&
!firstChild->getRegister() &&
performTransformation(comp, "O^O Changing [%p] to fnmuls\n", node))
performTransformation(comp, "%sChanging [%p] to fnmuls\n", OPT_DETAILS, node))
{
// fneg(node) -> fmul(firstChild)
TR::Register *floatTrgReg = cg->allocateSinglePrecisionRegister();
Expand Down Expand Up @@ -1829,7 +1831,7 @@ TR::Register *OMR::ARM::TreeEvaluator::dnegEvaluator(TR::Node *node, TR::CodeGen
firstChild->getSecondChild()->getReferenceCount() == 1) ||
(isFPStrictMul(firstChild->getSecondChild(), comp) &&
firstChild->getFirstChild()->getReferenceCount() == 1)) &&
performTransformation(comp, "O^O Changing [%p] to fnmscd\n", node))
performTransformation(comp, "%sChanging [%p] to fnmscd\n", OPT_DETAILS, node))
{
result = generateFusedMultiplyAdd(node, TR::InstOpCode::fnmscd, cg);
firstChild->unsetRegister(); //unset as the first child isn't the result node
Expand All @@ -1842,7 +1844,7 @@ TR::Register *OMR::ARM::TreeEvaluator::dnegEvaluator(TR::Node *node, TR::CodeGen
else if (isFPStrictMul(firstChild, comp) &&
firstChild->getReferenceCount() < 2 &&
!firstChild->getRegister() &&
performTransformation(comp, "O^O Changing [%p] to fnmuld\n", node))
performTransformation(comp, "%sChanging [%p] to fnmuld\n", OPT_DETAILS, node))
{
// fneg(node) -> fmul(firstChild)
TR::Register *doubleTrgReg = cg->allocateRegister(TR_FPR);
Expand Down
9 changes: 5 additions & 4 deletions compiler/codegen/CodeGenRA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
#include "optimizer/Structure.hpp"
#include "ras/Debug.hpp"

#define OPT_DETAILS "O^O CODE GENERATION: "
#define OPT_DETAILS "O^O CODE GENERATION REGISTER ALLOCATION: "
#define OPT_DETAILS_GLOBAL_REGISTER_ALLOCATION "O^O GLOBAL REGISTER ALLOCATION: "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like we use OPT_DETAILS anywhere so maybe just update to say CODE GENERATION REGISTER ALLOCATION: .


#define NUM_REGS_USED_BY_COMPLEX_OPCODES 3

Expand Down Expand Up @@ -490,7 +491,7 @@ OMR::CodeGenerator::allocateSpill(int32_t dataSize, bool containsCollectedRefere
}

if (
(spill && self()->comp()->getOption(TR_TraceRA) && !performTransformation(self()->comp(), "O^O SPILL TEMPS: Reuse spill temp %s\n", self()->getDebug()->getName(spill->getSymbolReference()))))
(spill && self()->comp()->getOption(TR_TraceRA) && !performTransformation(self()->comp(), "%sReuse spill temp %s\n", OPT_DETAILS, self()->getDebug()->getName(spill->getSymbolReference()))))
{
// Discard the spill temp we popped and never use it again; allocate a
// new one instead, and later, where we would have returned this spill
Expand Down Expand Up @@ -535,7 +536,7 @@ OMR::CodeGenerator::allocateSpill(int32_t dataSize, bool containsCollectedRefere
//
if ( offset == NULL
|| spill->secondHalfIsOccupied()
|| !performTransformation(self()->comp(), "O^O HALF-SLOT SPILLS: Use second half of %s\n", self()->getDebug()->getName(spill->getSymbolReference())))
|| !performTransformation(self()->comp(), "%sUse second half of %s\n", OPT_DETAILS, self()->getDebug()->getName(spill->getSymbolReference())))
{
spill->setFirstHalfIsOccupied();
}
Expand Down Expand Up @@ -2627,7 +2628,7 @@ OMR::CodeGenerator::simulateTreeEvaluation(TR::Node *node, TR_RegisterPressureSt
{
self()->getNumberOfTemporaryRegistersUsedByCall(node, state, numGPRTemporaries, numFPRTemporaries, numVRFTemporaries);
if ((numGPRTemporaries >= 1 || numFPRTemporaries >= 1 || numVRFTemporaries >= 1)
&& (self()->comp()->getOption(TR_TraceRegisterPressureDetails) && !performTransformation(self()->comp(), "O^O GLOBAL REGISTER ALLOCATION: Call %p has %d GPR and %d FPR and VRF %d dummy registers\n", node, numGPRTemporaries, numFPRTemporaries, numVRFTemporaries)))
&& (self()->comp()->getOption(TR_TraceRegisterPressureDetails) && !performTransformation(self()->comp(), "%sCall %p has %d GPR and %d FPR and VRF %d dummy registers\n", OPT_DETAILS_GLOBAL_REGISTER_ALLOCATION, node, numGPRTemporaries, numFPRTemporaries, numVRFTemporaries)))
{
numGPRTemporaries = 0;
numFPRTemporaries = 0;
Expand Down
4 changes: 3 additions & 1 deletion compiler/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include "infra/TreeServices.hpp"
#include "ras/Debug.hpp"

#define OPT_DETAILS "O^O OMR Tree Evaluator: "

TR::Register *
OMR::TreeEvaluator::brdbarEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
Expand Down Expand Up @@ -759,7 +761,7 @@ void OMR::TreeEvaluator::evaluateNodesWithFutureUses(TR::Node *node, TR::CodeGen
else
{
if (comp->getOption(TR_TraceCG))
traceMsg(comp, "O^O pre-evaluating escaping commoned subtree %p\n", node);
traceMsg(comp, "%spre-evaluating escaping commoned subtree %p\n", OPT_DETAILS, node);

(void)cg->evaluate(node);

Expand Down
4 changes: 3 additions & 1 deletion compiler/compile/OMRSymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
#include "env/VMJ9.h"
#endif

#define OPT_DETAILS "O^O SYMBOL SHARING: "

class TR_OpaqueClassBlock;
class TR_OpaqueMethodBlock;

Expand Down Expand Up @@ -1432,7 +1434,7 @@ OMR::SymbolReferenceTable::findOrCreateMethodSymbol(
TR::ResolvedMethodSymbol *existingMethod = symRef->getSymbol()->getResolvedMethodSymbol();
if (existingMethod && (existingMethod->getMethodKind() == callKind) && resolvedMethod->canAlwaysShareSymbolDespiteOwningMethod(existingMethod->getResolvedMethod()))
{
if (performTransformation(comp(), "O^O SYMBOL SHARING: Reusing #%d M%p for M%p\n", symRef->getReferenceNumber(), existingMethod->getResolvedMethod(), resolvedMethod))
if (performTransformation(comp(), "%sReusing #%d M%p for M%p\n", OPT_DETAILS, symRef->getReferenceNumber(), existingMethod->getResolvedMethod(), resolvedMethod))
{
TR_ResolvedMethod * owningMethod = comp()->getOwningMethodSymbol(owningMethodIndex)->getResolvedMethod();
symRef->setHasBeenAccessedAtRuntime(isUnresolvedInCP ? TR_no: TR_maybe);
Expand Down
4 changes: 3 additions & 1 deletion compiler/il/Aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#include "runtime/RuntimeAssumptions.hpp"
#endif

#define OPT_DETAILS "O^O IL ALIASES: "

class TR_OpaqueClassBlock;
namespace TR { class Register; }

Expand Down Expand Up @@ -945,7 +947,7 @@ addVeryRefinedCallAliasSets(TR::ResolvedMethodSymbol * methodSymbol, TR_BitVecto

methodsPeeked->add(methodId);

dumpOptDetails(comp, "O^O REFINING ALIASES: Peeking into the IL to refine aliases \n");
dumpOptDetails(comp, "%sPeeking into the IL to refine aliases \n", OPT_DETAILS);

if (!methodSymbol->getResolvedMethod()->genMethodILForPeeking(methodSymbol, comp, true))
return 0;
Expand Down
Loading