diff options
author | Matthias Braun <matze@braunis.de> | 2018-07-13 00:08:38 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2018-07-13 00:08:38 +0000 |
commit | d79789afc64bdd2ef879c97f97848f436bf0692d (patch) | |
tree | 478f4841e1a79b702ae3c6023392cc2b4ca302fc /lib/Target/Mips | |
parent | 674f0a117445cc5c1c8fd0ed51ff2377197ede1f (diff) |
CodeGen: Remove pipeline dependencies on StackProtector; NFC
This re-applies r336929 with a fix to accomodate for the Mips target
scheduling multiple SelectionDAG instances into the pass pipeline.
PrologEpilogInserter and StackColoring depend on the StackProtector analysis
being alive from the point it is run until PEI, which requires that they are all
scheduled in the same FunctionPassManager. Inserting a (machine) ModulePass
between StackProtector and PEI results in these passes being in separate
FunctionPassManagers and the StackProtector is not available for PEI.
PEI and StackColoring don't use much information from the StackProtector pass,
so transfering the required information to MachineFrameInfo is cleaner than
keeping the StackProtector pass around. This commit moves the SSP layout
information to MFI instead of keeping it in the pass.
This patch set (D37580, D37581, D37582, D37583, D37584, D37585, D37586, D37587)
is a first draft of the pagerando implementation described in
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113794.html.
Patch by Stephen Crane <sjc@immunant.com>
Differential Revision: https://reviews.llvm.org/D49256
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r-- | lib/Target/Mips/MipsISelDAGToDAG.cpp | 8 | ||||
-rw-r--r-- | lib/Target/Mips/MipsISelDAGToDAG.h | 2 | ||||
-rw-r--r-- | lib/Target/Mips/MipsModuleISelDAGToDAG.cpp | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp index 7e843512f6e..f99f3a1b3e0 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp @@ -24,6 +24,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/CodeGen/StackProtector.h" #include "llvm/IR/CFG.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/Instructions.h" @@ -46,6 +47,13 @@ using namespace llvm; // instructions for SelectionDAG operations. //===----------------------------------------------------------------------===// +void MipsDAGToDAGISel::getAnalysisUsage(AnalysisUsage &AU) const { + // There are multiple MipsDAGToDAGISel instances added to the pass pipeline. + // We need to preserve StackProtector for the next one. + AU.addPreserved<StackProtector>(); + SelectionDAGISel::getAnalysisUsage(AU); +} + bool MipsDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) { Subtarget = &static_cast<const MipsSubtarget &>(MF.getSubtarget()); bool Ret = SelectionDAGISel::runOnMachineFunction(MF); diff --git a/lib/Target/Mips/MipsISelDAGToDAG.h b/lib/Target/Mips/MipsISelDAGToDAG.h index 5a871b5930a..09003459d18 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.h +++ b/lib/Target/Mips/MipsISelDAGToDAG.h @@ -41,6 +41,8 @@ public: bool runOnMachineFunction(MachineFunction &MF) override; + void getAnalysisUsage(AnalysisUsage &AU) const override; + protected: SDNode *getGlobalBaseReg(); diff --git a/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp b/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp index 0be5abca03f..a2b55e8bddc 100644 --- a/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp @@ -11,6 +11,7 @@ #include "Mips.h" #include "MipsTargetMachine.h" #include "llvm/CodeGen/TargetPassConfig.h" +#include "llvm/CodeGen/StackProtector.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -32,6 +33,7 @@ namespace { void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired<TargetPassConfig>(); + AU.addPreserved<StackProtector>(); MachineFunctionPass::getAnalysisUsage(AU); } |