This is an archive of the discontinued LLVM Phabricator instance.

[Bugpoint redesign] Added pass to reduce parameters
ClosedPublic

Authored by diegotf on Jul 30 2019, 3:17 PM.

Details

Summary

This diff implements a pass to reduce uninteresting parameters. It also modifies function calls to fit the new function signature, additionally, the pass removes any AllocInst for out-of-chunk arguments.

Diff Detail

Repository
rL LLVM

Event Timeline

diegotf created this revision.Jul 30 2019, 3:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2019, 3:17 PM
diegotf updated this revision to Diff 212453.Jul 30 2019, 3:22 PM

Re-ran clang-format

diegotf updated this revision to Diff 212675.Jul 31 2019, 3:18 PM

Renamed extract function to extractArgumentsFromModule

diegotf updated this revision to Diff 214260.Aug 8 2019, 4:32 PM

Updated diff & added python test

diegotf updated this revision to Diff 214261.Aug 8 2019, 4:33 PM

Updated diff so it contains only changes to baseline

Harbormaster completed remote builds in B36475: Diff 214261.

Having this pass remove AllocaInst too seems like it might be mixing responsibilities - presumably another pass might be invented to remove these AllocaInst separately? (& then it could get otherAllocaInst, other than just the ones used for parameters - like ones used for locals)

dblaikie added inline comments.Aug 14 2019, 1:24 PM
llvm/test/Reduce/remove-args.ll
12–41 ↗(On Diff #214261)

Some comments describing what purpose each part of this IR covers would be good - I probably wouldn't expect 'printf' to be in this test - maybe that one is to test functions declared but not defined? Naming the function to indicate that and/or adding comments to describe it would be helpful. (similarly for the other functions - main+func+func2 - what purpose does each one serve?)

diegotf marked 2 inline comments as done.Aug 14 2019, 3:39 PM

Having this pass remove AllocaInst too seems like it might be mixing responsibilities - presumably another pass might be invented to remove these AllocaInst separately? (& then it could get otherAllocaInst, other than just the ones used for parameters - like ones used for locals)

Yeah, I agree. I'll upload another pass to take care of instructions, and that should cleanup the remaining AllocaInsts

llvm/test/Reduce/remove-args.ll
12–41 ↗(On Diff #214261)

That is a great idea, I'll add some comments to clarify each part's purpose.

diegotf updated this revision to Diff 215282.Aug 14 2019, 4:30 PM
diegotf marked an inline comment as done.

Simplified test, and fixed oof-by-one error when replacing function calls

diegotf updated this revision to Diff 215494.Aug 15 2019, 4:14 PM

Updated test so it pipes the reduction to FileCheck directly from STDOUT

This revision was not accepted when it landed; it landed in state Needs Review.Sep 10 2019, 4:11 PM
This revision was automatically updated to reflect the committed changes.