[PATCH] D42600: [CodeGen][Shrink-wrap]split restore point
Sushant Gokhale via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 01:12:27 PDT 2023
sushgokh added a comment.
@nickdesaulniers Does this look good ?
--- a/llvm/lib/CodeGen/ShrinkWrap.cpp
+++ b/llvm/lib/CodeGen/ShrinkWrap.cpp
@@ -601,6 +601,16 @@ bool ShrinkWrap::postShrinkWrapping(bool HasCandidate, MachineFunction &MF,
CleanPreds, TII, RS))
return false;
+ // FIXME: Currently, we bail out of optimisation if any of the DirtyPreds has
+ // INLINEASM_BR instruction. Also, if restore pt block address is taken, we
+ // need to make suitable changes post restore point split
+ for (MachineBasicBlock *BB : DirtyPreds)
+ for (const MachineInstr &MI : *BB)
+ if (MI.getOpcode() == TargetOpcode::INLINEASM_BR)
+ for (const MachineOperand &MO : MI.operands())
+ if (MO.isMBB() && MO.getMBB() == InitRestore)
+ return false;
+
// Trying to reach out to the new save point which dominates all dirty blocks.
MachineBasicBlock *NewSave =
FindIDom<>(**DirtyPreds.begin(), DirtyPreds, *MDT, false);
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D42600/new/
https://reviews.llvm.org/D42600
More information about the llvm-commits
mailing list