Fix Scalarizer insertion point when replacing PHIs with insertelements
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Mon, 23 Dec 2013 14:51:56 +0000 (14:51 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Mon, 23 Dec 2013 14:51:56 +0000 (14:51 +0000)
commit166acc94892f78cdd78a28b30b218ad73cb785fb
treed4095fc08bd3534c8959d69c55073908de6d522a
parentb09beed5408f859d8dabfb1a93766d2aedd19280
Fix Scalarizer insertion point when replacing PHIs with insertelements

If the Scalarizer scalarized a vector PHI but could not scalarize
all uses of it, it would insert a series of insertelements to reconstruct
the vector PHI value from the scalar ones.  The problem was that it would
emit these insertelements immediately after the PHI, even if there were
other PHIs after it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197909 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/Scalarizer.cpp
test/Transforms/Scalarizer/basic.ll