diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-10-22 16:51:03 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-10-22 16:51:03 +0000 |
commit | 24226504a7d18cb626e41f27c8154c95aa2bf08a (patch) | |
tree | 4e5ac85153f6eedef4f33c50b7eab21bf08d240e /lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp | |
parent | 81b756e6a3e491d43ac18ed39a9ffb13f45b9ea4 (diff) | |
download | bcm5719-llvm-24226504a7d18cb626e41f27c8154c95aa2bf08a.tar.gz bcm5719-llvm-24226504a7d18cb626e41f27c8154c95aa2bf08a.zip |
[SimplifyCFG] try harder to forward switch condition to phi (PR34471)
The missed canonicalization/optimization in the motivating test from PR34471 leads to very different codegen:
int switcher(int x) {
switch(x) {
case 17: return 17;
case 19: return 19;
case 42: return 42;
default: break;
}
return 0;
}
int comparator(int x) {
if (x == 17) return 17;
if (x == 19) return 19;
if (x == 42) return 42;
return 0;
}
For the first example, we use a bit-test optimization to avoid a series of compare-and-branch:
https://godbolt.org/g/BivDsw
Differential Revision: https://reviews.llvm.org/D39011
llvm-svn: 316293
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp')
0 files changed, 0 insertions, 0 deletions