[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 06:23:16 PDT 2022
thakis 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.
----------------
hans wrote:
> 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.
Should we just remove all the overflow checks then?
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