summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-07-24 19:01:39 +0000
committerPhilip Reames <listmail@philipreames.com>2015-07-24 19:01:39 +0000
commitfa2c630f798cd9df7b565f18cdf06821e294512e (patch)
tree7304f55778d1c01c0ecd5a67ecfdcebef0d63263 /llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
parent7fb865ea8ea8134d1b8429366bcee361df3e5448 (diff)
downloadbcm5719-llvm-fa2c630f798cd9df7b565f18cdf06821e294512e.tar.gz
bcm5719-llvm-fa2c630f798cd9df7b565f18cdf06821e294512e.zip
[RewriteStatepointsForGC] Adjust naming scheme to be more stable
The names for instructions inserted were previous dependent on iteration order. By deriving the names from the original instructions, we can avoid instability in tests without resorting to ordered traversals. It also makes the IR mildly easier to read at large scale. llvm-svn: 243140
Diffstat (limited to 'llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 5a1fac0c456..aa30cfb8ff9 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -858,13 +858,17 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache) {
BasicBlock *BB = I->getParent();
int NumPreds = std::distance(pred_begin(BB), pred_end(BB));
assert(NumPreds > 0 && "how did we reach here");
- return PHINode::Create(I->getType(), NumPreds, "base_phi", I);
+ std::string Name = I->hasName() ?
+ (I->getName() + ".base").str() : "base_phi";
+ return PHINode::Create(I->getType(), NumPreds, Name, I);
}
SelectInst *Sel = cast<SelectInst>(I);
// The undef will be replaced later
UndefValue *Undef = UndefValue::get(Sel->getType());
+ std::string Name = I->hasName() ?
+ (I->getName() + ".base").str() : "base_select";
return SelectInst::Create(Sel->getCondition(), Undef,
- Undef, "base_select", Sel);
+ Undef, Name, Sel);
};
Instruction *BaseInst = MakeBaseInstPlaceholder(I);
// Add metadata marking this as a base value
@@ -1283,7 +1287,7 @@ makeStatepointExplicitImpl(const CallSite &CS, /* to replace */
// original block.
InvokeInst *invoke = InvokeInst::Create(
gc_statepoint_decl, toReplace->getNormalDest(),
- toReplace->getUnwindDest(), args, "", toReplace->getParent());
+ toReplace->getUnwindDest(), args, "statepoint_token", toReplace->getParent());
invoke->setCallingConv(toReplace->getCallingConv());
// Currently we will fail on parameter attributes and on certain
OpenPOWER on IntegriCloud