[PATCH] D135982: [SimplifyCFG] Try unsigned case value for switch to lookup table

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 18:10:40 PDT 2022


bcl5980 marked an inline comment as done.
bcl5980 added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6373
+  // try unsigned if the case value is signed overflow
+  if (MinCaseVal->isMinSignedValue() && MaxCaseVal->isMaxValue(true)) {
+    for (auto Case : SI->cases()) {
----------------
craig.topper wrote:
> Why not use `isMaxSignedValue` to be consistent with the use of `isMinSignedValue`?
There is no `isMaxSignedValue` in Constant class. 
`isMaxSignedValue` is on the APInt class.


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

https://reviews.llvm.org/D135982



More information about the llvm-commits mailing list