[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 04:29:28 PDT 2023


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

Thanks for the update!

For the commit message, I'd skip the godbolt link since that example is different. Also the text says it grows the table to the next pow2 value, which I don't think is true -- it grows it to the maximum index value, which doesn't have to be a power of two.

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


More information about the llvm-commits mailing list