This is an archive of the discontinued LLVM Phabricator instance.

Fix : Partial Inliner requires AssumptionCacheTracker
ClosedPublic

Authored by rriddle on Jul 22 2016, 3:13 PM.

Details

Summary

The public InlineFunction utility assumes that the passed in InlineFunctionInfo has a valid AssumptionCacheTracker.

Diff Detail

Repository
rL LLVM

Event Timeline

rriddle updated this revision to Diff 65176.Jul 22 2016, 3:13 PM
rriddle retitled this revision from to Fix : Partial Inliner requires AssumptionCacheTracker.
rriddle updated this object.
rriddle added a reviewer: eraman.
rriddle added a subscriber: llvm-commits.
davide added a subscriber: davide.Jul 22 2016, 3:14 PM

You mean, port to the new pass manager?

It was already ported to the new pass manager, but given that InlineFunction directly accesses the ACT it will crash if run via legacy.

eraman requested changes to this revision.Jul 22 2016, 3:32 PM
eraman edited edge metadata.

Please split the adding of the dependence on AssumptionCache and the porting of the pass into the new PM into two separate passes. Also, note that you are not populating the ACT field of IFI in the new PM version of the code and that needs to be fixed.

This revision now requires changes to proceed.Jul 22 2016, 3:32 PM

Sorry, I was under the impression that the new pass managed had a functor for the ACT. I guess that was a pass that hadn't landed yet.

Sorry, I looked at Davide's previous comment and quickly made an incorrect conclusion. So this does only add the dependence to ACT, but you still need to populate ACT with the new PM.

Also, the pass was already ported to the new pass manager, this just moves the code into a different structure.

Oh, sigh, my bad. I was confused by the churn. Ignore my comment.

rriddle updated this revision to Diff 65184.Jul 22 2016, 3:53 PM
rriddle edited edge metadata.

Explicit dependency for LegacyPass

The new pass manager doesn't use AssumptionCacheTracker, providing a replacement instead with AssumptionAnalysis.

silvas added a subscriber: silvas.Jul 22 2016, 4:28 PM
silvas added inline comments.
/Users/rriddle/Desktop/llvm/llvm/lib/Transforms/IPO/PartialInlining.cpp
33 ↗(On Diff #65184)

Can you clang-format this class?

198 ↗(On Diff #65184)

You aren't passing assumption cache analysis stuff in here. This will require some refactoring of stuff that uses InlineFunctionInfo. I've already done that work as part of https://reviews.llvm.org/D21921. Give me a second and I'll spin that out and commit that. Then it should be easy to pass the assumption cache in here.

Also, can you add a test case?

rriddle updated this revision to Diff 65192.Jul 22 2016, 4:51 PM
rriddle edited edge metadata.

Fix the formatting of the implementation and added a test case for the assumption cache.

silvas added inline comments.Jul 22 2016, 9:34 PM
/Users/rriddle/Desktop/llvm/llvm/lib/Transforms/IPO/PartialInlining.cpp
200 ↗(On Diff #65192)

Should be done in r276515. Sorry for the delay.

rriddle updated this revision to Diff 65261.Jul 23 2016, 4:09 PM

Updated to reflect r276515

silvas added inline comments.Jul 24 2016, 7:24 PM
/Users/rriddle/Desktop/llvm/llvm/lib/Transforms/IPO/PartialInlining.cpp
123 ↗(On Diff #65261)

Can you split these formatting changes into a separate patch after this one? Even better, formatting + updating the naming would be a very welcome patch for this pass.

/Users/rriddle/Desktop/llvm/llvm/test/Transforms/Inline/partial-inline-act.ll
4 ↗(On Diff #65261)

Can you please put explicit names on the arguments (even just %0 and %1)?

rriddle updated this revision to Diff 65287.Jul 24 2016, 8:04 PM

Updated from Sean's comments

This revision was automatically updated to reflect the committed changes.

r276609, thanks!