summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-05-09 01:14:39 +0000
committerReid Kleckner <rnk@google.com>2017-05-09 01:14:39 +0000
commit9f29914d4018c0c8ef2b7b7bceffb0d07483e89c (patch)
tree1bc28cf75b76a0ad46025a0ab5d9bedc36c4b57a /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent42af6513589dbaf28b98a2d30d92cdd6a4884cc0 (diff)
downloadbcm5719-llvm-9f29914d4018c0c8ef2b7b7bceffb0d07483e89c.tar.gz
bcm5719-llvm-9f29914d4018c0c8ef2b7b7bceffb0d07483e89c.zip
Revert "Use the frame index side table for byval and inalloca arguments"
This reverts r302483 and it's follow up fix. llvm-svn: 302493
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index c7eb9b80701..3aabdaeaa09 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -38,7 +38,6 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachinePassRegistry.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
@@ -1146,51 +1145,6 @@ static void createSwiftErrorEntriesInEntryBlock(FunctionLoweringInfo *FuncInfo,
}
}
-/// Collect llvm.dbg.declare information. This is done after argument lowering
-/// in case the declarations refer to arguments.
-static void processDbgDeclares(FunctionLoweringInfo *FuncInfo) {
- MachineFunction *MF = FuncInfo->MF;
- const DataLayout &DL = MF->getDataLayout();
- for (const BasicBlock &BB : *FuncInfo->Fn) {
- for (const Instruction &I : BB) {
- const DbgDeclareInst *DI = dyn_cast<DbgDeclareInst>(&I);
- if (!DI)
- continue;
-
- assert(DI->getVariable() && "Missing variable");
- assert(DI->getDebugLoc() && "Missing location");
- const Value *Address = DI->getAddress();
- if (!Address)
- continue;
-
- // Look through casts and constant offset GEPs. These mostly come from
- // inalloca.
- APInt Offset(DL.getPointerSizeInBits(0), 0);
- Address = Address->stripAndAccumulateInBoundsConstantOffsets(DL, Offset);
-
- // Check if the variable is a static alloca or a byval or inalloca
- // argument passed in memory. If it is not, then we will ignore this
- // intrinsic and handle this during isel like dbg.value.
- int FI = INT_MAX;
- if (const auto *AI = dyn_cast<AllocaInst>(Address)) {
- auto SI = FuncInfo->StaticAllocaMap.find(AI);
- if (SI != FuncInfo->StaticAllocaMap.end())
- FI = SI->second;
- } else if (const auto *Arg = dyn_cast<Argument>(Address))
- FI = FuncInfo->getArgumentFrameIndex(Arg);
-
- if (FI == INT_MAX)
- continue;
-
- DIExpression *Expr = DI->getExpression();
- if (Offset.getBoolValue())
- Expr = DIExpression::prepend(Expr, DIExpression::NoDeref,
- Offset.getZExtValue());
- MF->setVariableDbgInfo(DI->getVariable(), Expr, FI, DI->getDebugLoc());
- }
- }
-}
-
/// Propagate swifterror values through the machine function CFG.
static void propagateSwiftErrorVRegs(FunctionLoweringInfo *FuncInfo) {
auto *TLI = FuncInfo->TLI;
@@ -1363,8 +1317,6 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
}
createSwiftErrorEntriesInEntryBlock(FuncInfo, FastIS, TLI, TII, SDB);
- processDbgDeclares(FuncInfo);
-
// Iterate over all basic blocks in the function.
for (const BasicBlock *LLVMBB : RPOT) {
if (OptLevel != CodeGenOpt::None) {
OpenPOWER on IntegriCloud