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

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 05:58:30 PDT 2022


thakis accepted this revision.
thakis added inline comments.
This revision is now accepted and ready to land.


================
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.
----------------
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?


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