[all-commits] [llvm/llvm-project] 68f39d: [NFC][ObjC][ARC] Add tests for OptimizeRetainRVCall

Visoiu Mistrih Francis via All-commits all-commits at lists.llvm.org
Tue Nov 5 07:02:01 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 68f39de042ef34ef17d93c18e80d42f2e1a970ab
      https://github.com/llvm/llvm-project/commit/68f39de042ef34ef17d93c18e80d42f2e1a970ab
  Author: Francis Visoiu Mistrih <francisvm at yahoo.com>
  Date:   2019-11-05 (Tue, 05 Nov 2019)

  Changed paths:
    M llvm/test/Transforms/ObjCARC/post-inlining.ll

  Log Message:
  -----------
  [NFC][ObjC][ARC] Add tests for OptimizeRetainRVCall

Add tests for bitcasts + zero GEPs, and pre-commit tests for lifetime
markers.


  Commit: 47d1029788b6744596bb1ab6791450eb32f2a488
      https://github.com/llvm/llvm-project/commit/47d1029788b6744596bb1ab6791450eb32f2a488
  Author: Francis Visoiu Mistrih <francisvm at yahoo.com>
  Date:   2019-11-05 (Tue, 05 Nov 2019)

  Changed paths:
    M llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
    M llvm/test/Transforms/ObjCARC/post-inlining.ll

  Log Message:
  -----------
  [ObjC][ARC] Ignore lifetime markers between *ReturnValue calls

When eliminating a pair of

`llvm.objc.autoreleaseReturnValue`

followed by

`llvm.objc.retainAutoreleasedReturnValue`

we need to make sure that the instructions in between are safe to
ignore.

Other than bitcasts and useless GEPs, it's also safe to ignore lifetime
markers for both static allocas (lifetime.start/lifetime.end) and dynamic
allocas (stacksave/stackrestore).

These get added by the inliner as part of the return sequence and can
prevent the transformation from happening in practice.

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


Compare: https://github.com/llvm/llvm-project/compare/0016c1f40043...47d1029788b6


More information about the All-commits mailing list