SimplifyCFG: Track the number of used icmps when turning a icmp chain into a switch...
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 7 Feb 2011 22:37:28 +0000 (22:37 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 7 Feb 2011 22:37:28 +0000 (22:37 +0000)
commit33828bcb24176aae72afac0e4953e4b7f9560ef1
treee5e5d47983c6c1ea457955f84a56b467856f45dc
parent706d946cfe44fa93f482c3a56ed42d52ca81b257
SimplifyCFG: Track the number of used icmps when turning a icmp chain into a switch. If we used only one icmp, don't turn it into a switch.

Also prevent the switch-to-icmp transform from creating identity adds, noticed by Marius Wachtler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125056 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/switch-to-icmp.ll
test/Transforms/SimplifyCFG/switch_create.ll
test/Transforms/SimplifyCFG/switch_formation.dbg.ll