diff options
author | Chen Li <meloli87@gmail.com> | 2015-12-26 07:54:32 +0000 |
---|---|---|
committer | Chen Li <meloli87@gmail.com> | 2015-12-26 07:54:32 +0000 |
commit | d71999ef1bb69b5095f2c3fd227b2a18c34e272b (patch) | |
tree | b103d9657368033b274fdcb3e71f0b23e02f0452 /llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | |
parent | 84417f83ccc2841aaa2be537edca26e6da05f4bb (diff) | |
download | bcm5719-llvm-d71999ef1bb69b5095f2c3fd227b2a18c34e272b.tar.gz bcm5719-llvm-d71999ef1bb69b5095f2c3fd227b2a18c34e272b.zip |
[gc.statepoint] Change gc.statepoint intrinsic's return type to token type instead of i32 type
Summary: This patch changes gc.statepoint intrinsic's return type to token type instead of i32 type. Using token types could prevent LLVM to merge different gc.statepoint nodes into PHI nodes and cause further problems with gc relocations. The patch also changes the way on how gc.relocate and gc.result look for their corresponding gc.statepoint on unwind path. The current implementation uses the selector value extracted from a { i8*, i32 } landingpad as a hook to find the gc.statepoint, while the patch directly uses a token type landingpad (http://reviews.llvm.org/D15405) to find the gc.statepoint.
Reviewers: sanjoy, JosephTremoulet, pgavlin, igor-laevsky, mjacob
Subscribers: reames, mjacob, sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D15662
llvm-svn: 256443
Diffstat (limited to 'llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 0a61d4b5da0..a077ba01a92 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1505,11 +1505,8 @@ makeStatepointExplicitImpl(const CallSite CS, /* to replace */ Builder.SetInsertPoint(&*UnwindBlock->getFirstInsertionPt()); Builder.SetCurrentDebugLocation(ToReplace->getDebugLoc()); - // Extract second element from landingpad return value. We will attach - // exceptional gc relocates to it. - Instruction *ExceptionalToken = - cast<Instruction>(Builder.CreateExtractValue( - UnwindBlock->getLandingPadInst(), 1, "relocate_token")); + // Attach exceptional gc relocates to the landingpad. + Instruction *ExceptionalToken = UnwindBlock->getLandingPadInst(); Result.UnwindToken = ExceptionalToken; const unsigned LiveStartIdx = Statepoint(Token).gcArgsStartIdx(); |