diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2025-07-20 13:06:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-20 13:06:55 +0100 |
commit | 17c7c2ebe850b705df0fee4f1160d72097c6cb8f (patch) | |
tree | b75a29406d93a84dddacb7e418e375780b5b2204 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | e138c951550779143551b9bd3f66183f6ad5b3df (diff) | |
download | llvm-17c7c2ebe850b705df0fee4f1160d72097c6cb8f.zip llvm-17c7c2ebe850b705df0fee4f1160d72097c6cb8f.tar.gz llvm-17c7c2ebe850b705df0fee4f1160d72097c6cb8f.tar.bz2 |
[DAG] Add missing Depth argument to isGuaranteedNotToBeUndefOrPoison calls inside SimplifyDemanded methods (#149550)
Ensure we don't exceed the maximum recursion depth
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index e059798..37fddcf 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -778,7 +778,7 @@ SDValue TargetLowering::SimplifyMultipleUseDemandedBits( case ISD::FREEZE: { SDValue N0 = Op.getOperand(0); if (DAG.isGuaranteedNotToBeUndefOrPoison(N0, DemandedElts, - /*PoisonOnly=*/false)) + /*PoisonOnly=*/false, Depth + 1)) return N0; break; } @@ -3369,7 +3369,8 @@ bool TargetLowering::SimplifyDemandedVectorElts( case ISD::FREEZE: { SDValue N0 = Op.getOperand(0); if (TLO.DAG.isGuaranteedNotToBeUndefOrPoison(N0, DemandedElts, - /*PoisonOnly=*/false)) + /*PoisonOnly=*/false, + Depth + 1)) return TLO.CombineTo(Op, N0); // TODO: Replace this with the general fold from DAGCombiner::visitFREEZE |