[flang-commits] [flang] [flang][NFC] Engineering option for optimizing allocatable assignments. (PR #119936)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Dec 16 02:20:51 PST 2024


================
@@ -462,16 +474,20 @@ ElementalAssignBufferization::findMatch(hlfir::ElementalOp elemental) {
   // the incoming expression
   match.array = match.assign.getLhs();
   mlir::Type arrayType = mlir::dyn_cast<fir::SequenceType>(
-      fir::unwrapPassByRefType(match.array.getType()));
-  if (!arrayType)
+      hlfir::getFortranElementOrSequenceType(match.array.getType()));
+  if (!arrayType) {
----------------
tblah wrote:

`getFortranElementOrSequenceType` will return the element type if the passed type is not an array. I think this should be

```suggestion
  if (!mlir::isa<fir::SequenceType>(arrayType)) {
```

https://github.com/llvm/llvm-project/pull/119936


More information about the flang-commits mailing list