[PATCH] D60673: [SimplifyCFG] Improove and speed up ReduceSwitchRange

Shawn Landden via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 14 15:03:29 PDT 2019


shawnl created this revision.
shawnl added reviewers: lebedev.ri, nikic.
shawnl added a project: LLVM.
Herald added a subscriber: llvm-commits.

This transform is cheap enough that there is no need to bail out. Also, the GCD calculation is unnecessary and wasteful, as it requires expensive division in the compiler. No programming languages I know of allow these numbers to be created programmatically, so there is no point in getting too smart and trying to do constant division on the keys with the GCD.

see PR 39046


Repository:
  rL LLVM

https://reviews.llvm.org/D60673

Files:
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/SimplifyCFG/switch-simplify-range.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60673.195086.patch
Type: text/x-patch
Size: 8409 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190414/784eb1c2/attachment.bin>


More information about the llvm-commits mailing list