[all-commits] [llvm/llvm-project] 0231a4: [ObjC][ARC] In HandlePotentialAlterRefCount, check...

Akira Hatanaka via All-commits all-commits at lists.llvm.org
Fri Aug 28 17:46:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0231a4e5bd00785abea35b804d504a6cf4c4e464
      https://github.com/llvm/llvm-project/commit/0231a4e5bd00785abea35b804d504a6cf4c4e464
  Author: Akira Hatanaka <ahatanaka at apple.com>
  Date:   2020-08-28 (Fri, 28 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/ObjCARC/PtrState.cpp
    M llvm/test/Transforms/ObjCARC/basic.ll
    M llvm/test/Transforms/ObjCARC/opt-catchswitch.ll

  Log Message:
  -----------
  [ObjC][ARC] In HandlePotentialAlterRefCount, check whether an
instruction can decrement the reference count, not whether it can alter
it

This prevents the state transition from S_Use to S_CanRelease when doing
a bottom-up traversal and the transition from S_Retain to S_CanRelease
when doing a top-down traversal when the visited instruction can
increment the ref count but cannot decrement it. This allows the ARC
optimizer to remove retain/release pairs which were previously not
removed.

rdar://problem/21793154




More information about the All-commits mailing list