diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-01-12 00:44:41 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-01-12 00:44:41 +0000 |
commit | 19236d53eb6f4ee4538ac12efcd77000b2f7ae78 (patch) | |
tree | d8012f87d9e6d7d3d00f1efa5a98ded6d09f66a4 /lib/Target/ARM/ARMInstrInfo.td | |
parent | 50e6d23f0d50d69b14eecd6a38a375cc07101a07 (diff) | |
download | llvm-19236d53eb6f4ee4538ac12efcd77000b2f7ae78.tar.gz llvm-19236d53eb6f4ee4538ac12efcd77000b2f7ae78.tar.bz2 llvm-19236d53eb6f4ee4538ac12efcd77000b2f7ae78.tar.xz |
Switch-to-lookup tables: Don't require a result for the default
case when the lookup table doesn't have any holes.
This means we can build a lookup table for switches like this:
switch (x) {
case 0: return 1;
case 1: return 2;
case 2: return 3;
case 3: return 4;
default: exit(1);
}
The default case doesn't yield a constant result here, but that doesn't matter,
since a default result is only necessary for filling holes in the lookup table,
and this table doesn't have any holes.
This makes us transform 505 more switches in a clang bootstrap, and shaves 164 KB
off the resulting clang binary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMInstrInfo.td')
0 files changed, 0 insertions, 0 deletions