[llvm] [SimplifyCFG] Find the minimal table considering overflow in `switchToLookupTable` (PR #67885)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 1 01:45:30 PDT 2023


================
@@ -6378,18 +6378,20 @@ ShouldBuildLookupTable(SwitchInst *SI, uint64_t TableSize,
 }
 
 static bool ShouldUseSwitchConditionAsTableIndex(
-    ConstantInt &MinCaseVal, const ConstantInt &MaxCaseVal,
+    ConstantInt &BeginCaseVal, const ConstantInt &EndCaseVal,
----------------
dtcxzyw wrote:

```suggestion
    const ConstantInt &BeginCaseVal, const ConstantInt &EndCaseVal,
```
`BeginCaseVal` is read-only.


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


More information about the llvm-commits mailing list