[PATCH] D127482: [SimplifyCFG] Share code to compute switch density between ShouldBuildLookupTable() and ReduceSwitchRange()

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 06:20:41 PDT 2022


hans marked an inline comment as done.
hans added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6119
                        const SmallDenseMap<PHINode *, Type *> &ResultTypes) {
-  if (SI->getNumCases() > TableSize || TableSize >= UINT64_MAX / 10)
-    return false; // TableSize overflowed, or mul below might overflow.
----------------
thakis wrote:
> Before we could handle table size up to `UINT64_MAX / 10`, after only up to `UINT64_MAX / 100`. That's not "no functionality change", is it?
I think it's still NFC in practice; we'd return false for table sizes of that magnitude anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127482/new/

https://reviews.llvm.org/D127482



More information about the llvm-commits mailing list