Skip to content

Commit 824cffe

Browse files
committed
[GC] Rename gc_args to gc_live [nfc]
Better reflect the recent history of the code, and improve readability for when I have to glance back at this to answer a question.
1 parent 70ffcfe commit 824cffe

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

llvm/include/llvm/IR/Statepoint.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,23 @@ class GCStatepointInst : public CallBase {
176176
}
177177

178178
/// Returns an iterator to the begining of the argument range describing gc
179-
/// values for the statepoint.
180-
const_op_iterator gc_args_begin() const {
179+
/// live values for the statepoint.
180+
const_op_iterator gc_live_begin() const {
181181
if (auto Opt = getOperandBundle(LLVMContext::OB_gc_live))
182182
return Opt->Inputs.begin();
183183
return arg_end();
184184
}
185185

186-
/// Return an end iterator for the gc argument range
187-
const_op_iterator gc_args_end() const {
186+
/// Return an end iterator for the gc live range
187+
const_op_iterator gc_live_end() const {
188188
if (auto Opt = getOperandBundle(LLVMContext::OB_gc_live))
189189
return Opt->Inputs.end();
190190
return arg_end();
191191
}
192192

193-
/// range adapter for gc arguments
194-
iterator_range<const_op_iterator> gc_args() const {
195-
return make_range(gc_args_begin(), gc_args_end());
193+
/// range adapter for gc live arguments
194+
iterator_range<const_op_iterator> gc_live() const {
195+
return make_range(gc_live_begin(), gc_live_end());
196196
}
197197

198198

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ class SelectionDAGBuilder {
439439
/// The set of gc.relocate calls associated with this gc.statepoint.
440440
SmallVector<const GCRelocateInst *, 16> GCRelocates;
441441

442-
/// The full list of gc arguments to the gc.statepoint being lowered.
443-
ArrayRef<const Use> GCArgs;
442+
/// The full list of gc-live arguments to the gc.statepoint being lowered.
443+
ArrayRef<const Use> GCLives;
444444

445445
/// The gc.statepoint instruction.
446446
const Instruction *StatepointInstr = nullptr;

llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops,
673673
// it is the contents of the slot which may get updated, not the pointer to
674674
// the alloca
675675
SmallVector<SDValue, 4> Allocas;
676-
for (Value *V : SI.GCArgs) {
676+
for (Value *V : SI.GCLives) {
677677
SDValue Incoming = Builder.getValue(V);
678678
if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(Incoming)) {
679679
// This handles allocas as arguments to the statepoint
@@ -1086,7 +1086,7 @@ SelectionDAGBuilder::LowerStatepoint(const GCStatepointInst &I,
10861086
}
10871087
}
10881088

1089-
SI.GCArgs = ArrayRef<const Use>(I.gc_args_begin(), I.gc_args_end());
1089+
SI.GCLives = ArrayRef<const Use>(I.gc_live_begin(), I.gc_live_end());
10901090
SI.StatepointInstr = &I;
10911091
SI.ID = I.getID();
10921092

llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ makeStatepointExplicitImpl(CallBase *Call, /* to replace */
16541654
// be replacing a terminator.
16551655
IRBuilder<> Builder(Call);
16561656

1657-
ArrayRef<Value *> GCArgs(LiveVariables);
1657+
ArrayRef<Value *> GCLive(LiveVariables);
16581658
uint64_t StatepointID = StatepointDirectives::DefaultStatepointID;
16591659
uint32_t NumPatchBytes = 0;
16601660
uint32_t Flags = uint32_t(StatepointFlags::None);
@@ -1827,7 +1827,7 @@ makeStatepointExplicitImpl(CallBase *Call, /* to replace */
18271827
if (auto *CI = dyn_cast<CallInst>(Call)) {
18281828
CallInst *SPCall = Builder.CreateGCStatepointCall(
18291829
StatepointID, NumPatchBytes, CallTarget, Flags, CallArgs,
1830-
TransitionArgs, DeoptArgs, GCArgs, "safepoint_token");
1830+
TransitionArgs, DeoptArgs, GCLive, "safepoint_token");
18311831

18321832
SPCall->setTailCallKind(CI->getTailCallKind());
18331833
SPCall->setCallingConv(CI->getCallingConv());
@@ -1852,8 +1852,8 @@ makeStatepointExplicitImpl(CallBase *Call, /* to replace */
18521852
// original block.
18531853
InvokeInst *SPInvoke = Builder.CreateGCStatepointInvoke(
18541854
StatepointID, NumPatchBytes, CallTarget, II->getNormalDest(),
1855-
II->getUnwindDest(), Flags, CallArgs, TransitionArgs, DeoptArgs, GCArgs,
1856-
"statepoint_token");
1855+
II->getUnwindDest(), Flags, CallArgs, TransitionArgs, DeoptArgs,
1856+
GCLive, "statepoint_token");
18571857

18581858
SPInvoke->setCallingConv(II->getCallingConv());
18591859

@@ -2839,15 +2839,15 @@ static bool insertParsePoints(Function &F, DominatorTree &DT,
28392839
// That Value* no longer exists and we need to use the new gc_result.
28402840
// Thankfully, the live set is embedded in the statepoint (and updated), so
28412841
// we just grab that.
2842-
llvm::append_range(Live, Info.StatepointToken->gc_args());
2842+
llvm::append_range(Live, Info.StatepointToken->gc_live());
28432843
#ifndef NDEBUG
28442844
// Do some basic validation checking on our liveness results before
28452845
// performing relocation. Relocation can and will turn mistakes in liveness
28462846
// results into non-sensical code which is must harder to debug.
28472847
// TODO: It would be nice to test consistency as well
28482848
assert(DT.isReachableFromEntry(Info.StatepointToken->getParent()) &&
28492849
"statepoint must be reachable or liveness is meaningless");
2850-
for (Value *V : Info.StatepointToken->gc_args()) {
2850+
for (Value *V : Info.StatepointToken->gc_live()) {
28512851
if (!isa<Instruction>(V))
28522852
// Non-instruction values trivial dominate all possible uses
28532853
continue;

0 commit comments

Comments
 (0)