Skip to content

Commit

Permalink
Merge pull request #14294 from a7ehuo/fix-StringLatin1-inflate-v0.30.…
Browse files Browse the repository at this point in the history
…0-release

(0.30.0) Fix the start of internal control flow and deps
  • Loading branch information
pshipton committed Jan 18, 2022
2 parents 3953acb + 05b3cbf commit 8288533
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions runtime/compiler/x/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2021 IBM Corp. and others
* Copyright (c) 2000, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -11950,11 +11950,14 @@ J9::X86::TreeEvaluator::inlineStringLatin1Inflate(TR::Node *node, TR::CodeGenera
TR::Register *zeroReg = cg->allocateRegister(TR_FPR);
TR::Register *scratchReg = cg->allocateRegister(TR_GPR);

TR::RegisterDependencyConditions *deps = generateRegisterDependencyConditions((uint8_t)0, 7, cg);
int depCount = 9;
TR::RegisterDependencyConditions *deps = generateRegisterDependencyConditions((uint8_t)0, depCount, cg);
deps->addPostCondition(xmmHighReg, TR::RealRegister::NoReg, cg);
deps->addPostCondition(xmmLowReg, TR::RealRegister::NoReg, cg);
deps->addPostCondition(zeroReg, TR::RealRegister::NoReg, cg);
deps->addPostCondition(lengthReg, TR::RealRegister::NoReg, cg);
deps->addPostCondition(srcBufferReg, TR::RealRegister::NoReg, cg);
deps->addPostCondition(destBufferReg, TR::RealRegister::NoReg, cg);
deps->addPostCondition(scratchReg, TR::RealRegister::eax, cg);
deps->addPostCondition(srcOffsetReg, TR::RealRegister::ecx, cg);
deps->addPostCondition(destOffsetReg, TR::RealRegister::edx, cg);
Expand All @@ -11964,6 +11967,10 @@ J9::X86::TreeEvaluator::inlineStringLatin1Inflate(TR::Node *node, TR::CodeGenera
TR::LabelSymbol *copyResidueLabel = generateLabelSymbol(cg);
TR::LabelSymbol *afterCopy8Label = generateLabelSymbol(cg);

TR::LabelSymbol *startLabel = generateLabelSymbol(cg);
startLabel->setStartInternalControlFlow();
generateLabelInstruction(TR::InstOpCode::label, node, startLabel, cg);

TR::Node *destOffsetNode = node->getChild(3);

if (!destOffsetNode->isConstZeroValue())
Expand All @@ -11981,13 +11988,9 @@ J9::X86::TreeEvaluator::inlineStringLatin1Inflate(TR::Node *node, TR::CodeGenera
// make sure the register is zero before interleaving
generateRegRegInstruction(TR::InstOpCode::PXORRegReg, node, zeroReg, zeroReg, cg);


TR::LabelSymbol *startLoop = generateLabelSymbol(cg);
TR::LabelSymbol *endLoop = generateLabelSymbol(cg);

startLoop->setStartInternalControlFlow();
endLoop->setEndInternalControlFlow();

// vectorized add in loop, 16 bytes per iteration
// use srcOffsetReg for loop counter, add starting offset to lengthReg, subtract 16 (xmm register size)
// to prevent reading/writing beyond the end of the array
Expand Down

0 comments on commit 8288533

Please sign in to comment.