diff options
author | Eric Christopher <echristo@gmail.com> | 2012-10-03 08:10:01 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2012-10-03 08:10:01 +0000 |
commit | 76ad43c6e1619ed4c087b8ccb2cd573eb9d7093e (patch) | |
tree | 4afc339690b9fd201d020cca8a297fa2d71e768a /lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 8e8f8724e17182b8faddd6b009e7f037e0b908e7 (diff) |
Revert 165051-165049 while looking into the foreach.m failure in
more detail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 818940490f..683fac6744 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -149,13 +149,13 @@ unsigned FastISel::getRegForValue(const Value *V) { !FuncInfo.StaticAllocaMap.count(cast<AllocaInst>(V)))) return FuncInfo.InitializeRegForValue(V); - MachineBasicBlock::iterator SaveIter = enterLocalValueArea(); + SavePoint SaveInsertPt = enterLocalValueArea(); // Materialize the value in a register. Emit any instructions in the // local value area. Reg = materializeRegForValue(V, VT); - leaveLocalValueArea(SaveIter); + leaveLocalValueArea(SaveInsertPt); return Reg; } @@ -238,16 +238,7 @@ unsigned FastISel::lookUpRegForValue(const Value *V) { DenseMap<const Value *, unsigned>::iterator I = FuncInfo.ValueMap.find(V); if (I != FuncInfo.ValueMap.end()) return I->second; - unsigned Reg = LocalValueMap[V]; - - // If we managed to find a register here then go ahead and replace the - // current location with the location we're currently emitted for, - // 'moving' the value to a place that's closer to where it originally - // started. - if (Reg) - MRI.getVRegDef(Reg)->setDebugLoc(DL); - - return Reg; + return LocalValueMap[V]; } /// UpdateValueMap - Update the value map to include the new mapping for this @@ -325,18 +316,22 @@ void FastISel::removeDeadCode(MachineBasicBlock::iterator I, recomputeInsertPt(); } -MachineBasicBlock::iterator FastISel::enterLocalValueArea() { +FastISel::SavePoint FastISel::enterLocalValueArea() { MachineBasicBlock::iterator OldInsertPt = FuncInfo.InsertPt; + DebugLoc OldDL = DL; recomputeInsertPt(); - return OldInsertPt; + DL = DebugLoc(); + SavePoint SP = { OldInsertPt, OldDL }; + return SP; } -void FastISel::leaveLocalValueArea(MachineBasicBlock::iterator I) { +void FastISel::leaveLocalValueArea(SavePoint OldInsertPt) { if (FuncInfo.InsertPt != FuncInfo.MBB->begin()) LastLocalValue = llvm::prior(FuncInfo.InsertPt); // Restore the previous insert position. - FuncInfo.InsertPt = I; + FuncInfo.InsertPt = OldInsertPt.InsertPt; + DL = OldInsertPt.DL; } /// SelectBinaryOp - Select and emit code for a binary operator instruction, |