Skip to content

Commit 395a236

Browse files
bcheng0127igcbot
authored andcommitted
Mark addrExpr declare as addressed to avoid the optimizations.
Mark addrExpr declare as addressed to avoid the optimizations.
1 parent f4d3b2e commit 395a236

File tree

6 files changed

+13
-30
lines changed

6 files changed

+13
-30
lines changed

visa/G4_Declare.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,13 @@ class G4_Declare {
319319
void setCapableOfReuse() { capableOfReuse = true; }
320320
bool getCapableOfReuse() const { return capableOfReuse; }
321321

322-
void setAddressed() { addressed = true; }
322+
void setAddressed() {
323+
if (AliasDCL) {
324+
return AliasDCL->setAddressed();
325+
}
326+
addressed = true;
327+
}
328+
323329
bool getAddressed() const {
324330
if (addressed) {
325331
return true;

visa/G4_IR.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7344,16 +7344,6 @@ void G4_InstIntrinsic::computeRightBound(G4_Operand *opnd) {
73447344
if (opnd == getDst())
73457345
opnd->setRightBound(opnd->left_bound + getDstByteSize() - 1);
73467346
break;
7347-
case Intrinsic::PseudoAddrMov:
7348-
if (opnd != getDst()) { // Source operand only, dst operand will be handled
7349-
// as normal dst
7350-
opnd->setLeftBound(opnd->left_bound +
7351-
opnd->asAddrExp()->getOffset());
7352-
opnd->setRightBound(opnd->left_bound + builder.numEltPerGRF<Type_UB>() -
7353-
1);
7354-
opnd->setBitVecFromSize(builder.numEltPerGRF<Type_UB>(), getBuilder());
7355-
}
7356-
break;
73577347
default:
73587348
break;
73597349
}

visa/G4_Operand.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,9 @@ class G4_AddrExp final : public G4_Operand {
966966
public:
967967
G4_AddrExp(G4_RegVar *reg, int offset, G4_Type ty)
968968
: G4_Operand(G4_Operand::addrExp, ty), m_addressedReg(reg),
969-
m_offset(offset) {}
969+
m_offset(offset) {
970+
reg->getDeclare()->setAddressed();
971+
}
970972

971973
void *operator new(size_t sz, Mem_Manager &m) { return m.alloc(sz); }
972974

visa/LocalDataflow.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ struct LiveNode {
7474
vISA_ASSERT(Opnd, "null opnd");
7575
if (Opnd) {
7676
G4_Declare *Dcl = Opnd->getTopDcl();
77-
if (Opnd->isAddrExp()) {
78-
Dcl = Opnd->asAddrExp()->getRegVar()->getDeclare();
79-
}
8077
if (Dcl == nullptr) {
8178
// There is no top declaration for this operand, so this is ARF.
8279
return 32;
@@ -428,13 +425,8 @@ static void processReadOpnds(G4_BB *BB, G4_INST *Inst, LocalLivenessInfo &LLI) {
428425
opnd->isLabel())
429426
continue;
430427

431-
if (Inst->isPseudoAddrMovIntrinsic()) {
432-
G4_Declare *Dcl = opnd->asAddrExp()->getRegVar()->getDeclare();
433-
LLI.LiveNodes[Dcl].emplace_back(Inst, OpNum);
434-
} else {
435-
G4_Declare *Dcl = opnd->getTopDcl();
436-
LLI.LiveNodes[Dcl].emplace_back(Inst, OpNum);
437-
}
428+
G4_Declare *Dcl = opnd->getTopDcl();
429+
LLI.LiveNodes[Dcl].emplace_back(Inst, OpNum);
438430
}
439431
}
440432

visa/SpillManagerGMRF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3440,7 +3440,7 @@ G4_Declare *SpillManagerGRF::getOrCreateAddrSpillFillDcl(
34403440
}
34413441
for (auto newAddExp : newAddExpList) {
34423442
gra.pointsToAnalysis.patchPointsToSet(addrDcl, newAddExp,
3443-
newAddExp->getOffset());
3443+
newAddExp->getOffset() / builder_->getGRFSize());
34443444
}
34453445

34463446
return temp;

visa/VISAKernelImpl.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,14 +1818,7 @@ int VISAKernelImpl::CreateVISAAddressOfOperandGeneric(
18181818
return VISA_FAILURE;
18191819
}
18201820

1821-
// set up to the top level dcl to be addressed
1822-
src0Dcl->setAddressed();
18231821
m_kernel->setHasAddrTaken(true);
1824-
G4_Declare *parentDcl = src0Dcl->getAliasDeclare();
1825-
while (parentDcl) {
1826-
parentDcl->setAddressed();
1827-
parentDcl = parentDcl->getAliasDeclare();
1828-
}
18291822
cisa_opnd->g4opnd =
18301823
m_builder->createAddrExp(src0Dcl->getRegVar(), offset, Type_UW);
18311824
}

0 commit comments

Comments
 (0)