[all-commits] [llvm/llvm-project] 1e5334: [Polly] Data flow reduction detection to cover mor...

Karthika Devi C via All-commits all-commits at lists.llvm.org
Tue Jul 30 09:43:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e5334bcdae462e47d8516464b2cca1674ea899d
      https://github.com/llvm/llvm-project/commit/1e5334bcdae462e47d8516464b2cca1674ea899d
  Author: Karthika Devi C <quic_kartc at quicinc.com>
  Date:   2024-07-30 (Tue, 30 Jul 2024)

  Changed paths:
    M polly/include/polly/ScopBuilder.h
    M polly/include/polly/ScopInfo.h
    M polly/lib/Analysis/ScopBuilder.cpp
    M polly/lib/Analysis/ScopInfo.cpp
    A polly/test/DependenceInfo/reduction_indirect_access.ll
    A polly/test/ScopInfo/reduction_double.ll
    A polly/test/ScopInfo/reduction_escaping_intermediate_3.ll
    A polly/test/ScopInfo/reduction_if.ll
    A polly/test/ScopInfo/reduction_indirect_access.ll
    A polly/test/ScopInfo/reduction_indirect_access_2.ll
    A polly/test/ScopInfo/reduction_long_reduction_chain.ll
    A polly/test/ScopInfo/reduction_long_reduction_chain_double_use.ll
    A polly/test/ScopInfo/reduction_multiple_different_operators.ll

  Log Message:
  -----------
  [Polly] Data flow reduction detection to cover more cases (#84901)

The base concept is same as existing reduction algorithm where we get
the list of candidate pairs <store,load>. But the existing algorithm
works only if there is single binary operation between the load and
store.
Example sum += a[i];

This algorithm extends to work with more than single binary operation as
well. It is implemented using data flow reduction detection on basic
block level. We propagate the loads, the number of times the load is
used(flows into instruction) and binary operation performed until we
reach a store.

Example sum += a[i] + b[i];
```
sum(Ld)     a[i](Ld)
      \  +  /
        tmp    b[i](Ld)
           \ + /
            sum(St)
```

In the above case the candidate pairs are formed by associating sum with
all of its load inputs which are sum, a[i] and b[i]. Then check
functions are used to filter a valid reduction pair ie {sum,sum}.

---------

Co-authored-by: Michael Kruse <github at meinersbur.de>



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