This is an archive of the discontinued LLVM Phabricator instance.

[IPSCCP] Move the IPSCCP run function under the IPO directory.
ClosedPublic

Authored by labrinea on Nov 24 2022, 4:15 AM.

Details

Summary

The LLVMipo library no longer depends on the Scalar component. The shared functions between IPSCCP and SCCP have been moved under Utils, in the SCCPSolver.

This is preliminary work for D126455, in order to break cyclic dependecy of LLVM libraries.

Diff Detail

Event Timeline

labrinea created this revision.Nov 24 2022, 4:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2022, 4:15 AM
labrinea requested review of this revision.Nov 24 2022, 4:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2022, 4:15 AM
labrinea added inline comments.Nov 24 2022, 4:18 AM
llvm/lib/Transforms/Scalar/SCCP.cpp
61–64

Some of these were used in IPSCCP, but it seems wrong to me. Now that I've separated SCCP from IPSCCP, I've duplicated any shared statistics.

chill accepted this revision.Nov 28 2022, 2:24 AM
This revision is now accepted and ready to land.Nov 28 2022, 2:24 AM
This revision was landed with ongoing or failed builds.Dec 8 2022, 4:23 AM
This revision was automatically updated to reflect the committed changes.
labrinea updated this revision to Diff 481621.EditedDec 9 2022, 6:21 AM

The previous commit regressed some buildbots:

undefined reference to `llvm::createBitTrackingDCEPass()'
undefined reference to `llvm::createAlignmentFromAssumptionsPass()'
undefined reference to `llvm::createLoopUnrollPass(int, bool, bool, int, int, int, int, int, int)'
undefined reference to `llvm::createLICMPass(unsigned int, unsigned int, bool)'
undefined reference to `llvm::createWarnMissedTransformationsPass()'
undefined reference to `llvm::createAlignmentFromAssumptionsPass()'
undefined reference to `llvm::createCallSiteSplittingPass()'
undefined reference to `llvm::createCFGSimplificationPass(llvm::SimplifyCFGOptions, std::function<bool (llvm::Function const&)>)'
undefined reference to `llvm::createFloat2IntPass()'
undefined reference to `llvm::createLowerConstantIntrinsicsPass()'
undefined reference to `llvm::createLoopRotatePass(int, bool)'
undefined reference to `llvm::createLoopDistributePass()'
undefined reference to `llvm::createLoopSinkPass()'
undefined reference to `llvm::createInstSimplifyLegacyPass()'
undefined reference to `llvm::createDivRemPairsPass()'
undefined reference to `llvm::createCFGSimplificationPass(llvm::SimplifyCFGOptions, std::function<bool (llvm::Function const&)>)'
undefined reference to `llvm::SetLicmMssaOptCap'
undefined reference to `llvm::SetLicmMssaNoAccForPromotionCap'
undefined reference to `llvm::ForgetSCEVInLoopUnroll'

This is fixed by reintroducing one of the two occurences of 'Scalar' under the LINK_COMPONENTS.

labrinea reopened this revision.Dec 9 2022, 6:21 AM
This revision is now accepted and ready to land.Dec 9 2022, 6:21 AM
labrinea requested review of this revision.Dec 9 2022, 6:21 AM
chill accepted this revision.Dec 9 2022, 6:24 AM
This revision is now accepted and ready to land.Dec 9 2022, 6:24 AM
This revision was landed with ongoing or failed builds.Dec 9 2022, 7:05 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Dec 9 2022, 7:54 AM
thakis added inline comments.
llvm/lib/Transforms/IPO/CMakeLists.txt
68–69

Since this is now still here, doesn't this render "The LLVMipo library no longer depends on the Scalar component." incorrect?

labrinea added inline comments.Dec 9 2022, 8:44 AM
llvm/lib/Transforms/IPO/CMakeLists.txt
68–69

Right. The commit message is outdated. What this patch achieves is that D126455 no longer needs to add Scalar->IPO dependency which would create a cycle.