mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
[GC] Style cleanup for RewriteStatepointForGC (1 of many) [NFC]
Starting to update variable naming and types to match LLVM style. This will be an incremental process to minimize the chance of breakage as I work. Step one, rename member variables to LLVM CamelCase and use llvm's ADT. Much more to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
11947113de
commit
936cf6a3ae
@ -102,21 +102,18 @@ struct PartiallyConstructedSafepointRecord {
|
|||||||
std::set<llvm::Value *> liveset;
|
std::set<llvm::Value *> liveset;
|
||||||
|
|
||||||
/// Mapping from live pointers to a base-defining-value
|
/// Mapping from live pointers to a base-defining-value
|
||||||
std::map<llvm::Value *, llvm::Value *> base_pairs;
|
DenseMap<llvm::Value *, llvm::Value *> PointerToBase;
|
||||||
|
|
||||||
/// Any new values which were added to the IR during base pointer analysis
|
/// Any new values which were added to the IR during base pointer analysis
|
||||||
/// for this safepoint
|
/// for this safepoint
|
||||||
std::set<llvm::Value *> newInsertedDefs;
|
DenseSet<llvm::Value *> NewInsertedDefs;
|
||||||
|
|
||||||
/// The bounds of the inserted code for the safepoint
|
/// The bounds of the inserted code for the safepoint
|
||||||
std::pair<Instruction *, Instruction *> safepoint;
|
std::pair<Instruction *, Instruction *> SafepointBounds;
|
||||||
|
|
||||||
// Instruction to which exceptional gc relocates are attached
|
/// Instruction to which exceptional gc relocates are attached
|
||||||
// Makes it easier to iterate through them during relocationViaAlloca.
|
/// Makes it easier to iterate through them during relocationViaAlloca.
|
||||||
Instruction *exceptional_relocates_token;
|
Instruction *UnwindToken;
|
||||||
|
|
||||||
/// The result of the safepointing call (or nullptr)
|
|
||||||
Value *result;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +657,7 @@ private:
|
|||||||
/// which is the base pointer. (This is reliable and can be used for
|
/// which is the base pointer. (This is reliable and can be used for
|
||||||
/// relocation.) On failure, returns nullptr.
|
/// relocation.) On failure, returns nullptr.
|
||||||
static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
||||||
std::set<llvm::Value *> &newInsertedDefs) {
|
DenseSet<llvm::Value *> &NewInsertedDefs) {
|
||||||
Value *def = findBaseOrBDV(I, cache);
|
Value *def = findBaseOrBDV(I, cache);
|
||||||
|
|
||||||
if (isKnownBaseResult(def)) {
|
if (isKnownBaseResult(def)) {
|
||||||
@ -795,7 +792,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
|||||||
std::distance(pred_begin(v->getParent()), pred_end(v->getParent()));
|
std::distance(pred_begin(v->getParent()), pred_end(v->getParent()));
|
||||||
assert(num_preds > 0 && "how did we reach here");
|
assert(num_preds > 0 && "how did we reach here");
|
||||||
PHINode *phi = PHINode::Create(v->getType(), num_preds, "base_phi", v);
|
PHINode *phi = PHINode::Create(v->getType(), num_preds, "base_phi", v);
|
||||||
newInsertedDefs.insert(phi);
|
NewInsertedDefs.insert(phi);
|
||||||
// Add metadata marking this as a base value
|
// Add metadata marking this as a base value
|
||||||
auto *const_1 = ConstantInt::get(
|
auto *const_1 = ConstantInt::get(
|
||||||
Type::getInt32Ty(
|
Type::getInt32Ty(
|
||||||
@ -811,7 +808,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
|||||||
UndefValue *undef = UndefValue::get(sel->getType());
|
UndefValue *undef = UndefValue::get(sel->getType());
|
||||||
SelectInst *basesel = SelectInst::Create(sel->getCondition(), undef,
|
SelectInst *basesel = SelectInst::Create(sel->getCondition(), undef,
|
||||||
undef, "base_select", sel);
|
undef, "base_select", sel);
|
||||||
newInsertedDefs.insert(basesel);
|
NewInsertedDefs.insert(basesel);
|
||||||
// Add metadata marking this as a base value
|
// Add metadata marking this as a base value
|
||||||
auto *const_1 = ConstantInt::get(
|
auto *const_1 = ConstantInt::get(
|
||||||
Type::getInt32Ty(
|
Type::getInt32Ty(
|
||||||
@ -863,7 +860,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
|||||||
assert(states.count(base));
|
assert(states.count(base));
|
||||||
base = states[base].getBase();
|
base = states[base].getBase();
|
||||||
assert(base != nullptr && "unknown PhiState!");
|
assert(base != nullptr && "unknown PhiState!");
|
||||||
assert(newInsertedDefs.count(base) &&
|
assert(NewInsertedDefs.count(base) &&
|
||||||
"should have already added this in a prev. iteration!");
|
"should have already added this in a prev. iteration!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,7 +892,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
|||||||
if (base->getType() != basephi->getType()) {
|
if (base->getType() != basephi->getType()) {
|
||||||
base = new BitCastInst(base, basephi->getType(), "cast",
|
base = new BitCastInst(base, basephi->getType(), "cast",
|
||||||
InBB->getTerminator());
|
InBB->getTerminator());
|
||||||
newInsertedDefs.insert(base);
|
NewInsertedDefs.insert(base);
|
||||||
}
|
}
|
||||||
basephi->addIncoming(base, InBB);
|
basephi->addIncoming(base, InBB);
|
||||||
}
|
}
|
||||||
@ -920,7 +917,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
|||||||
// The cast is needed since base traversal may strip away bitcasts
|
// The cast is needed since base traversal may strip away bitcasts
|
||||||
if (base->getType() != basesel->getType()) {
|
if (base->getType() != basesel->getType()) {
|
||||||
base = new BitCastInst(base, basesel->getType(), "cast", basesel);
|
base = new BitCastInst(base, basesel->getType(), "cast", basesel);
|
||||||
newInsertedDefs.insert(base);
|
NewInsertedDefs.insert(base);
|
||||||
}
|
}
|
||||||
basesel->setOperand(i, base);
|
basesel->setOperand(i, base);
|
||||||
}
|
}
|
||||||
@ -975,17 +972,17 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
|
|||||||
// side effects: may insert PHI nodes into the existing CFG, will preserve
|
// side effects: may insert PHI nodes into the existing CFG, will preserve
|
||||||
// CFG, will not remove or mutate any existing nodes
|
// CFG, will not remove or mutate any existing nodes
|
||||||
//
|
//
|
||||||
// post condition: base_pairs contains one (derived, base) pair for every
|
// post condition: PointerToBase contains one (derived, base) pair for every
|
||||||
// pointer in live. Note that derived can be equal to base if the original
|
// pointer in live. Note that derived can be equal to base if the original
|
||||||
// pointer was a base pointer.
|
// pointer was a base pointer.
|
||||||
static void findBasePointers(const std::set<llvm::Value *> &live,
|
static void findBasePointers(const std::set<llvm::Value *> &live,
|
||||||
std::map<llvm::Value *, llvm::Value *> &base_pairs,
|
DenseMap<llvm::Value *, llvm::Value *> &PointerToBase,
|
||||||
DominatorTree *DT, DefiningValueMapTy &DVCache,
|
DominatorTree *DT, DefiningValueMapTy &DVCache,
|
||||||
std::set<llvm::Value *> &newInsertedDefs) {
|
DenseSet<llvm::Value *> &NewInsertedDefs) {
|
||||||
for (Value *ptr : live) {
|
for (Value *ptr : live) {
|
||||||
Value *base = findBasePointer(ptr, DVCache, newInsertedDefs);
|
Value *base = findBasePointer(ptr, DVCache, NewInsertedDefs);
|
||||||
assert(base && "failed to find base pointer");
|
assert(base && "failed to find base pointer");
|
||||||
base_pairs[ptr] = base;
|
PointerToBase[ptr] = base;
|
||||||
assert((!isa<Instruction>(base) || !isa<Instruction>(ptr) ||
|
assert((!isa<Instruction>(base) || !isa<Instruction>(ptr) ||
|
||||||
DT->dominates(cast<Instruction>(base)->getParent(),
|
DT->dominates(cast<Instruction>(base)->getParent(),
|
||||||
cast<Instruction>(ptr)->getParent())) &&
|
cast<Instruction>(ptr)->getParent())) &&
|
||||||
@ -1006,20 +1003,20 @@ static void findBasePointers(const std::set<llvm::Value *> &live,
|
|||||||
static void findBasePointers(DominatorTree &DT, DefiningValueMapTy &DVCache,
|
static void findBasePointers(DominatorTree &DT, DefiningValueMapTy &DVCache,
|
||||||
const CallSite &CS,
|
const CallSite &CS,
|
||||||
PartiallyConstructedSafepointRecord &result) {
|
PartiallyConstructedSafepointRecord &result) {
|
||||||
std::map<llvm::Value *, llvm::Value *> base_pairs;
|
DenseMap<llvm::Value *, llvm::Value *> PointerToBase;
|
||||||
std::set<llvm::Value *> newInsertedDefs;
|
DenseSet<llvm::Value *> NewInsertedDefs;
|
||||||
findBasePointers(result.liveset, base_pairs, &DT, DVCache, newInsertedDefs);
|
findBasePointers(result.liveset, PointerToBase, &DT, DVCache, NewInsertedDefs);
|
||||||
|
|
||||||
if (PrintBasePointers) {
|
if (PrintBasePointers) {
|
||||||
errs() << "Base Pairs (w/o Relocation):\n";
|
errs() << "Base Pairs (w/o Relocation):\n";
|
||||||
for (auto Pair : base_pairs) {
|
for (auto Pair : PointerToBase) {
|
||||||
errs() << " derived %" << Pair.first->getName() << " base %"
|
errs() << " derived %" << Pair.first->getName() << " base %"
|
||||||
<< Pair.second->getName() << "\n";
|
<< Pair.second->getName() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result.base_pairs = base_pairs;
|
result.PointerToBase = PointerToBase;
|
||||||
result.newInsertedDefs = newInsertedDefs;
|
result.NewInsertedDefs = NewInsertedDefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check for liveness of items in the insert defs and add them to the live
|
/// Check for liveness of items in the insert defs and add them to the live
|
||||||
@ -1029,8 +1026,8 @@ static void fixupLiveness(DominatorTree &DT, const CallSite &CS,
|
|||||||
PartiallyConstructedSafepointRecord &result) {
|
PartiallyConstructedSafepointRecord &result) {
|
||||||
Instruction *inst = CS.getInstruction();
|
Instruction *inst = CS.getInstruction();
|
||||||
|
|
||||||
std::set<llvm::Value *> liveset = result.liveset;
|
auto liveset = result.liveset;
|
||||||
std::map<llvm::Value *, llvm::Value *> base_pairs = result.base_pairs;
|
auto PointerToBase = result.PointerToBase;
|
||||||
|
|
||||||
auto is_live_gc_reference =
|
auto is_live_gc_reference =
|
||||||
[&](Value &V) { return isLiveGCReferenceAt(V, inst, DT, nullptr); };
|
[&](Value &V) { return isLiveGCReferenceAt(V, inst, DT, nullptr); };
|
||||||
@ -1054,14 +1051,14 @@ static void fixupLiveness(DominatorTree &DT, const CallSite &CS,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_live_gc_reference(*newDef)) {
|
if (is_live_gc_reference(*newDef)) {
|
||||||
// Add the live new defs into liveset and base_pairs
|
// Add the live new defs into liveset and PointerToBase
|
||||||
liveset.insert(newDef);
|
liveset.insert(newDef);
|
||||||
base_pairs[newDef] = newDef;
|
PointerToBase[newDef] = newDef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result.liveset = liveset;
|
result.liveset = liveset;
|
||||||
result.base_pairs = base_pairs;
|
result.PointerToBase = PointerToBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fixupLiveReferences(
|
static void fixupLiveReferences(
|
||||||
@ -1317,7 +1314,7 @@ makeStatepointExplicitImpl(const CallSite &CS, /* to replace */
|
|||||||
Instruction *exceptional_token =
|
Instruction *exceptional_token =
|
||||||
cast<Instruction>(Builder.CreateExtractValue(
|
cast<Instruction>(Builder.CreateExtractValue(
|
||||||
unwindBlock->getLandingPadInst(), idx, "relocate_token"));
|
unwindBlock->getLandingPadInst(), idx, "relocate_token"));
|
||||||
result.exceptional_relocates_token = exceptional_token;
|
result.UnwindToken = exceptional_token;
|
||||||
|
|
||||||
// Just throw away return value. We will use the one we got for normal
|
// Just throw away return value. We will use the one we got for normal
|
||||||
// block.
|
// block.
|
||||||
@ -1380,7 +1377,7 @@ makeStatepointExplicitImpl(const CallSite &CS, /* to replace */
|
|||||||
// Sanity check our results - this is slightly non-trivial due to invokes
|
// Sanity check our results - this is slightly non-trivial due to invokes
|
||||||
VerifySafepointBounds(bounds);
|
VerifySafepointBounds(bounds);
|
||||||
|
|
||||||
result.safepoint = bounds;
|
result.SafepointBounds = bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -1418,8 +1415,8 @@ static void stablize_order(SmallVectorImpl<Value *> &basevec,
|
|||||||
static void
|
static void
|
||||||
makeStatepointExplicit(DominatorTree &DT, const CallSite &CS, Pass *P,
|
makeStatepointExplicit(DominatorTree &DT, const CallSite &CS, Pass *P,
|
||||||
PartiallyConstructedSafepointRecord &result) {
|
PartiallyConstructedSafepointRecord &result) {
|
||||||
std::set<llvm::Value *> liveset = result.liveset;
|
auto liveset = result.liveset;
|
||||||
std::map<llvm::Value *, llvm::Value *> base_pairs = result.base_pairs;
|
auto PointerToBase = result.PointerToBase;
|
||||||
|
|
||||||
// Convert to vector for efficient cross referencing.
|
// Convert to vector for efficient cross referencing.
|
||||||
SmallVector<Value *, 64> basevec, livevec;
|
SmallVector<Value *, 64> basevec, livevec;
|
||||||
@ -1428,8 +1425,8 @@ makeStatepointExplicit(DominatorTree &DT, const CallSite &CS, Pass *P,
|
|||||||
for (Value *L : liveset) {
|
for (Value *L : liveset) {
|
||||||
livevec.push_back(L);
|
livevec.push_back(L);
|
||||||
|
|
||||||
assert(base_pairs.find(L) != base_pairs.end());
|
assert(PointerToBase.find(L) != PointerToBase.end());
|
||||||
Value *base = base_pairs[L];
|
Value *base = PointerToBase[L];
|
||||||
basevec.push_back(base);
|
basevec.push_back(base);
|
||||||
}
|
}
|
||||||
assert(livevec.size() == basevec.size());
|
assert(livevec.size() == basevec.size());
|
||||||
@ -1523,7 +1520,7 @@ static void relocationViaAlloca(
|
|||||||
// otherwise we lose the link between statepoint and old def
|
// otherwise we lose the link between statepoint and old def
|
||||||
for (size_t i = 0; i < records.size(); i++) {
|
for (size_t i = 0; i < records.size(); i++) {
|
||||||
const struct PartiallyConstructedSafepointRecord &info = records[i];
|
const struct PartiallyConstructedSafepointRecord &info = records[i];
|
||||||
Value *statepoint = info.safepoint.first;
|
Value *statepoint = info.SafepointBounds.first;
|
||||||
|
|
||||||
// This will be used for consistency check
|
// This will be used for consistency check
|
||||||
DenseSet<Value *> visitedLiveValues;
|
DenseSet<Value *> visitedLiveValues;
|
||||||
@ -1534,14 +1531,14 @@ static void relocationViaAlloca(
|
|||||||
// In case if it was invoke statepoint
|
// In case if it was invoke statepoint
|
||||||
// we will insert stores for exceptional path gc relocates.
|
// we will insert stores for exceptional path gc relocates.
|
||||||
if (isa<InvokeInst>(statepoint)) {
|
if (isa<InvokeInst>(statepoint)) {
|
||||||
insertRelocationStores(info.exceptional_relocates_token->users(),
|
insertRelocationStores(info.UnwindToken->users(),
|
||||||
allocaMap, visitedLiveValues);
|
allocaMap, visitedLiveValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// For consistency check store null's into allocas for values that are not
|
// As a debuging aid, pretend that an unrelocated pointer becomes null at
|
||||||
// relocated
|
// the gc.statepoint. This will turn some subtle GC problems into slightly
|
||||||
// by this statepoint.
|
// easy to debug SEGVs
|
||||||
for (auto Pair : allocaMap) {
|
for (auto Pair : allocaMap) {
|
||||||
Value *def = Pair.first;
|
Value *def = Pair.first;
|
||||||
Value *alloca = Pair.second;
|
Value *alloca = Pair.second;
|
||||||
@ -1550,15 +1547,11 @@ static void relocationViaAlloca(
|
|||||||
if (visitedLiveValues.count(def)) {
|
if (visitedLiveValues.count(def)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Result should not be relocated
|
|
||||||
if (def == info.result) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Constant *CPN =
|
auto PT = cast<PointerType>(def->getType());
|
||||||
ConstantPointerNull::get(cast<PointerType>(def->getType()));
|
Constant *CPN = ConstantPointerNull::get(PT);
|
||||||
StoreInst *store = new StoreInst(CPN, alloca);
|
StoreInst *store = new StoreInst(CPN, alloca);
|
||||||
store->insertBefore(info.safepoint.second);
|
store->insertBefore(info.SafepointBounds.second);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1695,17 +1688,17 @@ static void findLiveReferences(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void addBasesAsLiveValues(std::set<Value *> &liveset,
|
static void addBasesAsLiveValues(std::set<Value *> &liveset,
|
||||||
std::map<Value *, Value *> &base_pairs) {
|
DenseMap<Value *, Value *> &PointerToBase) {
|
||||||
// Identify any base pointers which are used in this safepoint, but not
|
// Identify any base pointers which are used in this safepoint, but not
|
||||||
// themselves relocated. We need to relocate them so that later inserted
|
// themselves relocated. We need to relocate them so that later inserted
|
||||||
// safepoints can get the properly relocated base register.
|
// safepoints can get the properly relocated base register.
|
||||||
DenseSet<Value *> missing;
|
DenseSet<Value *> missing;
|
||||||
for (Value *L : liveset) {
|
for (Value *L : liveset) {
|
||||||
assert(base_pairs.find(L) != base_pairs.end());
|
assert(PointerToBase.find(L) != PointerToBase.end());
|
||||||
Value *base = base_pairs[L];
|
Value *base = PointerToBase[L];
|
||||||
assert(base);
|
assert(base);
|
||||||
if (liveset.find(base) == liveset.end()) {
|
if (liveset.find(base) == liveset.end()) {
|
||||||
assert(base_pairs.find(base) == base_pairs.end());
|
assert(PointerToBase.find(base) == PointerToBase.end());
|
||||||
// uniqued by set insert
|
// uniqued by set insert
|
||||||
missing.insert(base);
|
missing.insert(base);
|
||||||
}
|
}
|
||||||
@ -1718,9 +1711,9 @@ static void addBasesAsLiveValues(std::set<Value *> &liveset,
|
|||||||
for (Value *base : missing) {
|
for (Value *base : missing) {
|
||||||
assert(base);
|
assert(base);
|
||||||
liveset.insert(base);
|
liveset.insert(base);
|
||||||
base_pairs[base] = base;
|
PointerToBase[base] = base;
|
||||||
}
|
}
|
||||||
assert(liveset.size() == base_pairs.size());
|
assert(liveset.size() == PointerToBase.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
||||||
@ -1797,8 +1790,8 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
|||||||
std::set<llvm::Value *> allInsertedDefs;
|
std::set<llvm::Value *> allInsertedDefs;
|
||||||
for (size_t i = 0; i < records.size(); i++) {
|
for (size_t i = 0; i < records.size(); i++) {
|
||||||
struct PartiallyConstructedSafepointRecord &info = records[i];
|
struct PartiallyConstructedSafepointRecord &info = records[i];
|
||||||
allInsertedDefs.insert(info.newInsertedDefs.begin(),
|
allInsertedDefs.insert(info.NewInsertedDefs.begin(),
|
||||||
info.newInsertedDefs.end());
|
info.NewInsertedDefs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
// We insert some dummy calls after each safepoint to definitely hold live
|
// We insert some dummy calls after each safepoint to definitely hold live
|
||||||
@ -1811,7 +1804,7 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
|||||||
CallSite &CS = toUpdate[i];
|
CallSite &CS = toUpdate[i];
|
||||||
|
|
||||||
SmallVector<Value *, 128> Bases;
|
SmallVector<Value *, 128> Bases;
|
||||||
for (auto Pair : info.base_pairs) {
|
for (auto Pair : info.PointerToBase) {
|
||||||
Bases.push_back(Pair.second);
|
Bases.push_back(Pair.second);
|
||||||
}
|
}
|
||||||
insertUseHolderAfter(CS, Bases, holders);
|
insertUseHolderAfter(CS, Bases, holders);
|
||||||
@ -1825,7 +1818,7 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
|||||||
// given statepoint.
|
// given statepoint.
|
||||||
for (size_t i = 0; i < records.size(); i++) {
|
for (size_t i = 0; i < records.size(); i++) {
|
||||||
struct PartiallyConstructedSafepointRecord &info = records[i];
|
struct PartiallyConstructedSafepointRecord &info = records[i];
|
||||||
addBasesAsLiveValues(info.liveset, info.base_pairs);
|
addBasesAsLiveValues(info.liveset, info.PointerToBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we inserted any new values, we need to adjust our notion of what is
|
// If we inserted any new values, we need to adjust our notion of what is
|
||||||
@ -1837,7 +1830,7 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
|||||||
for (size_t i = 0; i < records.size(); i++) {
|
for (size_t i = 0; i < records.size(); i++) {
|
||||||
struct PartiallyConstructedSafepointRecord &info = records[i];
|
struct PartiallyConstructedSafepointRecord &info = records[i];
|
||||||
errs() << "Base Pairs: (w/Relocation)\n";
|
errs() << "Base Pairs: (w/Relocation)\n";
|
||||||
for (auto Pair : info.base_pairs) {
|
for (auto Pair : info.PointerToBase) {
|
||||||
errs() << " derived %" << Pair.first->getName() << " base %"
|
errs() << " derived %" << Pair.first->getName() << " base %"
|
||||||
<< Pair.second->getName() << "\n";
|
<< Pair.second->getName() << "\n";
|
||||||
}
|
}
|
||||||
@ -1870,7 +1863,7 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
|||||||
// nodes have single entry (because of normalizeBBForInvokeSafepoint).
|
// nodes have single entry (because of normalizeBBForInvokeSafepoint).
|
||||||
// Just remove them all here.
|
// Just remove them all here.
|
||||||
for (size_t i = 0; i < records.size(); i++) {
|
for (size_t i = 0; i < records.size(); i++) {
|
||||||
Instruction *I = records[i].safepoint.first;
|
Instruction *I = records[i].SafepointBounds.first;
|
||||||
|
|
||||||
if (InvokeInst *invoke = dyn_cast<InvokeInst>(I)) {
|
if (InvokeInst *invoke = dyn_cast<InvokeInst>(I)) {
|
||||||
FoldSingleEntryPHINodes(invoke->getNormalDest());
|
FoldSingleEntryPHINodes(invoke->getNormalDest());
|
||||||
@ -1890,7 +1883,7 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
|
|||||||
// That Value* no longer exists and we need to use the new gc_result.
|
// That Value* no longer exists and we need to use the new gc_result.
|
||||||
// Thankfully, the liveset is embedded in the statepoint (and updated), so
|
// Thankfully, the liveset is embedded in the statepoint (and updated), so
|
||||||
// we just grab that.
|
// we just grab that.
|
||||||
Statepoint statepoint(info.safepoint.first);
|
Statepoint statepoint(info.SafepointBounds.first);
|
||||||
live.insert(live.end(), statepoint.gc_args_begin(),
|
live.insert(live.end(), statepoint.gc_args_begin(),
|
||||||
statepoint.gc_args_end());
|
statepoint.gc_args_end());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user