[llvm-commits] [llvm] r154118 - in /llvm/trunk: lib/Transforms/Scalar/ObjCARC.cpp test/Transforms/ObjCARC/pr12270.ll
Dan Gohman
gohman at apple.com
Thu Apr 5 13:27:21 PDT 2012
Author: djg
Date: Thu Apr 5 15:27:21 2012
New Revision: 154118
URL: http://llvm.org/viewvc/llvm-project?rev=154118&view=rev
Log:
Fix accidentally inverted logic from r152803, and make the
testcase slightly less trivial. This fixes rdar://11171718.
Modified:
llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
llvm/trunk/test/Transforms/ObjCARC/pr12270.ll
Modified: llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp?rev=154118&r1=154117&r2=154118&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp Thu Apr 5 15:27:21 2012
@@ -4073,7 +4073,7 @@
if (!UserInst)
continue;
// FIXME: dominates should return true for unreachable UserInst.
- if (!DT->isReachableFromEntry(UserInst->getParent()) ||
+ if (DT->isReachableFromEntry(UserInst->getParent()) &&
DT->dominates(Inst, UserInst)) {
Changed = true;
Instruction *Replacement = Inst;
Modified: llvm/trunk/test/Transforms/ObjCARC/pr12270.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ObjCARC/pr12270.ll?rev=154118&r1=154117&r2=154118&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ObjCARC/pr12270.ll (original)
+++ llvm/trunk/test/Transforms/ObjCARC/pr12270.ll Thu Apr 5 15:27:21 2012
@@ -9,7 +9,13 @@
return: ; No predecessors!
%bar = bitcast %2* %x to i8*
%foo = call i8* @objc_autoreleaseReturnValue(i8* %bar) nounwind
+ call void @callee()
+ call void @use_pointer(i8* %foo)
+ call void @objc_release(i8* %foo) nounwind
ret void
}
declare i8* @objc_autoreleaseReturnValue(i8*)
+declare void @objc_release(i8*)
+declare void @callee()
+declare void @use_pointer(i8*)
More information about the llvm-commits
mailing list