[llvm] 78c8451 - [Local] collectBitParts - reduce maximum recursion depth.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 03:43:02 PDT 2021


Author: Simon Pilgrim
Date: 2021-05-14T11:42:51+01:00
New Revision: 78c8451cd7b1d789fdd81beac0d3f7172bdce31c

URL: https://github.com/llvm/llvm-project/commit/78c8451cd7b1d789fdd81beac0d3f7172bdce31c
DIFF: https://github.com/llvm/llvm-project/commit/78c8451cd7b1d789fdd81beac0d3f7172bdce31c.diff

LOG: [Local] collectBitParts - reduce maximum recursion depth.

As noticed on D90170, the recursion depth for matching a maximum of a i128 bitwidth was too high.

@lebedev.ri mentioned that we can probably do better by limiting the number of collected Values instead of just depth, but I'll look at that later.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Local.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index ecabe21b4fc46..1f0646da7dd83 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -111,8 +111,8 @@ static cl::opt<unsigned> PHICSENumPHISmallSize(
         "perform a (faster!) exhaustive search instead of set-driven one."));
 
 // Max recursion depth for collectBitParts used when detecting bswap and
-// bitreverse idioms
-static const unsigned BitPartRecursionMaxDepth = 64;
+// bitreverse idioms.
+static const unsigned BitPartRecursionMaxDepth = 48;
 
 //===----------------------------------------------------------------------===//
 //  Local constant propagation.


        


More information about the llvm-commits mailing list