diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-10-31 13:42:45 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-10-31 13:42:45 +0000 |
commit | e03d9e4ec7037526b94ce91985e7ff82ebc069fa (patch) | |
tree | 9ea5f59b7ef92e8909ae6e2aedab077cc1bee2f8 /lib/Transforms/Utils/SimplifyLibCalls.cpp | |
parent | e803d05bd87d1181c971fb719fef5638dd44ce99 (diff) |
Do simple constant propagation in lookup table formation for switches
By propagating the value for the switch condition, LLVM can now build
lookup tables for code such as:
switch (x) {
case 1: return 5;
case 2: return 42;
case 3: case 4: case 5:
return x - 123;
default:
return 123;
}
Given that x is known for each case, "x - 123" becomes a constant for
cases 3, 4, and 5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyLibCalls.cpp')
0 files changed, 0 insertions, 0 deletions