This is an archive of the discontinued LLVM Phabricator instance.

Add optimization bisect opt-in calls for Mips passes
ClosedPublic

Authored by andrew.w.kaylor on Apr 25 2016, 4:53 PM.

Details

Summary

This patch adds a call to opt-in to the optimization bisect mechanism into the only Mips-specific pass that I was confident could be safely skipped.

I selected the pass to be skipped based on the fact that it was not added at CodeGenOpt::None in MipsTargetMachine.cpp. Based on that criteria, I did not add opt-in calls to the following passes:

Mips16HardFloat
MipsConstantIslands
MipsHazardSchedule
MipsModuleDAGToDAGISel
MipsLongBranch
MipsOs16
Filler (delay slot filler)

During the original opt bisect code review there was speculation that MipsOs16 might be skippable, but since it isn't omitted for CodeGenOpt::None I decided to leave it alone for now.

Note that the call to skipFunction() will also check for the "optnone" function attribute, so this can theoretically result in passes being skipped even when optimization bisect is not being done. However, I believe that any pass that can be safely skipped should be skipped for functions with the optnone attribute.

Diff Detail

Repository
rL LLVM

Event Timeline

andrew.w.kaylor retitled this revision from to Add optimization bisect opt-in calls for Mips passes.
andrew.w.kaylor updated this object.
andrew.w.kaylor added a reviewer: dsanders.
andrew.w.kaylor set the repository for this revision to rL LLVM.
andrew.w.kaylor added a subscriber: llvm-commits.
dsanders accepted this revision.Jul 14 2016, 6:48 AM
dsanders edited edge metadata.

LGTM

I selected the pass to be skipped based on the fact that it was not added at CodeGenOpt::None in MipsTargetMachine.cpp. Based on that criteria, I did not add opt-in calls to the following passes:

Mips16HardFloat
MipsConstantIslands
MipsHazardSchedule
MipsModuleDAGToDAGISel
MipsLongBranch

I agree that these are all mandatory for the cases where they do something. A few of them will choose not to act on targets that don't need them (e.g. Mips16HardFloat)

MipsOs16
During the original opt bisect code review there was speculation that MipsOs16 might be skippable, but since it isn't omitted for CodeGenOpt::None I decided to leave it alone for now.

I think this is skippable but I'm not 100% certain since I haven't done much with MIPS16. It looks like it's just choosing whether to use the compressed instruction set or not.

Filler (delay slot filler)

This pass is mandatory but it doesn't have to find useful instructions for the delay slot. The DisableDelaySlotFiller variable forces it to insert nops instead. If you add the skipFunction() call where DisableDelaySlotFiller is used then you can skip the optional parts of the work. This can be done in a separate patch if you prefer.

This revision is now accepted and ready to land.Jul 14 2016, 6:48 AM

Looks like patch was not committed.

Andrew, ping?

I apologize for the delay. I forgot about this patch. I'll get it committed today.

This revision was automatically updated to reflect the committed changes.