AMDGPU: Fix not adding to depth in getNegatedExpression
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 15 Feb 2023 12:31:40 +0000 (08:31 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 15 Feb 2023 12:32:58 +0000 (08:32 -0400)
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

index 1b1abc4..79fbbf5 100644 (file)
@@ -813,7 +813,7 @@ SDValue AMDGPUTargetLowering::getNegatedExpression(
     SDLoc SL(Op);
 
     SDValue NegSrc = getNegatedExpression(Src, DAG, LegalOperations,
-                                          ForCodeSize, Cost, Depth);
+                                          ForCodeSize, Cost, Depth + 1);
     if (NegSrc)
       return DAG.getNode(AMDGPUISD::RCP, SL, VT, NegSrc, Op->getFlags());
     return SDValue();