diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-07-27 12:23:36 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-07-27 12:23:36 +0000 |
commit | 3ff6126487ddc7636af83c70ee11a586d83ed59a (patch) | |
tree | 09320275072bba49ae2688d6b9538f763fec1691 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 6faac434ed6767c50b2bb3a9552982bcfb252dc8 (diff) | |
download | llvm-3ff6126487ddc7636af83c70ee11a586d83ed59a.zip llvm-3ff6126487ddc7636af83c70ee11a586d83ed59a.tar.gz llvm-3ff6126487ddc7636af83c70ee11a586d83ed59a.tar.bz2 |
[TargetLowering] Add depth limit to SimplifyMultipleUseDemandedBits
We're getting reports of massive compile time increases because SimplifyMultipleUseDemandedBits was losing track of the depth and not earlying-out. No repro yet, but consider this a pre-emptive commit.
llvm-svn: 367169
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 6bfb388..1173beb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -569,6 +569,9 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, const APInt &DemandedBits, SDValue TargetLowering::SimplifyMultipleUseDemandedBits( SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts, SelectionDAG &DAG, unsigned Depth) const { + if (Depth == 6) // Limit search depth. + return SDValue(); + KnownBits LHSKnown, RHSKnown; switch (Op.getOpcode()) { case ISD::AND: { |