Transforms: Don't create bad branch weights when folding a switch
authorJustin Bogner <mail@justinbogner.com>
Tue, 10 Dec 2013 00:13:41 +0000 (00:13 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 10 Dec 2013 00:13:41 +0000 (00:13 +0000)
commit31eaed9c6d6748d967654ffecee8c6ba77726651
tree654b626a3d2f74a34224e99e7b8e521c25983b93
parent4a644cc525e655b2c555d94b2e37ff7730ab820e
Transforms: Don't create bad branch weights when folding a switch

This avoids creating branch weight metadata of length one when we fold
cases into the default of a switch instruction, which was triggering
an assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196845 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/Local.cpp
test/Transforms/SimplifyCFG/preserve-branchweights.ll