[all-commits] [llvm/llvm-project] 315aef: [LICM] Fix thread safety checks for promotion of b...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Sep 1 06:34:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 315aef667ec60675627ecd0fe1424f9c186766de
      https://github.com/llvm/llvm-project/commit/315aef667ec60675627ecd0fe1424f9c186766de
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-09-01 (Thu, 01 Sep 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/test/Transforms/LICM/promote-capture.ll

  Log Message:
  -----------
  [LICM] Fix thread safety checks for promotion of byval args

This code was relying on a very subtle contract: The expectation
was that for non-allocas, the unwind safety check would already
perform a capture check, so we don't need to perform it later.
This held true when this unwind safety was only handled for allocas
and noalias calls, but became incorrect when byval support was
added.

To avoid this kind of issue, just remove the dependency between the
unwind and thread-safety checks entirely. At worst, this means we
perform a redundant capture check. If this should turn out to be
problematic for compile-time, we can cache that query in a more
explicit way.




More information about the All-commits mailing list