From 0307be3cc16ffb07a0e195673bd0c4dada59a07c Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Tue, 12 Feb 2019 06:25:58 +0000 Subject: [PATCH] [Statepoint Lowering] Update misleading comments about chains git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353800 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index a1555376d00..6c72a9c225a 100644 --- a/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -366,10 +366,6 @@ spillIncomingStatepointValue(SDValue Incoming, SDValue Chain, // We use TargetFrameIndex so that isel will not select it into LEA Loc = Builder.DAG.getTargetFrameIndex(Index, Builder.getFrameIndexTy()); - // TODO: We can create TokenFactor node instead of - // chaining stores one after another, this may allow - // a bit more optimal scheduling for them - #ifndef NDEBUG // Right now we always allocate spill slots that are of the same // size as the value we're about to spill (the size of spillee can @@ -398,6 +394,9 @@ spillIncomingStatepointValue(SDValue Incoming, SDValue Chain, static void lowerIncomingStatepointValue(SDValue Incoming, bool LiveInOnly, SmallVectorImpl &Ops, SelectionDAGBuilder &Builder) { + // Note: We know all of these spills are independent, but don't bother to + // exploit that chain wise. DAGCombine will happily do so as needed, so + // doing it here would be a small compile time win at most. SDValue Chain = Builder.getRoot(); if (ConstantSDNode *C = dyn_cast(Incoming)) { @@ -984,11 +983,11 @@ void SelectionDAGBuilder::visitGCRelocate(const GCRelocateInst &Relocate) { } SDValue SpillSlot = - DAG.getTargetFrameIndex(*DerivedPtrLocation, getFrameIndexTy()); + DAG.getTargetFrameIndex(*DerivedPtrLocation, getFrameIndexTy()); - // Be conservative: flush all pending loads - // TODO: Probably we can be less restrictive on this, - // it may allow more scheduling opportunities. + // Note: We know all of these reloads are independent, but don't bother to + // exploit that chain wise. DAGCombine will happily do so as needed, so + // doing it here would be a small compile time win at most. SDValue Chain = getRoot(); SDValue SpillLoad = @@ -998,7 +997,6 @@ void SelectionDAGBuilder::visitGCRelocate(const GCRelocateInst &Relocate) { MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), *DerivedPtrLocation)); - // Again, be conservative, don't emit pending loads DAG.setRoot(SpillLoad.getValue(1)); assert(SpillLoad.getNode()); -- 2.40.0