Skip to content

Commit 4c3e2b1

Browse files
bcheng0127igcbot
authored andcommitted
Changes in code.
1 parent 7769db0 commit 4c3e2b1

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

visa/Passes/LVN.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,6 @@ bool LVN::canReplaceUses(INST_LIST_ITER inst_it, UseList &uses,
200200
break;
201201
}
202202

203-
if (opndNum == Opnd_pred || opndNum == Opnd_condMod) {
204-
canReplace = false;
205-
break;
206-
}
207-
208203
if (!bb->isAllLaneActive()) {
209204
auto defCoversUseEmask =
210205
defInst->getMaskOffset() <= useInst->getMaskOffset() &&
@@ -1435,10 +1430,6 @@ void LVN::addUse(G4_DstRegRegion *dst, G4_INST *use, unsigned int srcIndex) {
14351430
srcPos = Opnd_src1;
14361431
} else if (srcIndex == 2) {
14371432
srcPos = Opnd_src2;
1438-
} else if (srcIndex == 3) {
1439-
srcPos = Opnd_pred;
1440-
} else if (srcIndex == 4) {
1441-
srcPos = Opnd_condMod;
14421433
}
14431434

14441435
UseInfo useInst = {use, srcPos};
@@ -1452,10 +1443,6 @@ void LVN::addUse(G4_DstRegRegion *dst, G4_INST *use, unsigned int srcIndex) {
14521443
(*it).second.push_back(useInst);
14531444
}
14541445

1455-
if (srcIndex > 3) {
1456-
return;
1457-
}
1458-
14591446
auto srcOpnd = use->getSrc(srcIndex);
14601447
auto itUD = useDef.find(srcOpnd);
14611448
if (itUD == useDef.end()) {
@@ -1478,16 +1465,6 @@ void LVN::removeAddrTaken(G4_AddrExp *opnd) {
14781465
}
14791466
}
14801467

1481-
void LVN::removeFlag(G4_Declare *topDcl) {
1482-
auto range_it = activeDefs.equal_range(topDcl->getDeclId());
1483-
for (auto it = range_it.first; it != range_it.second;) {
1484-
auto prev_it = it;
1485-
(*prev_it).second.second->getInst()->removeAllUses();
1486-
it++;
1487-
activeDefs.erase(prev_it);
1488-
}
1489-
}
1490-
14911468
void LVN::populateDuTable(INST_LIST_ITER inst_it) {
14921469
duTablePopulated = true;
14931470
// Populate duTable from inst_it position
@@ -1635,48 +1612,6 @@ void LVN::populateDuTable(INST_LIST_ITER inst_it) {
16351612
}
16361613
}
16371614
}
1638-
G4_CondMod *condMod = curInst->getCondMod();
1639-
if (condMod && condMod->getBase() && condMod->getBase()->isRegVar()) {
1640-
G4_Declare *condDcl = condMod->getTopDcl();
1641-
if (condDcl && condDcl->getRegVar()->isFlag()) {
1642-
auto range_it = activeDefs.equal_range(condDcl->getDeclId());
1643-
if (range_it.first != range_it.second) {
1644-
auto start_it = range_it.second;
1645-
start_it--;
1646-
for (auto it = start_it;;) {
1647-
G4_DstRegRegion *activeDst = (*it).second.second;
1648-
addUse(activeDst, curInst, 4);
1649-
if (it == range_it.first) {
1650-
// Last match reached
1651-
break;
1652-
}
1653-
it--;
1654-
}
1655-
}
1656-
removeFlag(condDcl);
1657-
}
1658-
}
1659-
1660-
G4_Predicate *predicate = curInst->getPredicate();
1661-
if (predicate && predicate->getBase() && predicate->getBase()->isRegVar()) {
1662-
G4_Declare *predDcl = predicate->getTopDcl();
1663-
if (predDcl && predDcl->getRegVar()->isFlag()) {
1664-
auto range_it = activeDefs.equal_range(predDcl->getDeclId());
1665-
if (range_it.first != range_it.second) {
1666-
auto start_it = range_it.second;
1667-
start_it--;
1668-
for (auto it = start_it;;) {
1669-
G4_DstRegRegion *activeDst = (*it).second.second;
1670-
addUse(activeDst, curInst, 3);
1671-
if (it == range_it.first) {
1672-
// Last match reached
1673-
break;
1674-
}
1675-
it--;
1676-
}
1677-
}
1678-
}
1679-
}
16801615

16811616
inst_it++;
16821617
}

visa/Passes/LVN.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class LVN {
120120

121121
void populateDuTable(INST_LIST_ITER inst_it);
122122
void removeAddrTaken(G4_AddrExp *opnd);
123-
void removeFlag(G4_Declare *topDck);
124123
void addUse(G4_DstRegRegion *dst, G4_INST *use, unsigned int srcIndex);
125124
void addValueToTable(G4_INST *inst, Value &oldValue);
126125
LVNItemInfo *isValueInTable(Value &value, bool negate);

0 commit comments

Comments
 (0)