aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-09-06 09:43:28 +0000
committerHans Wennborg <hans@hanshq.net>2012-09-06 09:43:28 +0000
commit486270aee6ffd2a0c3c2333a8a0091c29f037aae (patch)
tree61d8a3cde0a2906aa8492b476de25f2ee88a00a9 /lib/Target/ARM/Disassembler/ARMDisassembler.cpp
parentc05d30601ced172b55be81bb529df6be91d6ae15 (diff)
Build lookup tables for switches (PR884)
This adds a transformation to SimplifyCFG that attemps to turn switch instructions into loads from lookup tables. It works on switches that are only used to initialize one or more phi nodes in a common successor basic block, for example: int f(int x) { switch (x) { case 0: return 5; case 1: return 4; case 2: return -2; case 5: return 7; case 6: return 9; default: return 42; } This speeds up the code by removing the hard-to-predict jump, and reduces code size by removing the code for the jump targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions