[PATCH] D151644: [InstCombine] Propegating `nocapture` flag to callsites

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 00:21:13 PDT 2023


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

I don't think this is correct. Consider something like this:

  define void @test(ptr nocapture %p) {
    call void @store_ptr_in_global(ptr %p)
    call void @do_something_with_store_pointer()
    call void @store_ptr_in_global(ptr null)
    ret void
  }

Here `store_ptr_in_global` escapes the pointer, but the overall function does not. It is okay to have such interior escapes as long as they are not observable by the caller.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151644/new/

https://reviews.llvm.org/D151644



More information about the llvm-commits mailing list