Transforms: Use getFirstNonPHI to set the insertion point for PHIs
authorJustin Bogner <mail@justinbogner.com>
Fri, 27 Sep 2013 15:30:25 +0000 (15:30 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 27 Sep 2013 15:30:25 +0000 (15:30 +0000)
commitd237e834a816399b7e1561dd4db2c501f5095712
tree86e680b36d931456afaed39efe9c66fc1985ca14
parent0548a5487ab8648c7c017f87c507ea1bc38bbb1f
Transforms: Use getFirstNonPHI to set the insertion point for PHIs

We were previously using getFirstInsertionPt to insert PHI
instructions when vectorizing, but getFirstInsertionPt also skips past
landingpads, causing this to generate invalid IR.

We can avoid this issue by using getFirstNonPHI instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191526 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/phi_landingpad.ll [new file with mode: 0644]