[PATCH] Use getFirstNonPHI to set the insertion point for PHIs

Justin Bogner mail at justinbogner.com
Thu Sep 26 14:35:56 PDT 2013

When creating new PHI instructions in SLPVectorizer and LoopVectorize,
we're setting the insertion point using getFirstInsertionPt. This does
the wrong thing when landingpads are present, since getFirstInsertionPt
skips past these.

The attached patch uses getFirstNonPHI instead, and adds a testcase that
crashes without the patch and passes with. Can someone please commit?

In the long term, it'd be nice if we had a better way to enforce using
this API correctly. I'm not sure what the best way to do this is. Any

-------------- next part --------------
A non-text attachment was scrubbed...
Name: phi_landingpad.patch
Type: text/x-patch
Size: 3981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130926/60781e3c/attachment.bin>

More information about the llvm-commits mailing list