Skip to content

Commit 4d97b3f

Browse files
azabaznoigcbot
authored andcommitted
Proper cleanup after matching reverse sqrt
1 parent ef2ad4e commit 4d97b3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXPatternMatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,9 +1766,9 @@ void GenXPatternMatch::visitFDiv(BinaryOperator &I) {
17661766
(IID == Intrinsic::sqrt && Divisor->getFastMathFlags().isFast())) &&
17671767
match(Op0, m_FPOne()) && Divisor->hasOneUse()) {
17681768
auto *Rsqrt = createInverseSqrt(Divisor->getOperand(0), Pos);
1769-
Divisor->eraseFromParent();
17701769
I.replaceAllUsesWith(Rsqrt);
17711770
I.eraseFromParent();
1771+
Divisor->eraseFromParent();
17721772

17731773
Changed |= true;
17741774
return;

0 commit comments

Comments
 (0)