[all-commits] [llvm/llvm-project] db86f4: [Attributor] Introduce assumption accesses in AAPo...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Wed Dec 7 15:39:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db86f45478785c373caaf35890f8aa0ae8fb3dee
      https://github.com/llvm/llvm-project/commit/db86f45478785c373caaf35890f8aa0ae8fb3dee
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-12-07 (Wed, 07 Dec 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/Attributor.h
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/value-simplify-assume.ll

  Log Message:
  -----------
  [Attributor] Introduce assumption accesses in AAPointerInfo

Assumptions can help us reason about memory content. This patch teaches
AAPointerInfo to reason about memory assumptions of the following form:

```
%x = load %ptr
... code not writing memory, may include branches ...
%c = %x == %val
... code not writing memory, may include branches ...
llvm.assume(%c)
```

Assumption accesses are recognized from the involved load (%x above).

Assumption accesses are treated special and neither as ordinary read or
write. We use read encoding with an extra flag. Reads are not impacting
other reads or writes. Writes could do that. We don't want assumptions
to impact other writes as they themselves only confirm a value, not
write it. So the "other" write might be required as the assumption only
confirms the effect of that write.




More information about the All-commits mailing list