[PATCH] D109565: Teach SimplifyCFG to fold switches into lookup tables in more cases.

Owen Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 15 13:17:05 PDT 2021


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


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:5072
+    Constant *StrippedC = cast<Constant>(CE->stripInBoundsConstantOffsets());
+    if (StrippedC != C && !ValidLookupTableConstant(StrippedC, TTI))
       return false;
----------------
nikic wrote:
> Shouldn't this condition be `StrippedC == C ||`? What you're doing now is effectively allowing all constant expressions for which nothing can be stripped.
Done


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109565



More information about the llvm-commits mailing list