This is an archive of the discontinued LLVM Phabricator instance.

[X86][NFC] Add X86CmovConverterPass to the pass registry
ClosedPublic

Authored by aaboud on Sep 28 2017, 5:27 AM.

Details

Summary

When use -print-after-all, the pass X86CmovConverterPass was not printing the function, make it harder to debug the pass.
The reason, was that it is was not registered as a pass.
This patch is solving that problem.

Notice, that I did not see any other target specific pass that is registered.
Please, let me know if that is intended and we should not register this pass as well.

Diff Detail

Repository
rL LLVM

Event Timeline

aaboud created this revision.Sep 28 2017, 5:27 AM
craig.topper added inline comments.Oct 1 2017, 4:43 PM
lib/Target/X86/X86CmovConversion.cpp
84 ↗(On Diff #116973)

Maybe do this in LLVMInitializeX86Target in X86TargetMachine.cpp? That's where we're doing the other passes that are registered.

craig.topper added inline comments.Oct 1 2017, 4:45 PM
lib/Target/X86/X86CmovConversion.cpp
84 ↗(On Diff #116973)

Or maybe we need to do it in both places?

aaboud marked an inline comment as done.Oct 2 2017, 10:02 AM
aaboud added inline comments.
lib/Target/X86/X86CmovConversion.cpp
84 ↗(On Diff #116973)

Cannot do in both places, you can register a pass only once.
I moved the registration to the LLVMInitializeX86Target as you suggested.

aaboud updated this revision to Diff 117380.Oct 2 2017, 10:03 AM

Addressed Craig comment.

aaboud updated this revision to Diff 117381.Oct 2 2017, 10:10 AM

Called "initializeX86CmovConverterPassPass" also from the pass constructor.

aaboud marked an inline comment as done.Oct 2 2017, 10:10 AM
aaboud added inline comments.
lib/Target/X86/X86CmovConversion.cpp
84 ↗(On Diff #116973)

Sorry, my mistake, we can call it twice.
Uploaded a new patch.

This revision is now accepted and ready to land.Oct 2 2017, 10:32 AM
This revision was automatically updated to reflect the committed changes.