[PATCH] D42726: [x86] Make the retpoline thunk insertion a machine function pass.
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 10:22:29 PST 2018
MatzeB added inline comments.
================
Comment at: llvm/lib/Target/X86/X86RetpolineThunks.cpp:61
void getAnalysisUsage(AnalysisUsage &AU) const override {
+ FunctionPass::getAnalysisUsage(AU);
AU.addRequired<MachineModuleInfo>();
----------------
Is this not using `MachineFunctionPass::getAnalysisUsage()` on purpose?
================
Comment at: llvm/lib/Target/X86/X86RetpolineThunks.cpp:211
+void X86RetpolineThunks::createThunkFunction(Module &M, StringRef Name) {
LLVMContext &Ctx = M.getContext();
auto Type = FunctionType::get(Type::getVoidTy(Ctx), false);
----------------
Add `assert(Name.startswith(ThunkNamePrefix))` as the runOnMachineFunction logic depends on it?
================
Comment at: llvm/lib/Target/X86/X86RetpolineThunks.cpp:266
+void X86RetpolineThunks::populateThunk(MachineFunction &MF,
Optional<unsigned> Reg) {
// Set MF properties. We never use vregs...
----------------
indent
Repository:
rL LLVM
https://reviews.llvm.org/D42726
More information about the llvm-commits
mailing list