Skip to content

Commit fca0818

Browse files
jgu222igcbot
authored andcommitted
Add missing cloneInst() for some instructions
Add missing cloneInst(), which is used sometime by RA
1 parent d3236e2 commit fca0818

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

visa/G4_IR.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8456,6 +8456,46 @@ G4_INST *G4_InstDpas::cloneInst(const IR_Builder *b) {
84568456
getRepeatCount(), false, pred);
84578457
}
84588458

8459+
G4_INST *G4_InstShfl::cloneInst(const IR_Builder *b) {
8460+
if (!b)
8461+
b = &builder;
8462+
auto nonConstBuilder = const_cast<IR_Builder *>(b);
8463+
auto prd = nonConstBuilder->duplicateOperand(getPredicate());
8464+
auto dst = nonConstBuilder->duplicateOperand(getDst());
8465+
auto src0 = nonConstBuilder->duplicateOperand(getSrc(0));
8466+
auto src1 = nonConstBuilder->duplicateOperand(getSrc(1));
8467+
return nonConstBuilder->createShflInst(prd, getSaturate(), getExecSize(),
8468+
dst, src0, src1, getShflFCtrl(),
8469+
option, false);
8470+
}
8471+
8472+
G4_INST *G4_InstDnscl::cloneInst(const IR_Builder *b) {
8473+
if (!b)
8474+
b = &builder;
8475+
auto nonConstBuilder = const_cast<IR_Builder *>(b);
8476+
auto prd = nonConstBuilder->duplicateOperand(getPredicate());
8477+
auto dst = nonConstBuilder->duplicateOperand(getDst());
8478+
auto src0 = nonConstBuilder->duplicateOperand(getSrc(0));
8479+
auto src1 = nonConstBuilder->duplicateOperand(getSrc(1));
8480+
auto src2 = nonConstBuilder->duplicateOperand(getSrc(2));
8481+
return nonConstBuilder->createDnsclInst(prd, getExecSize(), dst, src0, src1,
8482+
src2, getDnsclConvertType(),
8483+
getDnsclMode(), getDnsclRoundMode(),
8484+
option, false);
8485+
}
8486+
8487+
G4_INST *G4_InstLfsr::cloneInst(const IR_Builder *b) {
8488+
if (!b)
8489+
b = &builder;
8490+
auto nonConstBuilder = const_cast<IR_Builder *>(b);
8491+
auto prd = nonConstBuilder->duplicateOperand(getPredicate());
8492+
auto dst = nonConstBuilder->duplicateOperand(getDst());
8493+
auto src0 = nonConstBuilder->duplicateOperand(getSrc(0));
8494+
auto src1 = nonConstBuilder->duplicateOperand(getSrc(1));
8495+
return nonConstBuilder->createLfsrInst(prd, getExecSize(), dst, src0, src1,
8496+
getLfsrFCtrl(), option, false);
8497+
}
8498+
84598499
bool G4_InstDpas::isInt() const {
84608500
// Check Src1 is enough.
84618501
switch (Src1Precision) {

visa/G4_IR.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,8 @@ class G4_InstShfl : public G4_INST {
15341534
: G4_INST(builder, prd, op, conMod, sat, execSize, dst, src0, src1, opt),
15351535
shflOp(shflOp) {}
15361536

1537+
G4_INST *cloneInst(const IR_Builder *b = nullptr) override;
1538+
15371539
G4_ShflOp getShflFCtrl() const { return shflOp; }
15381540

15391541
private:
@@ -1549,6 +1551,8 @@ class G4_InstLfsr : public G4_INST {
15491551
src1, opt),
15501552
funcCtrl(fCtrl) {}
15511553

1554+
G4_INST *cloneInst(const IR_Builder *b = nullptr) override;
1555+
15521556
LFSR_FC getLfsrFCtrl() const { return funcCtrl; }
15531557

15541558
private:
@@ -1565,6 +1569,8 @@ class G4_InstDnscl : public G4_INST {
15651569
src1, src2, opt),
15661570
type(t), mode(m), rndMode(rm) {}
15671571

1572+
G4_INST *cloneInst(const IR_Builder *b = nullptr) override;
1573+
15681574
DNSCL_CONVERT_TYPE getDnsclConvertType() const { return type; }
15691575
DNSCL_MODE getDnsclMode() const { return mode; }
15701576
DNSCL_RND_MODE getDnsclRoundMode() const { return rndMode; }

0 commit comments

Comments
 (0)