[llvm] [SimplifyCFG] Delete the unnecessary range check for small mask operation (PR #65835)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 07:11:07 PDT 2023


================
@@ -6545,6 +6544,17 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder,
 
   BranchInst *RangeCheckBranch = nullptr;
 
+  if (UseSwitchConditionAsTableIndex) {
----------------
vfdff wrote:

Thanks,  I'll update the commit message.
 it grows it to the maximum index value, but finally it will grow the table to the next pow2 value.
`uint64_t TableSizePowOf2 = NextPowerOf2(std::max(7ULL, TableSize - 1ULL));`

https://github.com/llvm/llvm-project/pull/65835


More information about the llvm-commits mailing list