diff options
author | Philip Reames <listmail@philipreames.com> | 2016-04-12 18:05:10 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-04-12 18:05:10 +0000 |
commit | 92d1f0cb6d4f66a285e3e85bfc2d55fb96b16ae9 (patch) | |
tree | d39c5157d9a7c5adc3b1f8cb5418a59dc3ce8647 /llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | |
parent | e6a0a23e0883a2252035ad238891992ae90140c2 (diff) | |
download | llvm-92d1f0cb6d4f66a285e3e85bfc2d55fb96b16ae9.zip llvm-92d1f0cb6d4f66a285e3e85bfc2d55fb96b16ae9.tar.gz llvm-92d1f0cb6d4f66a285e3e85bfc2d55fb96b16ae9.tar.bz2 |
Introduce an GCRelocateInst class [NFC]
Previously, we were using isGCRelocate predicates. Using a subclass of IntrinsicInst is far more idiomatic. The refactoring also enables a couple of minor simplifications and code sharing.
llvm-svn: 266098
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index f489e3b..9b74551 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -788,7 +788,7 @@ SelectionDAGBuilder::LowerStatepoint(ImmutableStatepoint ISP, SDValue ReturnValue = LowerAsSTATEPOINT(SI); // Export the result value if needed - const Instruction *GCResult = ISP.getGCResult(); + const GCResultInst *GCResult = ISP.getGCResult(); Type *RetTy = ISP.getActualReturnType(); if (!RetTy->isVoidTy() && GCResult) { if (GCResult->getParent() != ISP.getCallSite().getParent()) { @@ -862,17 +862,16 @@ void SelectionDAGBuilder::LowerCallSiteWithDeoptBundle( /* ForceVoidReturnTy = */ false); } -void SelectionDAGBuilder::visitGCResult(const CallInst &CI) { +void SelectionDAGBuilder::visitGCResult(const GCResultInst &CI) { // The result value of the gc_result is simply the result of the actual // call. We've already emitted this, so just grab the value. - Instruction *I = cast<Instruction>(CI.getArgOperand(0)); - assert(isStatepoint(I) && "first argument must be a statepoint token"); + const Instruction *I = CI.getStatepoint(); if (I->getParent() != CI.getParent()) { // Statepoint is in different basic block so we should have stored call // result in a virtual register. // We can not use default getValue() functionality to copy value from this - // register because statepoint and actuall call return types can be + // register because statepoint and actual call return types can be // different, and getValue() will use CopyFromReg of the wrong type, // which is always i32 in our case. PointerType *CalleeType = cast<PointerType>( |