[PATCH] D53362: [Prototype] Heap-To-Stack Conversion Pass

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 12:39:20 PDT 2018


efriedma added a comment.

I think you have to be careful about something like the following:

  void f() {
    void *p = malloc(4);
    nocapture_func_frees_pointer(p);
    func_throws();
    free(p);
  }

I don't think it's possible to trigger the issue at the moment, though, because we don't have a mustreturn attribute (so isGuaranteedToTransferExecutionToSuccessor() will return false for nocapture_func_frees_pointer).



================
Comment at: lib/Transforms/Scalar/HeapToStack.cpp:138
+      // data elsewhere. Currently, things that cause an infinite loop to be
+      // well defined (e.g., atomics, I/O) will also cause
+      // isGuaranteedToTransferExecutionToSuccessor to return false,
----------------
isGuaranteedToTransferExecutionToSuccessor is true for atomics.


https://reviews.llvm.org/D53362





More information about the llvm-commits mailing list