Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Remove MachineModulePass from LLVM #31

Open
Emoun opened this issue Dec 5, 2020 · 3 comments
Open

Remove MachineModulePass from LLVM #31

Emoun opened this issue Dec 5, 2020 · 3 comments

Comments

@Emoun
Copy link
Member

Emoun commented Dec 5, 2020

A customization to LLVM that we have is llvm/CodeGen/MachineModulePass. The LLVM project has moved in a different direction, so we should get ready to do so too.

Back when we implemented MachineModulePass there was no way in LLVM to do so. Therefore, we added it to LLVM with the hope that some day LLVM would also provide it.
After looking into the history of this feature, I have concluded that the LLVM project decided on a different API for doing "machine module passes".
From what I can tell, they edited the codegen step of the backend to allow ModulePass to be used in it. This means MachineModulePasses can simply extend ModulePass.

As a result, I propose to move MachineModulePass into the Patmos folder for now. Then, as we port to LLVM 11, we switch to using the LLVM machine module pass infrastructure.

Note: I made a gist summarizing my finding with sources for anyone interested: here.

@Emoun
Copy link
Member Author

Emoun commented Dec 7, 2020

We cannot trivially move MachineModulePass into the Patmos folder as the serialization pass depends on it.
Serialization is also a customization of the LLVM, which means it must also be moved into the Patmos folder to continue to use MachineModulePass.

We could move the serialization into the Patmos folder, however, it seems that platin also supports ARM targets, which means it might have been the plan to add the serialization to the ARM backend too.

@Emoun
Copy link
Member Author

Emoun commented Dec 8, 2020

Serialization is not enabled for the ARM targets, so effectively PML Import/Export is a Patmos specific pass. Will move it into the Patmos folder.

@Emoun
Copy link
Member Author

Emoun commented Dec 9, 2020

Moving PML Import/Export into the Patmos folder results in clang failing to build, since it uses the PML.h header.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant