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
Relpace LoopOp
Op with DoLoopOp
Op in FIR Dialect
#296
Conversation
There was a problem hiding this 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.
flang/documentation/BurnsideToFIR.md
Outdated
@@ -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 { |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 more here
flang/lib/Lower/Bridge.cpp
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
flang/lib/Lower/Bridge.cpp
Outdated
@@ -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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigh
346e670
to
6e64fa8
Compare
Done! |
Part of upstreaming effort, PR: flang-compiler#296 Reviewed By: schweitz Differential Revision: https://reviews.llvm.org/D95950
Part of upstreaming effort, PR: flang-compiler/f18-llvm-project#296 Reviewed By: schweitz Differential Revision: https://reviews.llvm.org/D95950
No description provided.