]> granicus.if.org Git - llvm/commit
Split the SimplifyCFG pass into two variants.
authorJoerg Sonnenberger <joerg@bec.de>
Sun, 26 Mar 2017 06:44:08 +0000 (06:44 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Sun, 26 Mar 2017 06:44:08 +0000 (06:44 +0000)
commit3d72b7084237047c0026c5fd186219ffb733e6f0
tree20becf194df887675d5b5aa6bbc6c950201edbb2
parentc61c2fdaeaa0b99b02c5ef26c40b83504b339bee
Split the SimplifyCFG pass into two variants.

The first variant contains all current transformations except
transforming switches into lookup tables. The second variant
contains all current transformations.

The switch-to-lookup-table conversion results in code that is more
difficult to analyze and optimize by other passes. Most importantly,
it can inhibit Dead Code Elimination. As such it is often beneficial to
only apply this transformation very late. A common example is inlining,
which can often result in range restrictions for the switch expression.

Changes in execution time according to LNT:
SingleSource/Benchmarks/Misc/fp-convert +3.03%
MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CrystalMk -11.20%
MultiSource/Benchmarks/Olden/perimeter/perimeter -10.43%
and a couple of smaller changes. For perimeter it also results 2.6%
a smaller binary.

Differential Revision: https://reviews.llvm.org/D30333

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298799 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/llvm-c/Transforms/Scalar.h
include/llvm/InitializePasses.h
include/llvm/LinkAllPasses.h
include/llvm/Transforms/Scalar.h
include/llvm/Transforms/Scalar/SimplifyCFG.h
include/llvm/Transforms/Utils/Local.h
lib/LTO/LTOCodeGenerator.cpp
lib/Transforms/IPO/PassManagerBuilder.cpp
lib/Transforms/Scalar/Scalar.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll
test/Transforms/SimplifyCFG/CoveredLookupTable.ll
test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
test/Transforms/SimplifyCFG/X86/switch-table-bug.ll
test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
test/Transforms/SimplifyCFG/rangereduce.ll