@@ -274,38 +274,38 @@ static void bindEntryBlockArgs(lower::AbstractConverter &converter,
274274 cloneBounds (v.getLBounds ())));
275275 },
276276 [&](const fir::CharBoxValue &v) {
277- // In some cases, v.len could reference the input the hlfir.declare
278- // which is the corresponding v.addr. While, this isn't a big
279- // problem by itself, it is desirable to extract this out of v.addr
280- // itself since it's first result will be of type fir.boxchar<>. For
281- // example, consider the following
277+ // In some cases, v.len could reference the input to the
278+ // hlfir.declare which is the corresponding v.addr. While this isn't
279+ // a big problem by itself, it is desirable to extract this out of
280+ // v.addr itself since it's first result will be of type
281+ // fir.boxchar<>. For example, consider the following
282282 //
283283 // func.func private @_QFPrealtest(%arg0: !fir.boxchar<1>)
284284 // %2 = fir.dummy_scope : !fir.dscope
285285 // %3:2 = fir.unboxchar %arg0 : (!fir.boxchar<1>) ->
286- // (!fir.ref<!fir.char<1,?>>, index) %4:2 = hlfir.declare %3#0
287- // typeparams %3#1 dummy_scope %2 : (!fir.ref<!fir.char<1,?>>,
288- // index,
289- // !fir.dscope) -> (!fir.boxchar<1>,
290- // !fir.ref<!fir.char<1,?>>)
286+ // (!fir.ref<!fir.char<1,?>>, index)
287+ // %4:2 = hlfir.declare (%3#0, %3#1, %2):(!fir.ref<!fir.char<1,?>>,
288+ // index,!fir.dscope) ->
289+ // (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>)
291290
292291 // In the case above,
293292 // v.addr is
294- // %4:2 = hlfir.declare %3#0 typeparams %3#1 dummy_scope %2 :
295- // (!fir.ref<!fir.char<1,?>>, index,
296- // !fir.dscope) -> (!fir.boxchar<1>,
297- // !fir.ref<!fir.char<1,?>>)
293+ // %4:2 = hlfir.declare (%3#0, %3#1, %2):(!fir.ref<!fir.char<1,?>>,
294+ // index,!fir.dscope) ->
295+ // (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>)
298296 // v.len is
299297 // %3:2 = fir.unboxchar %arg0 : (!fir.boxchar<1>) ->
300- // (!fir.ref<!fir.char<1,?>>, index)
298+ // (!fir.ref<!fir.char<1,?>>, index)
301299
302300 // Mapping this to the target will create a use of %arg0 on the
303- // target. Since omp.target is IsolatedFromAbove, this will have to
301+ // target. Since omp.target is IsolatedFromAbove, %arg0 will have to
304302 // be mapped. Presently, OpenMP lowering of target barfs when it has
305303 // to map a value that doesnt have a defining op. This can be fixed.
306- // Or we ensure that v.len = fir.unboxchar %4#0. Now if %4:2 is
307- // mapped to the target, there wont be any use of the block argument
308- // %arg0 on the target.
304+ // Or we ensure that v.len is fir.unboxchar %4#0 which will
305+ // cause %4#1 to be used on the target and consequently be
306+ // mapped to the target. As such then, there wont be any use of the
307+ // block argument %arg0 on the target.
308+
309309 mlir::Value len = v.getLen ();
310310 if (auto declareOp = val.getDefiningOp <hlfir::DeclareOp>()) {
311311 mlir::Value base = declareOp.getBase ();
0 commit comments