-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to the new LLVM pass manager #252
Conversation
The unit tests seem ok but if I run |
mpm.addPass(llvm::GlobalDCEPass()); | ||
// TODO(alex): Figure out what to do here. | ||
// The new version of this pass only seems to have been added in LLVM 12. | ||
// mpm.addPass(llvm::StripDeadDebugInfoPass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pass was introduced in this commit. It'd be pretty easy to just write the wrapper ourselves if we wanted.
fpm.addPass(llvm::SimplifyCFGPass()); | ||
// TODO(alex): It doesn't seem to like this and complains about the pass not being registered. | ||
// Perhaps it's because we're nesting pass managers? | ||
// fpm.addPass(llvm::InstCombinePass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thing where we do another series of passes in a nested way seems to be causing a bit of trouble.
fpm.add(llvm::createSROAPass()); | ||
fpm.add(CreateSplitStackFrameAtReturnAddress(err_man)); | ||
fpm.add(llvm::createSROAPass()); | ||
AddSinkSelectionsIntoBranchTargets(fpm, err_man); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new pass manager doesn't take a pointer anymore. So if I want to do:
fpm.add(SinkSelectionsIntoBranchTargets(err_man))
Then I'd need to expose the headers for each of the passes and move them to libraries/anvill_passes/include
since we need the actual definitions to construct it. To avoid reorganising everything, I've exposed these helpers in Transform.h
to add the pass to the pass manager.
Closing in favour of #264 |
Closes #130