[all-commits] [llvm/llvm-project] a7dafe: [SDAG] Allow folding stack slots into sincos/frexp...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Tue Dec 17 02:54:39 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7dafea384a519342b2fbe210ed101c1e67f3be7
      https://github.com/llvm/llvm-project/commit/a7dafea384a519342b2fbe210ed101c1e67f3be7
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2024-12-17 (Tue, 17 Dec 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AArch64/sincos-stack-slots.ll
    M llvm/test/CodeGen/PowerPC/f128-arith.ll
    M llvm/test/CodeGen/RISCV/llvm.frexp.ll
    M llvm/test/CodeGen/X86/llvm.frexp.ll
    A llvm/test/CodeGen/X86/llvm.sincos.ll
    M llvm/test/CodeGen/X86/sincos-stack-args.ll

  Log Message:
  -----------
  [SDAG] Allow folding stack slots into sincos/frexp in more cases (#118117)

This adds a new helper `canFoldStoreIntoLibCallOutputPointers()` to
check that it is safe to fold a store into a node that will expand to a
library call that takes output pointers. This requires checking for two
(independent) properties:

1. The store is not within a CALLSEQ_START..CALLSEQ_END pair
* If it is, the expansion would lead to nested call sequences (which is
invalid)
2. The node does not appear as a predecessor to the store
* If it does, attempting to merge the store into the call would result
in a cycle in the DAG

These two properties are checked as part of the same traversal in
`canFoldStoreIntoLibCallOutputPointers()`



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list