Skip to content

Commit 2f350c0

Browse files
jgu222igcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: f16c84b
When folding a def to its use, need to make sure that use has that def as its single def. Otherwise, the use cannot be folded to.
1 parent d12d145 commit 2f350c0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

visa/Optimizer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4519,16 +4519,12 @@ bool Optimizer::foldPseudoNot(G4_BB* bb, INST_LIST_ITER& iter)
45194519
auto&& use = *uses;
45204520
G4_INST* useInst = use.first;
45214521
Gen4_Operand_Number opndPos = use.second;
4522-
if (!useInst->isLogic() || !G4_INST::isSrcNum(opndPos) ||
4523-
useInst->getSingleDef(opndPos) == nullptr /* not single def */)
4522+
if (!useInst->isLogic() || !G4_INST::isSrcNum(opndPos))
45244523
{
45254524
canFold = false;
45264525
break;
45274526
}
45284527

4529-
// sanity check
4530-
assert(useInst->getSingleDef(opndPos) == notInst);
4531-
45324528
// check the case where flag is partially used
45334529
G4_SrcRegRegion* opnd = useInst->getSrc(G4_INST::getSrcNum(opndPos))->asSrcRegRegion();
45344530
if (dst->compareOperand(opnd) != Rel_eq)

0 commit comments

Comments
 (0)