Fix ScalarEvolutionExpander when creating a PHI in a block with duplicate predecessors
authorHal Finkel <hfinkel@anl.gov>
Thu, 31 Jul 2014 19:13:38 +0000 (19:13 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 31 Jul 2014 19:13:38 +0000 (19:13 +0000)
commit36eff0f854fa9f47394dc48dba195b93b6efac63
tree6ca39331e0116efa6cddb84e1f5e2d28484ab86c
parent6d3bd8f7ec0e702ec7ba2d8ac6da8a2be0ac68f9
Fix ScalarEvolutionExpander when creating a PHI in a block with duplicate predecessors

It seems that when I fixed this, almost exactly a year ago, I did not quite do
it correctly. When we have duplicate block predecessors, we can indeed not have
different incoming values for the same block, but we *must* have duplicate
entries. So, instead of skipping the duplicates, we explicitly add the
duplicate incoming values.

Fixes PR20442.

llvm-svn: 214423
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/test/CodeGen/PowerPC/pr20442.ll [new file with mode: 0644]