[PATCH] D122485: [SimplifyCFG] Fold mutil cases to And mask

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 10:34:04 PDT 2022


bcl5980 added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:5646
 
-    // Early out if there are too many cases for this result.
-    if (NumCasesForResult > MaxCasesPerResult)
----------------
@spatel I'm a little worry about here. I remove the early out this version. It will cause compile time increase if we have some very large switch with many cases to the same result but not the pattern we can fold. But I have no detail data to show how much extra compile this change will be involved. Do we have some common compile time tests?
Another way to do is enlarge MaxCasesPerResult. The patch first version adjust MaxCasesPerResult to 16. But 16 is also a magic number. Maybe we can add a config for it.
How about your suggestions?



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122485/new/

https://reviews.llvm.org/D122485



More information about the llvm-commits mailing list