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

Justin Bogner mail at justinbogner.com
Thu Sep 26 17:22:26 PDT 2013


Eli Friedman <eli.friedman at gmail.com> writes:
>On Thu, Sep 26, 2013 at 2:35 PM, Justin Bogner <mail at justinbogner.com> wrote:
>> The attached patch uses getFirstNonPHI instead, and adds a testcase that
>> crashes without the patch and passes with. Can someone please commit?
>
> The patch is missing a testcase for the LoopVectorize change.

In LoopVectorize, a new BasicBlock is created and the PHI is inserted
into it. Since the new BasicBlock is obviously empty, it's impossible
for there to be a landingpad instruction, so getFirstInsertionPt and
getFirstNonPHI are functionally equivalent. This means that there's no
way to create a failing test.

Even so, using getFirstInsertionPt is incorrect, and could lead to
problems if things are shuffled around or if someone uses this as
example code.

> (On a side note, you should request commit access; seeĀ http://llvm.org/docs/
> DeveloperPolicy.html#obtaining-commit-access .)

I'll do that. Thanks.




More information about the llvm-commits mailing list