This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Make the MachineFunctionSplitter pass testable via MIR
AbandonedPublic

Authored by dhoekwater on Aug 3 2023, 6:06 PM.

Details

Reviewers
None
Summary

Because the MachineFunctionSplitter pass isn't initialized in
CodeGen.cpp, running LLC with --run-pass machine-function-splitter
doesn't work. Adding it to the initializeCodeGen makes the function
splitting directly testable with .mir tests.

Diff Detail

Unit TestsFailed

Event Timeline

dhoekwater created this revision.Aug 3 2023, 6:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 6:06 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
dhoekwater requested review of this revision.Aug 3 2023, 6:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 6:06 PM
dhoekwater updated this revision to Diff 547073.Aug 3 2023, 6:11 PM

Remove an unnecessary line.

dhoekwater updated this revision to Diff 547875.
dhoekwater updated this revision to Diff 548415.Aug 8 2023, 5:30 PM

Rebase onto main to hopefully make unrelated test failures go away

Is there a specific reason to test MFS (on ARM) with MIR instead of .ll inputs? Only ~11% of the tests in test/CodeGen/AArch64 are in MIR, the rest are bitcode files. IMO bitcode is much easier to read, maintain and we can reuse most (all?) of the existing tests we have in machine-function-splitter.ll. So my preference would be to use bitcode unless there is a fundamental reason which blocks us from testing with bitcode.

dhoekwater abandoned this revision.EditedAug 9 2023, 2:58 PM

Is there a specific reason to test MFS (on ARM) with MIR instead of .ll inputs?

In a different review, I was asked to make MIR tests so that they only targeted a single pass. That doesn't seem necessary here, so I'll use bitcode tests instead. Dropping this revision and updating its dependents.

dhoekwater reclaimed this revision.Aug 28 2023, 4:13 PM
dhoekwater removed reviewers: shenhan, xur, snehasish, wenlei.

Try to replace with main to get this to work

Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 4:14 PM

Try to replace with a different branch to get this to work

Try to replace with yet another

dhoekwater abandoned this revision.Aug 28 2023, 4:16 PM