]> granicus.if.org Git - llvm/commit
[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets
authorEvandro Menezes <e.menezes@samsung.com>
Wed, 25 Sep 2019 16:10:20 +0000 (16:10 +0000)
committerEvandro Menezes <e.menezes@samsung.com>
Wed, 25 Sep 2019 16:10:20 +0000 (16:10 +0000)
commitbd5ddbcfebc47b25bf1493ced9dd66f1132f72d1
tree7f621c657bc553d98064b160cbf38c3c47562b01
parent314fba3fbfd99a0a94d19229c5060f625d3f080e
[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets

Modern processors predict the targets of an indirect branch regardless of
the size of any jump table used to glean its target address.  Moreover,
branch predictors typically use resources limited by the number of actual
targets that occur at run time.

This patch changes the semantics of the option `-max-jump-table-size` to limit
the number of different targets instead of the number of entries in a jump
table.  Thus, it is now renamed to `-max-jump-table-targets`.

Before, when `-max-jump-table-size` was specified, it could happen that
cluster jump tables could have targets used repeatedly, but each one was
counted and typically resulted in tables with the same number of entries.
With this patch, when specifying `-max-jump-table-targets`, tables may have
different lengths, since the number of unique targets is counted towards the
limit, but the number of unique targets in tables is the same, but for the
last one containing the balance of targets.

Differential revision: https://reviews.llvm.org/D60295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372893 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/BasicTTIImpl.h
include/llvm/CodeGen/SwitchLoweringUtils.h
include/llvm/CodeGen/TargetLowering.h
lib/CodeGen/SwitchLoweringUtils.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64Subtarget.cpp
lib/Target/AArch64/AArch64Subtarget.h
test/CodeGen/AArch64/max-jump-table.ll