Skip to content

Commit d8aa6e0

Browse files
sys-igcigcbot
authored andcommitted
Changes in code.
1 parent 2c2a4d8 commit d8aa6e0

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

visa/HWConformity.cpp

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5098,30 +5098,20 @@ void HWConformity::fixSendInst(G4_BB* bb)
50985098
{
50995099
auto sendSrc = isSrc0 ? inst->getSrc(0)->asSrcRegRegion() : inst->getSrc(1)->asSrcRegRegion();
51005100
uint16_t rows = isSrc0 ? inst->getMsgDesc()->getSrc0LenRegs() : inst->getMsgDesc()->getSrc1LenRegs();
5101-
5102-
G4_Declare* sendSrcDcl = sendSrc->getBase()->asRegVar()->getDeclare();
51035101
G4_Type type = sendSrc->getType();
5104-
G4_VarBase* base = sendSrc->getBase();
5105-
short baseOff = sendSrc->getRegOff();
5106-
short baseSubOff = sendSrc->getSubRegOff();
5102+
G4_Declare* dcl = builder.createTempVar(rows * builder.getNativeExecSize(), type, GRFALIGN);
51075103

5108-
if (TypeSize(type) != 4) {
5109-
unsigned int byteSize = sendSrcDcl->getByteSize();
5110-
MUST_BE_TRUE(byteSize % 4 == 0, "Unexpected src opnd type for send.");
5111-
G4_Declare* tmpDcl = builder.createTempVar(byteSize / 4, Type_UD, sendSrcDcl->getSubRegAlign());
5112-
tmpDcl->setAliasDeclare(sendSrcDcl, 0);
5113-
base = tmpDcl->getRegVar();
5114-
baseSubOff *= TypeSize(type) / 4;
5115-
type = Type_UD;
5116-
}
5104+
MUST_BE_TRUE(TypeSize(type) == 4, "Invalid src opnd type for send.");
51175105

5118-
G4_Declare* dcl = builder.createTempVar(rows * builder.getNativeExecSize(), type, GRFALIGN);
51195106
const RegionDesc* region = builder.getRegionStride1();
5107+
G4_VarBase* base = sendSrc->getBase();
5108+
short baseOff = sendSrc->getRegOff();
5109+
short baseSubOff = sendSrc->getSubRegOff();
51205110
for (uint16_t idx = 0; idx != rows; ++idx) {
5121-
G4_SrcRegRegion* src = builder.createSrc(base, baseOff + idx, baseSubOff + 0, region, type);
5122-
G4_DstRegRegion* dst = builder.createDst(dcl->getRegVar(), idx, 0, 1, type);
5123-
G4_INST* newInst = builder.createMov(builder.getNativeExecSize(), dst, src, InstOpt_WriteEnable, false);
5124-
bb->insertBefore(i, newInst);
5111+
G4_SrcRegRegion* src = builder.createSrc(base, baseOff + idx, baseSubOff + 0, region, type);
5112+
G4_DstRegRegion* dst = builder.createDst(dcl->getRegVar(), idx, 0, 1, type);
5113+
G4_INST* newInst = builder.createMov(builder.getNativeExecSize(), dst, src, InstOpt_WriteEnable, false);
5114+
bb->insertBefore(i, newInst);
51255115
}
51265116

51275117
G4_Operand* newSrc = builder.createSrcRegRegion(dcl, builder.getRegionStride1());

0 commit comments

Comments
 (0)