[all-commits] [llvm/llvm-project] f39321: [Reland][IPO] Added attributor for identifying inv...

zGoldthorpe via All-commits all-commits at lists.llvm.org
Tue Jul 1 14:46:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f393211454a23bc06de76c00b8c2d96b72fe4530
      https://github.com/llvm/llvm-project/commit/f393211454a23bc06de76c00b8c2d96b72fe4530
  Author: zGoldthorpe <zgoldtho at ualberta.ca>
  Date:   2025-07-01 (Tue, 01 Jul 2025)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/Attributor.h
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    A llvm/test/Transforms/Attributor/AMDGPU/tag-invariant-loads.ll
    M llvm/test/Transforms/Attributor/dereferenceable-1.ll
    M llvm/test/Transforms/Attributor/value-simplify-local-remote.ll

  Log Message:
  -----------
  [Reland][IPO] Added attributor for identifying invariant loads (#146584)

Patched and tested the `AAInvariantLoadPointer` attributor from #141800,
which identifies pointers whose loads are eligible to be marked as
`!invariant.load`.

The bug in the attributor was due to `AAMemoryBehavior` always
identifying pointers obtained from `alloca`s as having no writes. I'm
not entirely sure why `AAMemoryBehavior` behaves this way, but it seems
to be beceause it identifies the scope of an `alloca` to be limited to
only that instruction (and, certainly, no memory writes occur within the
`alloca` instructin). This patch just adds a check to disallow all loads
from `alloca` pointers from being marked `!invariant.load` (since any
well-defined program will have to write to stack pointers at some
point).



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