summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorIgor Laevsky <igmyrj@gmail.com>2015-03-05 15:41:14 +0000
committerIgor Laevsky <igmyrj@gmail.com>2015-03-05 15:41:14 +0000
commit8d0851f509bfd63180ba2d96c9028cb54b30c595 (patch)
treebbfc0021b5f57cf810cd5bf67e5f86c1ca8b9ad6 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parentadfd96f742089dad11231fa7b7654f56140a3afb (diff)
downloadbcm5719-llvm-8d0851f509bfd63180ba2d96c9028cb54b30c595.tar.gz
bcm5719-llvm-8d0851f509bfd63180ba2d96c9028cb54b30c595.zip
Revert change r231366 as it broke clang-native-arm-cortex-a9 Analysis/properties.m test.
llvm-svn: 231374
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp39
1 files changed, 10 insertions, 29 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 61631f04df8..097b618252e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1016,24 +1016,6 @@ void SelectionDAGBuilder::resolveDanglingDebugInfo(const Value *V,
}
}
-/// getCopyFromRegs - If there was virtual register allocated for the value V
-/// emit CopyFromReg of the specified type Ty. Return empty SDValue() otherwise.
-SDValue SelectionDAGBuilder::getCopyFromRegs(const Value *V, Type *Ty) {
- DenseMap<const Value *, unsigned>::iterator It = FuncInfo.ValueMap.find(V);
- SDValue res;
-
- if (It != FuncInfo.ValueMap.end()) {
- unsigned InReg = It->second;
- RegsForValue RFV(*DAG.getContext(), DAG.getTargetLoweringInfo(), InReg,
- Ty);
- SDValue Chain = DAG.getEntryNode();
- res = RFV.getCopyFromRegs(DAG, FuncInfo, getCurSDLoc(), Chain, nullptr, V);
- resolveDanglingDebugInfo(V, res);
- }
-
- return res;
-}
-
/// getValue - Return an SDValue for the given Value.
SDValue SelectionDAGBuilder::getValue(const Value *V) {
// If we already have an SDValue for this value, use it. It's important
@@ -1044,9 +1026,15 @@ SDValue SelectionDAGBuilder::getValue(const Value *V) {
// If there's a virtual register allocated and initialized for this
// value, use it.
- SDValue copyFromReg = getCopyFromRegs(V, V->getType());
- if (copyFromReg.getNode()) {
- return copyFromReg;
+ DenseMap<const Value *, unsigned>::iterator It = FuncInfo.ValueMap.find(V);
+ if (It != FuncInfo.ValueMap.end()) {
+ unsigned InReg = It->second;
+ RegsForValue RFV(*DAG.getContext(), DAG.getTargetLoweringInfo(), InReg,
+ V->getType());
+ SDValue Chain = DAG.getEntryNode();
+ N = RFV.getCopyFromRegs(DAG, FuncInfo, getCurSDLoc(), Chain, nullptr, V);
+ resolveDanglingDebugInfo(V, N);
+ return N;
}
// Otherwise create a new SDValue and remember it.
@@ -2039,20 +2027,13 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
case Intrinsic::experimental_patchpoint_i64:
visitPatchpoint(&I, LandingPad);
break;
- case Intrinsic::experimental_gc_statepoint:
- LowerStatepoint(ImmutableStatepoint(&I), LandingPad);
- break;
}
} else
LowerCallTo(&I, getValue(Callee), false, LandingPad);
// If the value of the invoke is used outside of its defining block, make it
// available as a virtual register.
- // We already took care of the exported value for the statepoint instruction
- // during call to the LowerStatepoint.
- if (!isStatepoint(I)) {
- CopyToExportRegsIfNeeded(&I);
- }
+ CopyToExportRegsIfNeeded(&I);
// Update successor info
addSuccessorWithWeight(InvokeMBB, Return);
OpenPOWER on IntegriCloud