diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-01-01 16:05:54 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-01-01 16:05:54 +0000 |
commit | c8a11df33b1cb3bc810b382f3926299016fb1df7 (patch) | |
tree | e1c8182ca7a58a59383a6bbcf02283018f43b174 /llvm/lib | |
parent | 3f146e204e42388bcac9a04a839a78c1f0613c16 (diff) | |
download | bcm5719-llvm-c8a11df33b1cb3bc810b382f3926299016fb1df7.tar.gz bcm5719-llvm-c8a11df33b1cb3bc810b382f3926299016fb1df7.zip |
Added DEBUG message when ObjCARC replaces a call which returns its argument verbatim with its argument to temporarily undo an optimization.
Specifically these calls return their argument verbatim, as a low-level
optimization. However, this makes high-level optimizations
harder. We undo any uses of this optimization that the front-end
emitted. We redo them later in the contract pass.
llvm-svn: 171346
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ObjCARC.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/ObjCARC.cpp b/llvm/lib/Transforms/Scalar/ObjCARC.cpp index 2bc7e2d1b7a..3c4aea13301 100644 --- a/llvm/lib/Transforms/Scalar/ObjCARC.cpp +++ b/llvm/lib/Transforms/Scalar/ObjCARC.cpp @@ -895,14 +895,18 @@ bool ObjCARCExpand::runOnFunction(Function &F) { case IC_Autorelease: case IC_AutoreleaseRV: case IC_FusedRetainAutorelease: - case IC_FusedRetainAutoreleaseRV: + case IC_FusedRetainAutoreleaseRV: { // These calls return their argument verbatim, as a low-level // optimization. However, this makes high-level optimizations // harder. Undo any uses of this optimization that the front-end // emitted here. We'll redo them in the contract pass. Changed = true; - Inst->replaceAllUsesWith(cast<CallInst>(Inst)->getArgOperand(0)); + Value *Value = cast<CallInst>(Inst)->getArgOperand(0); + DEBUG(dbgs() << "ObjCARCExpand: Old = " << *Inst << "\n" + " New = " << *Value << "\n"); + Inst->replaceAllUsesWith(Value); break; + } default: break; } |