Fix a case where the new SROA pass failed to zap dead operands to
authorChandler Carruth <chandlerc@gmail.com>
Fri, 21 Sep 2012 23:36:40 +0000 (23:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 21 Sep 2012 23:36:40 +0000 (23:36 +0000)
commitd54a6b56a91c72cc33ce3dafcf1653123e6fdd87
tree4ff7c38ddea533a2c4ed7c3cbf8fe89fb1982145
parentc69bdadac9431efc0cfa6832a321e0f51ab4e6cd
Fix a case where the new SROA pass failed to zap dead operands to
selects with a constant condition. This resulted in the operands
remaining live through the SROA rewriter. Most of the time, this just
caused some dead allocas to persist and get zapped by later passes, but
in one case found by Joerg, it caused a crash when we tried to *promote*
the alloca despite it having this dead use. We already have the
mechanisms in place to handle this, just wire select up to them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164427 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/phi-and-select.ll