[PATCH] D31085: [InlineCost] Increase the cost of Switch

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 14:04:02 PDT 2017


hans added inline comments.


================
Comment at: include/llvm/Target/TargetLowering.h:787
+  bool isSuitableForJumpTable(const SwitchInst *SI, uint64_t NumCases,
+                              uint64_t Range) const {
+    const bool OptForSize = SI->getParent()->getParent()->optForSize();
----------------
It still seems backward that this is checking density and maximum table size, but that the minimum size is expected to be checked elsewhere :-/ There must be some better way to factor this.


https://reviews.llvm.org/D31085





More information about the llvm-commits mailing list