[all-commits] [llvm/llvm-project] 6f8522: StackLifetime: Remove asserts for multiple lifetim...

pcc via All-commits all-commits at lists.llvm.org
Wed Aug 18 18:45:56 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f85225ef3791357f9b1aa097b575b0a2b0dff48
      https://github.com/llvm/llvm-project/commit/6f85225ef3791357f9b1aa097b575b0a2b0dff48
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2021-08-18 (Wed, 18 Aug 2021)

  Changed paths:
    M llvm/lib/Analysis/StackLifetime.cpp
    M llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll

  Log Message:
  -----------
  StackLifetime: Remove asserts for multiple lifetime intrinsics.

According to the langref, it is valid to have multiple consecutive
lifetime start or end intrinsics on the same object.

For llvm.lifetime.start:
"If ptr [...] is a stack object that is already alive, it simply
fills all bytes of the object with poison."

For llvm.lifetime.end:
"Calling llvm.lifetime.end on an already dead alloca is no-op."

However, we currently fail an assertion in such cases. I've observed
the assertion failure when the loop vectorization pass duplicates
the intrinsic.

We can conservatively handle these intrinsics by ignoring all but
the first one, which can be implemented by removing the assertions.

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




More information about the All-commits mailing list