This is an archive of the discontinued LLVM Phabricator instance.

[VPlan][WIP] VMULH via multiple inheritance
AbandonedPublic

Authored by dmgreen on Sep 23 2020, 7:59 AM.

Details

Summary

This is not ready for review yet. At the very least, it will not do anything properly without adjusting the cost model for the adjusted vplan (it will currently just use the sum of the costs for the instructions in the original loop). It is probably several commits in one.

It is meant mostly as an illustration to show different ways of vplan working, between multiple inheritance and inheriting through VPRecipeBase. It sits on top of the patches linked to D84679, but is still in a very rough state.

The patch:

  • Adds a adjustVPlanForVectorPatterns to transform VPlans to other vector patterns.
  • Adds tryCombineToMulh to match trunc(lsr(mul(ext, ext)), BW)) and convert it to a VPInstruction::vmulh node in the vplan graph.
  • It adds some simple vp_ pattern matchers.

In order to do this it makes the various VPRecipe's inherit from VPUser, VPValue and VPRecipe (where needed), as is done in D84679. It adds the extra casting logic needed, but I believe recursivelyDeleteUnusedRecipes does not work here (but probably could be made to with some extra love).

Diff Detail

Event Timeline

dmgreen created this revision.Sep 23 2020, 7:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
dmgreen requested review of this revision.Sep 23 2020, 7:59 AM
dmgreen abandoned this revision.Nov 1 2020, 11:10 PM

This is no longer needed. I think there are simpler ways to do it than this.