Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relpace LoopOp Op with DoLoopOp Op in FIR Dialect #296

Merged

Conversation

SouraVX
Copy link
Collaborator

@SouraVX SouraVX commented Jul 22, 2020

No description provided.

Copy link

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good save for the pesky underscore issue in the doxygen, etc.

@@ -428,7 +428,7 @@ Fortran into FIR in a semantics preserving way.
// create a temporary to hold E(V)
%v = ... : !fir.array<4:i32>
%8 = fir.alloca !fir.array<4:f32> : !fir.ref<!fir.array<4:f32>>
fir.loop %i = %c1 to %c4 unordered {
fir.doloop %i = %c1 to %c4 unordered {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be do_loop in the syntactic form like this. Although the _ is omitted in the camelcase class name.

@@ -17,7 +17,7 @@
include "mlir/Pass/PassBase.td"

def AffineDialectPromotion : FunctionPass<"promote-to-affine"> {
let summary = "Promotes fir.loop and fir.where to affine.for and affine.if where possible";
let summary = "Promotes fir.doloop and fir.where to affine.for and affine.if where possible";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 more here

@@ -813,11 +813,11 @@ class FirConverter : public Fortran::lower::AbstractConverter {
assert(info.stepValue && "step value must be set");
info.loopVariable = createTemp(loc, *info.loopVariableSym);

// Structured loop - generate fir.loop.
// Structured loop - generate fir.doloop.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@@ -864,7 +864,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
void genFIRIncrementLoopEnd(IncrementLoopInfo &info) {
auto loc = toLocation();
if (info.isStructured()) {
// End fir.loop.
// End fir.doloop.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

@@ -362,17 +362,17 @@ void rewriteMemoryOps(Block *block, mlir::PatternRewriter &rewriter) {
}
}

/// Convert `fir.loop` to `affine.for`, creates fir.convert for arrays to
/// Convert `fir.doloop` to `affine.for`, creates fir.convert for arrays to

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg

@@ -496,7 +496,7 @@ class AffineIfConversion : public mlir::OpRewritePattern<fir::IfOp> {
AffineFunctionAnalysis &functionAnalysis;
};

/// Promote fir.loop and fir.if to affine.for and affine.if, in the cases
/// Promote fir.doloop and fir.if to affine.for and affine.if, in the cases

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigh

@SouraVX SouraVX force-pushed the Replace-LoopOp-to-DoLoopOp branch from 346e670 to 6e64fa8 Compare July 22, 2020 18:04
@SouraVX
Copy link
Collaborator Author

SouraVX commented Jul 22, 2020

Done!

@schweitzpgi schweitzpgi merged commit 9bf4925 into flang-compiler:fir-dev Jul 22, 2020
SouraVX added a commit to llvm/llvm-project that referenced this pull request Feb 3, 2021
Part of upstreaming effort,
PR: flang-compiler#296

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D95950
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants