This is an archive of the discontinued LLVM Phabricator instance.

[ScalarizeMaskedMemIntrinsic] Move from CodeGen into Transforms
ClosedPublic

Authored by anna on Dec 1 2020, 10:22 AM.

Details

Summary

ScalarizeMaskedMemIntrinsic is currently a codeGen level pass. The pass is
actually operating on IR level and does not use any code gen specific passes.
It is useful to move it into transforms directory so that it can be more widely
used as a mid-level transform as well (apart from usage in codegen pipeline).
In particular, we have a usecase downstream where we would like to use this pass
in our mid-level pipeline which operates on IR level.

The next change will be to add support for new PM.

Diff Detail

Event Timeline

anna created this revision.Dec 1 2020, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2020, 10:22 AM
anna requested review of this revision.Dec 1 2020, 10:22 AM
anna updated this revision to Diff 308705.

missed adding new file into commit.

craig.topper added inline comments.Dec 1 2020, 2:36 PM
llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
19 ↗(On Diff #308705)

Someone of these could probably just be replaced with forward declarations.

23 ↗(On Diff #308705)

Is this including itself?

27 ↗(On Diff #308705)

It looks like most of Transforms/Scalar only has header files for the new pass manager class. Not the legacy pass manager class.

anna added inline comments.Dec 2 2020, 11:33 AM
llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
23 ↗(On Diff #308705)

ugh. yes.

27 ↗(On Diff #308705)

that's true (and the legacy PM classes are in the cpp files). However, I left this in here because:

  1. there no new PM support yet
  2. When new PM is added (will be the next change), we will need a header file anyway
  3. I'd added this header file in PassBuilder.h.... now I realize that's part of the new PM infrastructure and hence not needed in this patch.

Given I've mixed both "moving the pass into middle end and new PM support", I'm going to avoid the header file in this change and just do the move into the transforms/scalar directory.
The header file and PassBuilder change will be as part of new PM support.

anna updated this revision to Diff 309029.Dec 2 2020, 12:08 PM

addressed review comments

anna updated this revision to Diff 309314.Dec 3 2020, 11:06 AM

rebased over landed NFCs.

skatkov accepted this revision.Dec 7 2020, 7:22 PM

lgtm.

This revision is now accepted and ready to land.Dec 7 2020, 7:22 PM
This revision was landed with ongoing or failed builds.Dec 8 2020, 9:31 AM
This revision was automatically updated to reflect the committed changes.