Skip to content

Commit

Permalink
Prevent commoning conversion to address operations in LocalCSE
Browse files Browse the repository at this point in the history
OMR::LocalCSE::canBeAvailable was restricting l2a operations from being
commoned to reduce the likelihood that a register holding the result of
such an operation would be marked as a collected reference and kept live
across a GC point by l2aEvaluator.  To be safest, all conversion to
address types should be similarly prevented from being commoned.
  • Loading branch information
hzongaro committed Jan 7, 2024
1 parent 782146b commit 8f4b357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/optimizer/OMRLocalCSE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ bool OMR::LocalCSE::canBeAvailable(TR::Node *parent, TR::Node *node, TR_BitVecto
if (node->getOpCodeValue() == TR::allocationFence)
return false;

if (node->getOpCodeValue() == TR::l2a)
if (node->getOpCode().isConversion() && node->getOpCode().isRef())
return false;

if (node->getOpCode().isLoadReg() || node->getOpCode().isStoreReg() || (node->getOpCodeValue() == TR::PassThrough && parent->getOpCodeValue() != TR::GlRegDeps) || (node->getOpCodeValue() == TR::GlRegDeps))
Expand Down

0 comments on commit 8f4b357

Please sign in to comment.