llvm-project/llvm/lib/Transforms/ObjCARC
Pete Cooper 697281df42 Teach ObjCARC optimizer about equivalent PHIs when eliminating autoreleaseRV/retainRV pairs
OptimizeAutoreleaseRVCall skips optimizing llvm.objc.autoreleaseReturnValue if it
sees a user which is llvm.objc.retainAutoreleasedReturnValue, and if they have
equivalent arguments (either identical or equivalent PHIs). It then assumes that
ObjCARCOpt::OptimizeRetainRVCall will optimize the pair instead.

Trouble is, ObjCARCOpt::OptimizeRetainRVCall doesn't know about equivalent PHIs
so optimizes in a different way and we are left with an unoptimized llvm.objc.autoreleaseReturnValue.

This teaches ObjCARCOpt::OptimizeRetainRVCall to also understand PHI equivalence.

rdar://problem/47005143

Reviewed By: ahatanak

Differential Revision: https://reviews.llvm.org/D56235

llvm-svn: 350284
2019-01-03 01:38:08 +00:00
..
ARCRuntimeEntryPoints.h Change the objc ARC optimizer to use the new objc.* intrinsics 2018-12-18 20:32:49 +00:00
BlotMapVector.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
CMakeLists.txt
DependencyAnalysis.cpp [TI removal] Switch ObjCARC code to directly use the nice range-based 2018-10-18 00:38:34 +00:00
DependencyAnalysis.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LLVMBuild.txt
ObjCARC.cpp
ObjCARC.h Fix assert in ObjCARC optimizer when deleting retainBlock of null or undef. 2019-01-02 21:00:02 +00:00
ObjCARCAPElim.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
ObjCARCContract.cpp Change the objc ARC optimizer to use the new objc.* intrinsics 2018-12-18 20:32:49 +00:00
ObjCARCExpand.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
ObjCARCOpts.cpp Teach ObjCARC optimizer about equivalent PHIs when eliminating autoreleaseRV/retainRV pairs 2019-01-03 01:38:08 +00:00
ProvenanceAnalysis.cpp Improve caching scheme in ProvenanceAnalysis. 2018-03-12 20:36:25 +00:00
ProvenanceAnalysis.h ProvenanceAnalysis: Store WeakTrackingVH instead of Value* in UnderlyingValue Cache. 2018-06-21 05:14:00 +00:00
ProvenanceAnalysisEvaluator.cpp
PtrState.cpp [ObjCARC] Prevent code motion into a catchswitch 2018-05-16 04:52:18 +00:00
PtrState.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00