[all-commits] [llvm/llvm-project] 1ab0e7: [LICM] Hoisting writeonly calls (#143799)

Jiachen (Yangyang) Wang via All-commits all-commits at lists.llvm.org
Thu Jun 19 01:09:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ab0e7dd60e26ac7c7fc64a273485522f5c5ba02
      https://github.com/llvm/llvm-project/commit/1ab0e7dd60e26ac7c7fc64a273485522f5c5ba02
  Author: Jiachen (Yangyang) Wang <130888597+WanderingAura at users.noreply.github.com>
  Date:   2025-06-19 (Thu, 19 Jun 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/test/CodeGen/AMDGPU/loop_exit_with_xor.ll
    M llvm/test/Transforms/LICM/call-hoisting.ll

  Log Message:
  -----------
  [LICM] Hoisting writeonly calls (#143799)

Adds support for hoisting `writeonly` calls in LICM.

This patch adds a missing optimization that allows hoisting of
`writeonly` function calls out of loops when it is safe to do so.
Previously, such calls were conservatively retained inside the loop
body, and the redundant calls were only reduced through unrolling,
relying on target-dependent heuristics.

Closes #143267

Testing:
- Modified previously negative tests for hoisting writeonly calls to be
instead positive
- Added test cases for hoisting of two writeonly calls where the
pointers do/do not alias
- Added a test case for not argmemonly writeonly calls.



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