[PATCH] D25212: Add support to tune jump tables

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 15:48:31 PDT 2016


hans added inline comments.


> TargetLowering.h:1032
> +  /// Zero if no limit.
> +  unsigned getMinimumJumpTableSize() const;
> +

Having both this and getMinimumJumpTableEntries seems pretty confusing.

> TargetLowering.h:1040
> +  /// preferred.
> +  bool getFewJumpTables() const;
> +

I'll come back with more comments, but wanted to mention this one especially. First, the name seems backwards.

But the functionality of this seems very confusing. What does generating fewer jump tables "all else being equal" mean? Why not just turn off jump tables in that case?

> SelectionDAGBuilder.cpp:8550
> +             ((MoreJumpTables && Tables > NumTables[i]) ||
> +              (!MoreJumpTables && Tables < NumTables[i])))) {
>            MinPartitions[i] = NumPartitions;

I really don't like this. The purpose of this algorithm is to find jump tables. If you don't want to find jump tables, don't run it. If you think it's generating too large or sparse jump tables, tweak those parameters.

Repository:
  rL LLVM

https://reviews.llvm.org/D25212





More information about the llvm-commits mailing list