[gn] use action() instead of copy() for libcxx headers (#195948)
copy() doesn't handle file deletions. Use an action() that syncs the
output directory with the input list via a response file, removing files
that are no longer in the list.
This works because if files are added or removed, ninja's command line
tracking re-runs the script, and if contents of existing files change,
ninja's input mtime checking reruns it.
This also makes the remove_float_h workaround unnecessary.
Motivated by all the recent header removals in libc++.
[SSAF][WPA] Add "no-op" PointerFlow and UnsafeBufferUsage analysis (#193089)
Added 'no-op' PointerFlow and UnsafeBufferUsage analyses to convert
summary data into AnalysisResult, which DerivedAnalysis can then consume.
Also, refactored the PointerFlow and UnsafeBufferUsage serialization
for code sharing.
rdar://174874942
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
Co-authored-by: Jan Korous <jkorous at apple.com>
[flang][cuda] Fix unregistered allocator (#195924)
#194290 changed how we register the constructor and made an early return
which then miss to add the constructor to `llvm.mlir.global_ctors` which
leads to runtime failure because the allocators for CUDA Fortran are not
registered.
[AMDGPU] Implement -amdgpu-spill-cfi-saved-regs
These spills need special CFI anyway, so implementing them directly
where CFI is emitted avoids the need to invent a mechanism to track them
from ISel.
Change-Id: If4f34abb3a8e0e46b859a7c74ade21eff58c4047
Co-authored-by: Scott Linder scott.linder at amd.com
Co-authored-by: Venkata Ramanaiah Nalamothu VenkataRamanaiah.Nalamothu at amd.com
[AMDGPU] Implement CFI for CSR spills
Introduce new SPILL pseudos to allow CFI to be generated for only CSR
spills, and to make ISA-instruction-level accurate information.
Other targets either generate slightly incorrect information or rely on
conventions for how spills are placed within the entry block. The
approach in this change produces larger unwind tables, with the
increased size being spent on additional DW_CFA_advance_location
instructions needed to describe the unwinding accurately.
Change-Id: I9b09646abd2ac4e56eddf5e9aeca1a5bebbd43dd
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[AMDGPU] Emit entry function Dwarf CFI
Entry functions represent the end of unwinding, as they are the
outer-most frame. This implies they can only have a meaningful
definition for the CFA, which AMDGPU defines using a memory location
description with a literal private address space address. The return
address is set to undefined as a sentinel value to signal the end of
unwinding.
Change-Id: I21580f6a24f4869ba32939c9c6332506032cc654
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[Clang] Default to async unwind tables for amdgcn
To avoid codegen changes when enabling debug-info (see
https://bugs.llvm.org/show_bug.cgi?id=37240) we want to
enable unwind tables by default.
There is some pessimization in post-prologepilog scheduling, and a
general solution to the problem of CFI_INSTRUCTION-as-scheduling-barrier
should be explored.
Change-Id: I83625875966928c7c4411cd7b95174dc58bda25a
[AMDGPU] Implement CFI for non-kernel functions
This does not implement CSR spills other than those AMDGPU handles
during PEI. The remaining spills are handled in a subsequent patch.
Change-Id: I5e3a9a62cf9189245011a82a129790d813d49373
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[MC][Dwarf] Add custom CFI pseudo-ops for use in AMDGPU
While these can be represented with .cfi_escape, using these pseudo-cfi
instructions makes .s/.mir files more readable, and it is necessary to
support updating registers in CFI instructions (something that the
AMDGPU backend requires).
Change-Id: I763d0cabe5990394670281d4afb5a170981e55d0
[flang] Fix FIR AliasAnalysis for zero-offset view chains (#192710)
When subroutine `f` below is inlined, the `ACCImplicitData` pass fails
to recognize that `b` is already covered by the enclosing `!$acc data
deviceptr`. The deviceptr clause operates on a box (`fir.embox` result)
while the inner `acc.serial` uses the underlying ref.
`fir::AliasAnalysis` traces both back through the full def-chain, where
an upstream sliced `fir.embox` (from `a(:,5)`) sets
`approximateSource=true`, causing `MayAlias` instead of `MustAlias`. The
pass falls back to implicit `copyin`/`copyout`, causing a segfault.
```fortran
module test_mod
real, allocatable :: a(:,:)
contains
subroutine f(b)
real, dimension(*) :: b
!$acc data deviceptr(b(1:100))
!$acc serial
[23 lines not shown]