[PATCH] D112711: [fir] Add FIR CSE specific pass

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 08:53:34 PDT 2021


kiranchandramohan added inline comments.


================
Comment at: flang/test/Fir/cse.fir:30
+
+// CHECK-LABEL: @fun2
+func @fun2(%a : !fir.ref<i64>) -> i64 {
----------------
Not asking for a change here. I made the following change and it retains a fir.call in the second block. I guess this is because we process blocks separately.

```
-  %9 = arith.addi %7, %8 : i64
+  br ^bb2
+ ^bb2:  %9 = arith.addi %7, %8 : i64
```


================
Comment at: flang/test/Fir/cse.fir:36
+  %2 = fir.call @bar(%a) { pure = true } : (!fir.ref<i64>) -> i64
+  // CHECK-COUNT-6: arith.addi %{{.*}}, %{{.*}} : i64
+  %3 = arith.addi %1, %2 : i64
----------------
I think COUNT will not check that the addis are consecutive with no fir.calls in between. 
See test in the comment above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112711



More information about the llvm-commits mailing list