Skip to content

Commit 605bc38

Browse files
fangliu2020igcbot
authored andcommitted
[vISA] Add set/getInputR1() APIs in IR builder
Add set/getInputR1() APIs in IR builder
1 parent 17918c7 commit 605bc38

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

visa/BuildIR.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ class IR_Builder
364364
G4_INST* FDSpillInst = nullptr;
365365
G4_Declare* tmpFCRet = nullptr;
366366

367+
368+
// input declare of R1.
369+
// Used to initialize header payload of render target read message
370+
G4_Declare* inputR1 = nullptr;
371+
367372
unsigned short arg_size;
368373
unsigned short return_var_size;
369374

@@ -667,6 +672,9 @@ class IR_Builder
667672
G4_Declare* getBuiltinSamplerHeader() const { return builtinSamplerHeader; }
668673
G4_Declare* getOldA0Dot2Temp() const { return oldA0Dot2Temp; }
669674

675+
G4_Declare* getInputR1() { return inputR1; }
676+
void setInputR1(G4_Declare* r1) { inputR1 = r1; }
677+
670678
bool isBindlessSampler(const G4_Operand* sampler) const {
671679
return sampler->isSrcRegRegion() && sampler->getTopDcl() == getBuiltinBindlessSampler();
672680
}

visa/VISAKernelImpl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,12 @@ int VISAKernelImpl::CreateVISAInputVar(
17591759
}
17601760
}
17611761

1762+
// save the G4_declare of "R1" input in builder
1763+
if (offset == getGRFSize() && size == getGRFSize())
1764+
{
1765+
m_builder->setInputR1(input->dcl);
1766+
}
1767+
17621768
return status;
17631769
}
17641770

0 commit comments

Comments
 (0)