[PATCH] D111288: [fir] Add data flow optimization pass

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 15 05:55:59 PDT 2021


awarzynski added inline comments.


================
Comment at: flang/test/Fir/memref-data-flow.fir:107-162
+func @_QPf1dv(%arg0: !fir.ref<!fir.array<?xi32>>, %arg1: !fir.ref<!fir.array<?xi32>>, %arg2: !fir.ref<!fir.array<?xi32>>, %arg3: !fir.ref<i32>) {
+  %c1_i64 = arith.constant 1 : i64
+  %c0 = arith.constant 0 : index
+  %c1 = arith.constant 1 : index
+  %0 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFf1dvEi"}
+  %1 = fir.load %arg3 : !fir.ref<i32>
+  %2 = fir.convert %1 : (i32) -> index
----------------
Perhaps something like this would be sufficient? It highlights that:
* the store-load chains have been removed (as expected)
* basic blocks have been preserved (as expected)
* `store`s and `load`s that are not in a load-store chain are preserved

I also removed all regex regex variables. These didn't seem required.

This is not too different to what @clementval proposed, but leverages `CHECK-LABEL` and `CHECK-DAG` to make it a bit more robust.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111288/new/

https://reviews.llvm.org/D111288



More information about the llvm-commits mailing list