This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add affine demotion pass
ClosedPublic

Authored by clementval on Oct 6 2021, 12:40 PM.

Details

Summary

Add affine demotion pass.
Affine dialect's default lowering for loads and stores is different from
fir as it uses the memref type. The memref type is not compatible with
the Fortran runtime. Therefore, conversion of memory operations back to
fir.load and fir.store with !fir.ref<?> types is required.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Rajan Walia <walrajan@gmail.com>
Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>

Diff Detail

Event Timeline

clementval created this revision.Oct 6 2021, 12:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2021, 12:40 PM
clementval requested review of this revision.Oct 6 2021, 12:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2021, 12:40 PM

LG.

Something I just noticed is that the passes in general are lacking a consistent prefix: there is a risk of collision when used later in a library. It'd be great to standardize this (outside of this CL).

clementval added a comment.EditedOct 7 2021, 9:06 AM

LG.

Something I just noticed is that the passes in general are lacking a consistent prefix: there is a risk of collision when used later in a library. It'd be great to standardize this (outside of this CL).

Do you mean prefixing the class name? I have tried to look at the core MLIR and I don't see a pattern for names of dialects passes.

Do you mean prefixing the class name? I have tried to look at the core MLIR and I don't see a pattern for names of dialects passes.

In general the class names aren't public, I meant the command line options: this is in a global registry and it could just fail at runtime if another library would use the same name.

clementval added a comment.EditedOct 7 2021, 9:26 AM

Do you mean prefixing the class name? I have tried to look at the core MLIR and I don't see a pattern for names of dialects passes.

In general the class names aren't public, I meant the command line options: this is in a global registry and it could just fail at runtime if another library would use the same name.

Ah ok! Makes more sense. Let me check with others and we can probably apply a patch later to make this homogenous.

schweitz accepted this revision.Oct 7 2021, 1:50 PM
This revision is now accepted and ready to land.Oct 7 2021, 1:50 PM
This revision was automatically updated to reflect the committed changes.