SelectionDAG: fix logic for promoting shift types
authorFiona Glaser <escha@apple.com>
Fri, 29 May 2015 23:37:22 +0000 (23:37 +0000)
committerFiona Glaser <escha@apple.com>
Fri, 29 May 2015 23:37:22 +0000 (23:37 +0000)
commitdbf84c95fe91e15be7e90146e4d754b6b9c1005b
treeadee06f8819b60250855237dbdfb0ce97d6c8121
parentbfa311df8ca99f0565af96b7882dc25ce12da188
SelectionDAG: fix logic for promoting shift types

r238503 fixed the problem of too-small shift types by promoting them
during legalization, but the correct solution is to promote only the
operands that actually demand promotion.

This fixes a crash on an out-of-tree target caused by trying to
promote an operand that can't be promoted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238632 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp