[PATCH] D114154: [fir] Add fir.no_reassoc conversion

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 14:13:54 PST 2021


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:1131-1132
+                  mlir::ConversionPatternRewriter &rewriter) const override {
+    rewriter.replaceOp(noreassoc, adaptor.getOperands()[0]);
+    return success();
+  }
----------------
Does lowering generate this operation now? If not then notifyMatchFailure would be better here.


================
Comment at: flang/test/Fir/convert-to-llvm.fir:1549
+// CHECK:         %[[ALLOC:.*]] = llvm.alloca %[[C1]] x i32 {in_type = i32, operand_segment_sizes = dense<0> : vector<2xi32>} : (i64) -> !llvm.ptr<i32>
+// CHECK-NOT:     fir.no_reassoc
+// CHECK:         %[[LOAD:.*]] = llvm.load %[[ARG0]] : !llvm.ptr<i32>
----------------
The reassoc is after the load right? Or are you simulating a reassociation here?

Anyway checking an fir op here does not help I think.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114154



More information about the llvm-commits mailing list