This is an archive of the discontinued LLVM Phabricator instance.

Add opt-bisect support to additional passes that can be skipped
ClosedPublic

Authored by andrew.w.kaylor on May 3 2016, 11:22 AM.

Details

Summary

This pass adds the skip check used for opt-bisect and function "optnone" attribute handling to some passes that previously lacked the check but appear to be skippable.

I am also adding a new case to the opt-bisect test that verifies no pass is skipped that is run at opt level zero.

There are some problems remaining with AMDGPU passes that will cause the new test to fail on those platforms. I intend to address those issues in a separate patch.

Diff Detail

Repository
rL LLVM

Event Timeline

andrew.w.kaylor retitled this revision from to Add opt-bisect support to additional passes that can be skipped.
andrew.w.kaylor updated this object.
andrew.w.kaylor added a reviewer: probinson.
andrew.w.kaylor set the repository for this revision to rL LLVM.
andrew.w.kaylor added a subscriber: llvm-commits.
probinson accepted this revision.May 3 2016, 2:26 PM
probinson edited edge metadata.

SimplifyCFGPass needs to not call skipFunction twice, and one question on the test.
Otherwise LGTM.

lib/Transforms/Scalar/Reg2Mem.cpp
71 ↗(On Diff #56035)

Not something for you to fix, but this just looks weird. We run passes on functions that are just declarations?

lib/Transforms/Scalar/SimplifyCFGPass.cpp
212 ↗(On Diff #56035)

This one already calls skipFunction, just below. If you want to combine the conditions, for consistency with other passes, you should remove the other call.

test/Other/opt-bisect-legacy-pass-manager.ll
142 ↗(On Diff #56035)

It's not clear why you want to remove the call to function g. If this is in response to a review comment from a different review, that cleanup should be done independently as its own commit.

This revision is now accepted and ready to land.May 3 2016, 2:26 PM
andrew.w.kaylor added inline comments.May 3 2016, 2:38 PM
lib/Transforms/Scalar/Reg2Mem.cpp
71 ↗(On Diff #56035)

I think you're right. That shouldn't happen. Declarations get filtered out in the FPPassManager. Perhaps this is an artifact from some previous implementation?

I'll make a note to look into that as a separate change.

lib/Transforms/Scalar/SimplifyCFGPass.cpp
212 ↗(On Diff #56035)

Oops. I clean that up.

test/Other/opt-bisect-legacy-pass-manager.ll
142 ↗(On Diff #56035)

I took it out for AMDGPU. The AMDGPU targets don't allow call instructions, but they can't inline a call to an external function so this was just failing. I can move this change to the AMDGPU-specific patch since I'm marking the test as XFAIL for those platforms here anyway.

This revision was automatically updated to reflect the committed changes.