diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 11 | 
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index 54cbd6859f703..90a1b350fc942 100644 --- a/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -522,7 +522,16 @@ lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops,    // The vm state arguments are lowered in an opaque manner.  We do not know    // what type of values are contained within.    for (const Value *V : SI.DeoptState) { -    SDValue Incoming = Builder.getValue(V); +    SDValue Incoming; +    // If this is a function argument at a static frame index, generate it as +    // the frame index. +    if (const Argument *Arg = dyn_cast<Argument>(V)) { +      int FI = Builder.FuncInfo.getArgumentFrameIndex(Arg); +      if (FI != INT_MAX) +        Incoming = Builder.DAG.getFrameIndex(FI, Builder.getFrameIndexTy()); +    } +    if (!Incoming.getNode()) +      Incoming = Builder.getValue(V);      const bool LiveInValue = LiveInDeopt && !isGCValue(V);      lowerIncomingStatepointValue(Incoming, LiveInValue, Ops, Builder);    }  | 
