This is an archive of the discontinued LLVM Phabricator instance.

[LV] Fix PR38786 - consider first order recurrence phis non-uniform
ClosedPublic

Authored by orivej on Sep 4 2018, 8:57 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

orivej created this revision.Sep 4 2018, 8:57 AM
anna accepted this revision.Sep 4 2018, 9:00 AM

LGTM. thanks for the fix!

This revision is now accepted and ready to land.Sep 4 2018, 9:00 AM
orivej updated this revision to Diff 163843.Sep 4 2018, 9:14 AM

Renamed %i32as64 to %i64next.

orivej updated this revision to Diff 163849.Sep 4 2018, 9:34 AM

Specify in the test comment that this is not about all phis, but only about first order recurrence phis.

orivej added inline comments.Sep 4 2018, 9:40 AM
test/Transforms/LoopVectorize/X86/uniform-phi.ll
90

Note: if I replace %i64next = zext i32 %i32next to i64 with %i64next = add i64 %phi64, 1 it ceases to be a first order recurrence, and the loop vectorizer considers %phi32 and %phi64 uniform and correctly optimizes this.

anna added inline comments.Sep 4 2018, 9:56 AM
test/Transforms/LoopVectorize/X86/uniform-phi.ll
90

yes, that is expected :)

iv64next is a uniform IV user, so both the phis and their increments are considered uniforms. See the processing of uniforms for IV phis in the source code, just after the above fix.

I think this is ready. Would someone like to commit it?

anna added a comment.Sep 4 2018, 2:01 PM

I think this is ready. Would someone like to commit it?

Okay, I'll commit it.

This revision was automatically updated to reflect the committed changes.