[PATCH] D60295: [CodeGen] Replace -max-jump-table-size with -max-jump-table-targets

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 08:32:57 PDT 2019


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


================
Comment at: llvm/include/llvm/CodeGen/SwitchLoweringUtils.h:236
+                                bool HasReachableDefault,
+                                uint64_t Cases, uint64_t Range);
+
----------------
evandro wrote:
> hans wrote:
> > Since it has access to Clusters and First and Last, passing in Cases and Range seems redundant. It seems the function should be able to figure those things out itself.
> That is true, but, whenever `getJumpTableNumTargets()` is called, those values are calculated and then used again.  So, at least for this use case, it seems to be more efficient to let `getJumpTableNumTargets()` calculate and return them through references.
I take it back.  `Cases` needs the `TotalCases` array to be calculated.  So, no, with the current arguments, `getJumpTableNumCases()` can only figure `Range` out.


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

https://reviews.llvm.org/D60295





More information about the llvm-commits mailing list