summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorMarcello Maggioni <hayarms@gmail.com>2014-10-07 18:16:44 +0000
committerMarcello Maggioni <hayarms@gmail.com>2014-10-07 18:16:44 +0000
commit963bc87dbde1874f658b5ae85a431faaca5df3b8 (patch)
treec3b6c4c95137ed2960335b6adc4cfcda87604cdd /llvm/lib/Support/MemoryBuffer.cpp
parent640775b4282e68ba94efd8863a011d4065cf444f (diff)
downloadbcm5719-llvm-963bc87dbde1874f658b5ae85a431faaca5df3b8.tar.gz
bcm5719-llvm-963bc87dbde1874f658b5ae85a431faaca5df3b8.zip
Two case switch to select optimization
This optimization tries to convert switch instructions that are used to select a value with only 2 unique cases + default block to a select or a couple of selects (depending if the default block is reachable or not). The typical case this optimization wants to be able to optimize is this one: Example: switch (a) { case 10: %0 = icmp eq i32 %a, 10 return 10; %1 = select i1 %0, i32 10, i32 4 case 20: ----> %2 = icmp eq i32 %a, 20 return 2; %3 = select i1 %2, i32 2, i32 %1 default: return 4; } It also sets the base for further optimizations that are planned and being reviewed. llvm-svn: 219223
Diffstat (limited to 'llvm/lib/Support/MemoryBuffer.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud