summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-01-29 01:03:20 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-01-29 01:03:20 +0000
commitbcf27523f5e39b2fc768dee92732a91e27f86199 (patch)
tree427536b8ed202c27d2657f6b8d8bf97c2207c5fa
parent409929785606900e952a8ca281e2e7bb1f421b7b (diff)
downloadbcm5719-llvm-bcf27523f5e39b2fc768dee92732a91e27f86199.tar.gz
bcm5719-llvm-bcf27523f5e39b2fc768dee92732a91e27f86199.zip
[RS4GC] Minor cleanups enabled by the previous change; NFC
llvm-svn: 259133
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index e6245301c79..51b4e634ef2 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -1390,21 +1390,17 @@ makeStatepointExplicitImpl(const CallSite CS, /* to replace */
uint32_t NumPatchBytes = 0;
uint32_t Flags = uint32_t(StatepointFlags::None);
- ArrayRef<Use> CallArgs;
- ArrayRef<Use> DeoptArgs;
+ ArrayRef<Use> CallArgs(CS.arg_begin(), CS.arg_end());
+ ArrayRef<Use> DeoptArgs = GetDeoptBundleOperands(CS);
ArrayRef<Use> TransitionArgs;
-
- Value *CallTarget = nullptr;
-
- CallArgs = {CS.arg_begin(), CS.arg_end()};
- DeoptArgs = GetDeoptBundleOperands(CS);
if (auto TransitionBundle =
CS.getOperandBundle(LLVMContext::OB_gc_transition)) {
Flags |= uint32_t(StatepointFlags::GCTransition);
TransitionArgs = TransitionBundle->Inputs;
}
- AttributeSet OriginalAttrs = CS.getAttributes();
+ Value *CallTarget = CS.getCalledValue();
+ AttributeSet OriginalAttrs = CS.getAttributes();
Attribute AttrID = OriginalAttrs.getAttribute(AttributeSet::FunctionIndex,
"statepoint-id");
if (AttrID.isStringAttribute())
@@ -1415,9 +1411,6 @@ makeStatepointExplicitImpl(const CallSite CS, /* to replace */
if (AttrNumPatchBytes.isStringAttribute())
AttrNumPatchBytes.getValueAsString().getAsInteger(10, NumPatchBytes);
- CallTarget = CS.getCalledValue();
-
-
// Create the statepoint given all the arguments
Instruction *Token = nullptr;
AttributeSet ReturnAttrs;
@@ -2224,9 +2217,8 @@ static bool insertParsePoints(Function &F, DominatorTree &DT,
Uniqued.insert(ToUpdate.begin(), ToUpdate.end());
assert(Uniqued.size() == ToUpdate.size() && "no duplicates please!");
- for (CallSite CS : ToUpdate) {
- assert(CS.getInstruction()->getParent()->getParent() == &F);
- }
+ for (CallSite CS : ToUpdate)
+ assert(CS.getInstruction()->getFunction() == &F);
#endif
// When inserting gc.relocates for invokes, we need to be able to insert at
OpenPOWER on IntegriCloud