[llvm] r367169 - [TargetLowering] Add depth limit to SimplifyMultipleUseDemandedBits
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 27 05:23:36 PDT 2019
Author: rksimon
Date: Sat Jul 27 05:23:36 2019
New Revision: 367169
URL: http://llvm.org/viewvc/llvm-project?rev=367169&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=367169&r1=367168&r2=367169&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sat Jul 27 05:23:36 2019
@@ -569,6 +569,9 @@ bool TargetLowering::SimplifyDemandedBit
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: {
More information about the llvm-commits
mailing list