This is an archive of the discontinued LLVM Phabricator instance.

Introducing VPPHINode
Needs RevisionPublic

Authored by npanchen on Oct 16 2018, 7:05 PM.

Details

Summary

[VPlan] Added VPPHINode class that is constructed and used to represent phi-nodes.

Detailed description:
Current representation of phi-nodes in VPlan completely depends on underlying IR, which means that any VPlan xform has to generate PHINode instruction that contradicts to VPlan's philosophy "Don't generate any IR instruction before decision is taken."

In this patch VPPHINode is constructed for phi-nodes and underlying IR is still used in CG.
In a next patch CG will be fixed so that it will not use underlying IR.

Diff Detail

Event Timeline

npanchen created this revision.Oct 16 2018, 7:05 PM

Hi Nikolay,

For what you describe, the patch looks good, ie. create a VPPHIInst. But it doesn't clearly show the benefits of doing so.

I can imagine that it would simplify reasoning and, as you say, avoid creating temporary instructions if not needed, but it would be good to have an example to base that claim.

Do you have the next patch somewhere? Would be good to put it in Phab, so we could look at it and make this review easier.

Thanks!
--renato

lib/Transforms/Vectorize/LoopVectorizationPlanner.h
142 ↗(On Diff #169931)

If you need Inst to be a PHI (or null), then maybe adding an assert would help, here.

Hi Nikolay,

For what you describe, the patch looks good, ie. create a VPPHIInst. But it doesn't clearly show the benefits of doing so.

I can imagine that it would simplify reasoning and, as you say, avoid creating temporary instructions if not needed, but it would be good to have an example to base that claim.

Do you have the next patch somewhere? Would be good to put it in Phab, so we could look at it and make this review easier.

Thanks!
--renato

Hi Renato,

Sorry for this long reply. As Satish has pointed out in his review, this VPPHINode will be used to generate blending.

npanchen updated this revision to Diff 182990.Jan 22 2019, 3:47 PM
npanchen marked an inline comment as done.

Sorry for this long reply. As Satish has pointed out in his review, this VPPHINode will be used to generate blending.

Right, that review has been approved. Once it lands, we should look into this patch and the one that will make use of it as a unit.

It can still remain as two separate patches, but by the looks of it, the next patch is not prepared to upstream yet, which means it can still have changes.

It would be good to see both patches, and with real tests on the second, to make sure the changes here are final.

thanks!
--renato

fhahn requested changes to this revision.Dec 23 2019, 12:45 PM

@npanchen are you still looking into pushing this patch? If that's the case, it would be great if you could rebase it and share the follow-up that uses the new node. Also, please upload the patch with full context.

Marking as requested changes to clear up review queue.

This revision now requires changes to proceed.Dec 23 2019, 12:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2019, 12:45 PM