[PATCH] D77852: Outline CFI Instructions in Tail Calls
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 22:17:53 PDT 2020
paquette added a reviewer: thegameg.
paquette added a comment.
Francis, you had some concerns about unwinding here. Can you take a look as well?
================
Comment at: llvm/lib/CodeGen/MachineOutliner.cpp:1170-1171
+ OriginalMF->getFrameInstructions();
+ for(MCCFIInstruction CFI : Instrs)
+ (void)MF.addFrameInst(CFI);
+ }
----------------
It looks like you copy over every CFI from the (first) original function into the outlined function here.
However, I don't think that there are any guarantees that *every* CFI instruction from the original function is actually present in the outlined sequence right now.
================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5865
+ bool HasCFI = any_of(RepeatedSequenceLocs, [](outliner::Candidate &C) {
+ for (MachineBasicBlock::iterator mit : *(C.getMBB())) {
----------------
I don't think you have to check `any_of`. They should all contain the same instructions.
================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:6049-6050
+ if (FrameID != MachineOutlinerTailCall && HasCFI)
+ return outliner::OutlinedFunction();
+
----------------
We probably also want to check that the candidate has all of the original function's CFI instructions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77852/new/
https://reviews.llvm.org/D77852
More information about the llvm-commits
mailing list