Revert "(HEAD -> master, origin/master, arcpatch-D37582) CodeGen: Remove pipeline dependencies on StackProtector; NFC"
This was triggering pass scheduling failures. This reverts commit r336929. llvm-svn: 336934
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/CodeGen/SelectionDAGNodes.h"
|
||||
#include "llvm/CodeGen/SlotIndexes.h"
|
||||
#include "llvm/CodeGen/StackProtector.h"
|
||||
#include "llvm/CodeGen/TargetOpcodes.h"
|
||||
#include "llvm/CodeGen/WinEHFuncInfo.h"
|
||||
#include "llvm/Config/llvm-config.h"
|
||||
@@ -422,6 +423,9 @@ class StackColoring : public MachineFunctionPass {
|
||||
/// SlotIndex analysis object.
|
||||
SlotIndexes *Indexes;
|
||||
|
||||
/// The stack protector object.
|
||||
StackProtector *SP;
|
||||
|
||||
/// The list of lifetime markers found. These markers are to be removed
|
||||
/// once the coloring is done.
|
||||
SmallVector<MachineInstr*, 8> Markers;
|
||||
@@ -520,11 +524,13 @@ char &llvm::StackColoringID = StackColoring::ID;
|
||||
INITIALIZE_PASS_BEGIN(StackColoring, DEBUG_TYPE,
|
||||
"Merge disjoint stack slots", false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
|
||||
INITIALIZE_PASS_DEPENDENCY(StackProtector)
|
||||
INITIALIZE_PASS_END(StackColoring, DEBUG_TYPE,
|
||||
"Merge disjoint stack slots", false, false)
|
||||
|
||||
void StackColoring::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.addRequired<SlotIndexes>();
|
||||
AU.addRequired<StackProtector>();
|
||||
MachineFunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
||||
@@ -930,17 +936,9 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
|
||||
MergedAllocas.insert(From);
|
||||
MergedAllocas.insert(To);
|
||||
|
||||
// Transfer the stack protector layout tag, but make sure that SSPLK_AddrOf
|
||||
// does not overwrite SSPLK_SmallArray or SSPLK_LargeArray, and make sure
|
||||
// that SSPLK_SmallArray does not overwrite SSPLK_LargeArray.
|
||||
MachineFrameInfo::SSPLayoutKind FromKind
|
||||
= MFI->getObjectSSPLayout(SI.first);
|
||||
MachineFrameInfo::SSPLayoutKind ToKind = MFI->getObjectSSPLayout(SI.second);
|
||||
if (FromKind != MachineFrameInfo::SSPLK_None &&
|
||||
(ToKind == MachineFrameInfo::SSPLK_None ||
|
||||
(ToKind != MachineFrameInfo::SSPLK_LargeArray &&
|
||||
FromKind != MachineFrameInfo::SSPLK_AddrOf)))
|
||||
MFI->setObjectSSPLayout(SI.second, FromKind);
|
||||
// Allow the stack protector to adjust its value map to account for the
|
||||
// upcoming replacement.
|
||||
SP->adjustForColoring(From, To);
|
||||
|
||||
// The new alloca might not be valid in a llvm.dbg.declare for this
|
||||
// variable, so undef out the use to make the verifier happy.
|
||||
@@ -1141,6 +1139,7 @@ bool StackColoring::runOnMachineFunction(MachineFunction &Func) {
|
||||
MF = &Func;
|
||||
MFI = &MF->getFrameInfo();
|
||||
Indexes = &getAnalysis<SlotIndexes>();
|
||||
SP = &getAnalysis<StackProtector>();
|
||||
BlockLiveness.clear();
|
||||
BasicBlocks.clear();
|
||||
BasicBlockNumbering.clear();
|
||||
|
||||
Reference in New Issue
Block a user