This is an archive of the discontinued LLVM Phabricator instance.

Port ConstraintElimination to the new pass manager
ClosedPublic

Authored by MaskRay on Sep 26 2020, 2:19 PM.

Details

Summary

If -enable-constraint-elimination is specified, add it to the -O2/-O3 pipeline.
(-O1 uses a separate function now.)

Diff Detail

Event Timeline

MaskRay created this revision.Sep 26 2020, 2:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2020, 2:19 PM
MaskRay requested review of this revision.Sep 26 2020, 2:19 PM
aeubanks accepted this revision.Sep 26 2020, 2:53 PM
aeubanks added a subscriber: aeubanks.

thanks!

llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
17

this shouldn't be needed

This revision is now accepted and ready to land.Sep 26 2020, 2:53 PM
MaskRay updated this revision to Diff 294526.Sep 26 2020, 4:43 PM

Delete unneeded 'Function' declaration

MaskRay added inline comments.Sep 26 2020, 9:17 PM
llvm/lib/Passes/PassBuilder.cpp
611

I add it here to emulate to legacy pass manager builder's behavior.

I wonder whether the intention is to move some stuff from CorrelatedValuePropagationPass to ConstraintEliminationPass. Does it make sense to place ConstraintEliminationPass before/after CorrelatedValuePropagationPass?

fhahn accepted this revision.Sep 27 2020, 3:06 AM

Thanks for adding NPM support! Not sure if all tests should be also updated to add NPM run-lines.

llvm/lib/Passes/PassBuilder.cpp
611

The pass is quite new and not too much experimenting went into finding he ideal position in the pipeline. I expect the position to be adjusted as it evolves. It currently works best when most original conditions are still exposed and branches are used.

There is some overlap with CVP, but the main use case is handling cases that are not handled by CVP (or any other pass).

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
14

IIRC clang-format will sort the includes, so it might be best to move it to the final position?

MaskRay marked 2 inline comments as done.Sep 27 2020, 11:07 AM
MaskRay added inline comments.
llvm/lib/Passes/PassBuilder.cpp
611

Thanks for the reply. I'll keep it as is (having a consistent position with the legacy PM)

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
14

This is the final position. The coding standard prefers the main header as the first. clang-format does this (the main header gets the category 0 and has the highest priority).

This revision was automatically updated to reflect the committed changes.
MaskRay marked an inline comment as done.