| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang][NFC] Strip trailing whitespace from tests (2 of N) Only the fortran source files in flang/test have been modified. The other files in the directory will be cleaned up in subsequent commits | 8 个月前 | |
[mlir][acc] Adds attr to acc.present to identify default clause origin (#169114) The acc.present Op as generated by ACCImplicitData does not provide a way to differentiate between acc.present ops that are generated implicitly and the ones that are generated as result of an explicit default(present) clause in the source code. This differentiation would allow for better communication to the user on the decisions made by the compiler while managing data automatically between the host and the device. This commit adds this information as a discardable attribute on the acc.present op. | 8 个月前 | |
[Flang][OpenMP][Dialect] Swap to using MLIR dialect enum to encode map flags (#164043) This PR shifts from using the LLVM OpenMP enumerator bit flags to an OpenMP dialect specific enumerator. This allows us to better represent map types that wouldn't be of interest to the LLVM backend and runtime in the dialect. Primarily things like ref_ptr/ref_ptee/ref_ptr_ptee/atach_none/attach_always/attach_auto which are of interest to the compiler for certrain transformations (primarily in the FIR transformation passes dealing with mapping), but the runtime has no need to know about them. It also means if another OpenMP implementation comes along they won't need to stick to the same bit flag system LLVM chose/do leg work to address it. | 9 个月前 | |
[Flang] Extracting internal constants from scalar literals (#73829) Constants actual arguments in function/subroutine calls are currently lowered as allocas + store. This can sometimes inhibit LTO and the constant will not be propagated to the called function. Particularly in cases where the function/subroutine call happens inside a condition. This patch changes the lowering of these constant actual arguments to a global constant + fir.address_of_op. This lowering makes it easier for LTO to propagate the constant. The optimization must be enabled explicitly to run. Use -mmlir --enable-constant-argument-globalisation to enable. --------- Co-authored-by: Dmitriy Smirnov <dmitriy.smirnov@arm.com> | 2 年前 | |
Reland "[flang] Added noalias attribute to function arguments. (#140803)" This helps to disambiguate accesses in the caller and the callee after LLVM inlining in some apps. I did not see any performance changes, but this is one step towards enabling other optimizations in the apps that I am looking at. The definition of llvm.noalias says: ... indicates that memory locations accessed via pointer values based on the argument or return value are not also accessed, during the execution of the function, via pointer values not based on the argument or return value. This guarantee only holds for memory locations that are modified, by any means, during the execution of the function. I believe this exactly matches Fortran rules for the dummy arguments that are modified during their subprogram execution. I also set llvm.noalias and llvm.nocapture on the !fir.box<> arguments, because the corresponding descriptors cannot be captured and cannot alias anything (not based on them) during the execution of the subprogram. | 1 年前 | |
[MLIR] Add new complex.powi op (#158722) This PR adds a new complex.powi operation to MLIR's complex dialect for computing complex numbers raised to integer powers. Key changes include: - Addition of the new PowiOp operation definition in the Complex dialect - Integration with algebraic simplification passes for optimization - Support for conversion to ROCDL library calls - Updates to Flang frontend to generate the new operation This depends on #158642. | 10 个月前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] Generate correct name for external function. (#99510) The ExternalNameConversion will add an _ at the end of the external functions. We extract the real function name to use in the debug info. The convention is to use the real name of function in the name field and mangled name with extra _ at the end in the linkageName field. Fixes #92391. | 2 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[MLIR][LLVM][Flang] Move the element param of DICompositeType to the end (#156624) This commit moves the "element" param of DICompositeType to the end of the parameter list. This is required as there seems to be a bug in the attribute parser that breaks a print + parse roundtrip. Related ticket: https://github.com/llvm/llvm-project/issues/156623 | 10 个月前 | |
| 1 年前 | ||
[MLIR][LLVM][Flang] Move the element param of DICompositeType to the end (#156624) This commit moves the "element" param of DICompositeType to the end of the parameter list. This is required as there seems to be a bug in the attribute parser that breaks a print + parse roundtrip. Related ticket: https://github.com/llvm/llvm-project/issues/156623 | 10 个月前 | |
[MLIR][LLVM][Flang] Move the element param of DICompositeType to the end (#156624) This commit moves the "element" param of DICompositeType to the end of the parameter list. This is required as there seems to be a bug in the attribute parser that breaks a print + parse roundtrip. Related ticket: https://github.com/llvm/llvm-project/issues/156623 | 10 个月前 | |
[MLIR][LLVM][Flang] Move the element param of DICompositeType to the end (#156624) This commit moves the "element" param of DICompositeType to the end of the parameter list. This is required as there seems to be a bug in the attribute parser that breaks a print + parse roundtrip. Related ticket: https://github.com/llvm/llvm-project/issues/156623 | 10 个月前 | |
| 9 个月前 | ||
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] Make common blocks data extraction more robust. (#168752) Our current implementation for extracting information about common block required traversal of FIR which was not ideal but previously there was no other way to obtain that information. The [hl]fir.declare was extended in commit https://github.com/llvm/llvm-project/pull/155325 to include storage and storage_offset. This commit adds these operands in fircg.ext_declare and then use them in AddDebugInfoPass to create debug data for common blocks. | 8 个月前 | |
[flang][debug] Change type*N to type(kind=N). (#161432) It was discussed in https://github.com/llvm/llvm-project/pull/161361. | 10 个月前 | |
[flang][debug] Change type*N to type(kind=N). (#161432) It was discussed in https://github.com/llvm/llvm-project/pull/161361. | 10 个月前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] handle inlined dummy_scope after #167489 (#168039) #167489 did not work properly when MLIR inlining is enabled (experimental in flang, enabled with -mllvm -inline-all). The reason is that inlining will cause several fir.dummy_scope to coexist inside a same func.func (fir.dummy_scope of inlined func.func are preserved in order to preserve the relationship between arguments of the inlined call for better aliasing deductions). After #167489, the debug info pass creates argument debug info for all fir.declare with a fir.dummy_scope. This causes arguments from inlined calls to appear as argument of the procedure where the call was inlined. To avoid this, only consider that fir.declare are arguments of the current function if their fir.dummy_scope is the first one created in the function (fir.dummy_scope cannot be reorder because they have write effects to the debug memory ressource, and the fir.dummy_scope of the current functions is always emitted before any calls are lowered, so before any fir.dummy_scope are inlined). | 8 个月前 | |
[flang][debug] Track dummy argument positions explicitly. (#167489) CHARACTER dummy arguments were treated as local variables in debug info. This happened because our method to get the argument number was not robust. It relied on DeclareOp having a direct reference to arguments which was not the case for character arguments. This is fixed by storing source-level argument positions in DeclareOp. Fixes #112886 | 8 个月前 | |
[flang] Lowering support for -gdwarf-N flag. (#159137) This PR builds on the https://github.com/llvm/llvm-project/pull/158314 and adds the lowering support for -gdwarf-N flag. The changes to pass the information to AddDebugInfo pass are mostly mechanical. The AddDebugInfo pass adds ModuleFlagsOp in the module which gets translated to correct llvm metadata during mlir->llvmir translation. There is minor correction where the version is set to 0 in case no -debug-version flag is provided. Previously it was set to 2 in this case due to misreading of clang code. | 10 个月前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] Change type*N to type(kind=N). (#161432) It was discussed in https://github.com/llvm/llvm-project/pull/161361. | 10 个月前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] Use PROGRAM name for main function name (#111022) For example, in PROGRAM test_program ... END PROGRAM This allows a user to break on the main function with break test_program. This matches what classic flang and gfortran do. | 1 年前 | |
[flang][debug] Track dummy argument positions explicitly. (#167489) CHARACTER dummy arguments were treated as local variables in debug info. This happened because our method to get the argument number was not robust. It relied on DeclareOp having a direct reference to arguments which was not the case for character arguments. This is fixed by storing source-level argument positions in DeclareOp. Fixes #112886 | 8 个月前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] Add support for common blocks. (#112398) This PR adds debug support for common block in flang. As variable which are part of a common block don't have a special marker to recognize them, we use the following check to find them. %0 = fir.address_of(@a) %1 = fir.convert %0 %2 = fir.coordinate_of %1, %c0 %3 = fir.convert %2 %4 = fircg.ext_declare %3 If the memref of a fircg.ext_declare points to a fir.coordinate_of and that in turn points to an fir.address_of (ignoring immediate fir.convert) then we assume that it is a common block variable. The fir.address_of gives us the global symbol which is the storage for common block and fir.coordinate_of provides the offset in this storage. The debug hierarchy looks like as subroutine f3 integer :: x, y common /a/ x, y end subroutine @a_ = global { ... } { ... }, !dbg !26, !dbg !28 !23 = !DISubprogram(name: "f3"...) !24 = !DICommonBlock(scope: !23, name: "a", ...) !25 = !DIGlobalVariable(name: "x", scope: !24 ...) !26 = !DIGlobalVariableExpression(var: !25, expr: !DIExpression()) !27 = !DIGlobalVariable(name: "y", scope: !24 ...) !28 = !DIGlobalVariableExpression(var: !27, expr: !DIExpression(DW_OP_plus_uconst, 4)) This required following changes: 1. Instead of using DIGlobalVariableAttr in the FusedLoc of GlobalOp, we use DIGlobalVariableExpressionAttr. This allows us the generate the DIExpression where we have the information. 2. Previously, only one DIGlobalVariableExpressionAttr could be linked to one global op. I recently removed this restriction in mlir. To make use of it, we add an ArrayAttr to the FusedLoc of a GlobalOp. This allows us to pass multiple DIGlobalVariableExpressionAttr. 3. I was depending on the name of global for the name of the common block. The name gets a '_' appended. I could not find a utility function in flang to remove it so I have to brute force it. | 1 年前 | |
[flang][debug] Avoid redundant module info. (#161542) Fixes https://github.com/llvm/llvm-project/issues/160907. When a module is just being used and not defined, we generate it with decl=true. But if the file/line fields are valid, the module is not merged with the original and is considered different. This patch avoids setting file/line/scope in such cases. | 9 个月前 | |
[flang][debug] Generate DISubprogramAttr for omp::TargetOp. (#146532) This is combination of https://github.com/llvm/llvm-project/pull/138149 and https://github.com/llvm/llvm-project/pull/138039 which were opened separately for ease of reviewing. Only other change is adjustments in 2 tests which have gone in since. There are DeclareOp present for the variables mapped into target region. That allow us to generate debug information for them. But the TargetOp is still part of parent function and those variables get the parent function's DISubprogram as a scope. In OMPIRBuilder, a new function is created for the TargetOp. We also create a new DISubprogram for it. All the variables that were in the target region now have to be updated to have the correct scope. This after the fact updating of debug information becomes very difficult in certain cases. Take the example of variable arrays. The type of those arrays depend on the artificial DILocalVariable(s) which hold the size(s) of the array. This new function will now require that we generate the new variable and and new types. Similar issue exist for character type variables too. To avoid this after the fact updating, this PR generates a DISubprogramAttr for the TargetOp while generating the debug info in flang. Then we don't need to generate a DISubprogram in OMPIRBuilder. This change is made a bit more complicated by the the fact that in new scheme, the debug location already points to the new DISubprogram by the time it reaches convertOmpTarget. But we need some code generation in the parent function so we have to carefully manage the debug locations. This fixes issue #134991. | 1 年前 | |
[flang][debug] Generate DISubprogramAttr for omp::TargetOp. (#146532) This is combination of https://github.com/llvm/llvm-project/pull/138149 and https://github.com/llvm/llvm-project/pull/138039 which were opened separately for ease of reviewing. Only other change is adjustments in 2 tests which have gone in since. There are DeclareOp present for the variables mapped into target region. That allow us to generate debug information for them. But the TargetOp is still part of parent function and those variables get the parent function's DISubprogram as a scope. In OMPIRBuilder, a new function is created for the TargetOp. We also create a new DISubprogram for it. All the variables that were in the target region now have to be updated to have the correct scope. This after the fact updating of debug information becomes very difficult in certain cases. Take the example of variable arrays. The type of those arrays depend on the artificial DILocalVariable(s) which hold the size(s) of the array. This new function will now require that we generate the new variable and and new types. Similar issue exist for character type variables too. To avoid this after the fact updating, this PR generates a DISubprogramAttr for the TargetOp while generating the debug info in flang. Then we don't need to generate a DISubprogram in OMPIRBuilder. This change is made a bit more complicated by the the fact that in new scheme, the debug location already points to the new DISubprogram by the time it reaches convertOmpTarget. But we need some code generation in the parent function so we have to carefully manage the debug locations. This fixes issue #134991. | 1 年前 | |
| 8 个月前 | ||
[MLIR][LLVM][Flang] Move the element param of DICompositeType to the end (#156624) This commit moves the "element" param of DICompositeType to the end of the parameter list. This is required as there seems to be a bug in the attribute parser that breaks a print + parse roundtrip. Related ticket: https://github.com/llvm/llvm-project/issues/156623 | 10 个月前 | |
[flang][debug] Change type*N to type(kind=N). (#161432) It was discussed in https://github.com/llvm/llvm-project/pull/161361. | 10 个月前 | |
[flang][debug] Generate splitDebugFilename field in DICompileUnitAttr. (#161214) This PR builds on https://github.com/llvm/llvm-project/pull/160540 and allows us to set the splitDebugFilename field in DICompileUnitAttr. The changes are mostly mechanical. I saw some spurious white space in a test that I have cleaned up. | 10 个月前 | |
[flang][debug] Change type*N to type(kind=N). (#161432) It was discussed in https://github.com/llvm/llvm-project/pull/161361. | 10 个月前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[Flang] Add missing dependency to AddDebugInfo pass (#139099) The AddDebugInfo pass currently has a dependency on the DLTI MLIR dialect caused by a call to the fir::support::getOrSetMLIRDataLayout() utility function. This dependency is not captured in the pass definition. This patch adds the dependency and simplifies several unit tests that had to explicitly use the DLTI dialect to prevent the missing dependency from causing compiler failures. | 1 年前 | |
[flang][debug] Change type*N to type(kind=N). (#161432) It was discussed in https://github.com/llvm/llvm-project/pull/161361. | 10 个月前 | |
[Flang] Add missing dependent dialects to MLIR passes (#139260) This patch updates several passes to include the DLTI dialect, since their use of the fir::support::getOrSetMLIRDataLayout() utility function could, in some cases, require this dialect to be loaded in advance. Also, the CUFComputeSharedMemoryOffsetsAndSize pass has been updated with a dependency to the GPU dialect, as its invocation to cuf::getOrCreateGPUModule() would result in the same kind of error if no other operations or attributes from that dialect were present in the input MLIR module. | 1 年前 | |
[flang][do concurrent] Use values yielded by local init regions (#155223) Similar to what is done for OpenMP private clauses, prefer the value yielded from the init region to the allocated private variable in case the region is operating on arguments by-value (e.g. Fortran character boxes). This changes provides the same results as https://github.com/llvm/llvm-project/pull/154303 in both the LLVM and Fujitsu test suites (so no regressions). Testing Time: 7216.26s Passed : 88522 Failed : 160 Executable Missing: 408 | 11 个月前 | |
[flang][fir] Extend locality specs lowering to support init and dealloc regions (#144027) Extending fir.do_concurrent to fir.do_loop ... unordered lowering by adding support for lowring/inlining non-empty init and dealloc regions. Resolves https://github.com/llvm/llvm-project/issues/143897 (actually handles the todo). | 1 年前 | |
[flang][fir] Extend locality specs lowering to support init and dealloc regions (#144027) Extending fir.do_concurrent to fir.do_loop ... unordered lowering by adding support for lowring/inlining non-empty init and dealloc regions. Resolves https://github.com/llvm/llvm-project/issues/143897 (actually handles the todo). | 1 年前 | |
[flang][do concurrent] Re-model reduce to match reductions are modelled in OpenMP and OpenACC (#145837) This PR proposes re-modelling reduce specifiers to match OpenMP and OpenACC. In particular, this PR includes the following: * A new fir op: fir.delcare_reduction which is identical to OpenMP's omp.declare_reduction op. * Updating the reduce clause on fir.do_concurrent.loop to use the new op. * Re-uses the ReductionProcessor component to emit reductions for do concurrent just like we do for OpenMP. To do this, the ReductionProcessor had to be refactored to be more generalized. * Upates mapping do concurrent to fir.loop ... unordered nests using the new reduction model. Unfortunately, this is a big PR that would be difficult to divide up in smaller parts because the bottom of the changes are the fir table-gen changes to do concurrent. However, doing these MLIR changes cascades to the other parts that have to be modified to not break things. This PR goes in the same direction we went for private/local speicifiers. Now the do concurrent and OpenMP (and OpenACC) dialects are modelled in essentially the same way which makes mapping between them more trivial, hopefully. PR stack: - https://github.com/llvm/llvm-project/pull/145837 (this one) - https://github.com/llvm/llvm-project/pull/146025 - https://github.com/llvm/llvm-project/pull/146028 - https://github.com/llvm/llvm-project/pull/146033 | 1 年前 | |
| 10 个月前 | ||
[FLANG]Remove experimental flag from SUM simplification The SUM function does appear to be safe to use, so remove the experimental flag for the SUM operation. Reviewed By: vzakhari, awarzynski Differential Revision: https://reviews.llvm.org/D132567 | 3 年前 | |
[flang] Extend symbol update to ArrayAttrext in external-name-interop (#150061) In the external-name-interop pass, when a symbol is changed, all the uses of the renamed symbols should also be updated. The update was only applied to the SymbolRefAttr type. With this change, the update will be applied to ArrayAttr containing elements of type SymbolRefAttr. --------- Co-authored-by: Delaram Talaashrafi <dtalaashrafi@nvidia.com> | 1 年前 | |
Reland "[flang] Added noalias attribute to function arguments. (#140803)" This helps to disambiguate accesses in the caller and the callee after LLVM inlining in some apps. I did not see any performance changes, but this is one step towards enabling other optimizations in the apps that I am looking at. The definition of llvm.noalias says: ... indicates that memory locations accessed via pointer values based on the argument or return value are not also accessed, during the execution of the function, via pointer values not based on the argument or return value. This guarantee only holds for memory locations that are modified, by any means, during the execution of the function. I believe this exactly matches Fortran rules for the dummy arguments that are modified during their subprogram execution. I also set llvm.noalias and llvm.nocapture on the !fir.box<> arguments, because the corresponding descriptors cannot be captured and cannot alias anything (not based on them) during the execution of the subprogram. | 1 年前 | |
Reland "[flang] Added noalias attribute to function arguments. (#140803)" This helps to disambiguate accesses in the caller and the callee after LLVM inlining in some apps. I did not see any performance changes, but this is one step towards enabling other optimizations in the apps that I am looking at. The definition of llvm.noalias says: ... indicates that memory locations accessed via pointer values based on the argument or return value are not also accessed, during the execution of the function, via pointer values not based on the argument or return value. This guarantee only holds for memory locations that are modified, by any means, during the execution of the function. I believe this exactly matches Fortran rules for the dummy arguments that are modified during their subprogram execution. I also set llvm.noalias and llvm.nocapture on the !fir.box<> arguments, because the corresponding descriptors cannot be captured and cannot alias anything (not based on them) during the execution of the subprogram. | 1 年前 | |
[flang][OpenMP] Add reduction clause support to loop directive (#128849) Extends loop directive transformation by adding support for the reduction clause. | 1 年前 | |
| 1 年前 | ||
[flang] Recognize fir.pack_array in LoopVersioning. (#133191) This change enables LoopVersioning when fir.pack_array is met in the def-use chain. It fixes a couple of huge performance regressions caused by enabling -frepack-arrays. | 1 年前 | |
[flang][test] Fix filecheck annotation typos (#92387) | 1 年前 | |
[flang] Defined SafeTempArrayCopyAttrInterface for array repacking. (#134346) This patch defines fir::SafeTempArrayCopyAttrInterface and the corresponding OpenACC/OpenMP related attributes in FIR dialect. The actual implementations are just placeholders right now, and array repacking becomes a no-op if -fopenacc/-fopenmp is used for the compilation. | 1 年前 | |
[flang] Defined SafeTempArrayCopyAttrInterface for array repacking. (#134346) This patch defines fir::SafeTempArrayCopyAttrInterface and the corresponding OpenACC/OpenMP related attributes in FIR dialect. The actual implementations are just placeholders right now, and array repacking becomes a no-op if -fopenacc/-fopenmp is used for the compilation. | 1 年前 | |
[flang] Handle SEQUENCE derived types for array repacking. (#148777) It is possible that a non-polymorphic dummy argument has a dynamic type that does not match its static type in a valid Fortran program, e.g. when the actual and the dummy arguments have different compatible derived SEQUENCE types: module mod type t sequence integer x end type contains subroutine test(x) type t sequence integer x end type type(t) :: x(:) end subroutine end module 'test' may be called with an actual argument of type 'mod::t', which is the dynamic type of 'x' on entry to 'test'. If we create the repacking temporary based on the static type of 'x' ('test::t'), then the runtime will report the types mismatch as an error. Thus, we have to create the temporary using the dynamic type of 'x'. The fact that the dummy's type has SEQUENCE or BIND attribute is not easily computable at this stage, so we use the dynamic type for all derived type cases. As long as this is done only when the repacking actually happens, the overhead should not be noticeable. | 1 年前 | |
[MLIR][OpenMP] Add a new AutomapToTargetData conversion pass in FIR (#153048) Add a new AutomapToTargetData pass. This gathers the declare target enter variables which have the AUTOMAP modifier. And adds omp.declare_target_enter/exit mapping directives for fir.alloca and fir.free oeprations on the AUTOMAP enabled variables. Automap Ref: OpenMP 6.0 section 7.9.7. | 11 个月前 | |
[MLIR][OpenMP] Changes to function-filtering pass (#71850) Currently, when deleting the device functions in the second stage of filtering during MLIR to LLVM translation we can end up with invalid calls to these functions. This is because of the removal of the EarlyOutliningPass which would have otherwise gotten rid of any such calls. This patch aims to alter the function filtering pass in the following way: - Any host function is completely removed. - Call to the host function are also removed and their uses replaced with Undef values. - Any host function with target region code is marked to be removed during the the second stage. - Calls to such functions are still removed and their uses replaced with Undef values. Co-authored-by: Sergio Afonso <sergio.afonsofumero@amd.com> | 2 年前 | |
[MLIR][OpenMP] Improve omp.map.info verification (#132066) This patch makes the map_type and map_capture_type arguments of the omp.map.info operation required, which was already an invariant being verified by its users via verifyMapClause(). This makes it clearer, as getters no longer return misleading std::optional values. Checks for the mapper_id argument are moved to a verifier for the operation, rather than being checked by users. Functionally NFC, but not marked as such due to a reordering of arguments in the assembly format of omp.map.info. | 1 年前 | |
[Flang][OpenMP][MLIR] Initial declare target to for variables implementation (#119589) While the infrastructure for declare target to/enter and link for variables exists in the MLIR dialect and at the Flang level, the current lowering from MLIR -> LLVM IR isn't in place, it's only in place for variables that have the link clause applied. This PR aims to extend that lowering to an initial implementation that incorporates declare target to as well, which primarily requires changes in the OpenMPToLLVMIRTranslation phase. However, a minor addition to the OpenMP dialect was required to extend the declare target enumerator to include a default None field as well. This also requires a minor change to the Flang lowering's MapInfoFinlization.cpp pass to alter the map type for descriptors to deal with cases where a variable is marked declare to. Currently, when a descriptor variable is mapped declare target to the descriptor component can become attatched, and cannot be updated, this results in issues when an unusual allocation range is specified (effectively an off-by X error). The current solution is to map the descriptor always, as we always require an up-to-date version of this data. However, this also requires an interlinked PR that adds a more intricate type of mapping of structures/record types that clang currently implements, to circumvent the overwriting of the pointer in the descriptor. 3/3 required PRs to enable declare target to mapping, this PR should pass all tests and provide an all green CI. Co-authored-by: Raghu Maddhipatla raghu.maddhipatla@amd.com | 8 个月前 | |
[Flang][OpenMP] - Fix the mapping flags used on descriptors mapped by MapsForPrivatizedSymbolsPass (#167554) The descriptors of a variable that has been privatized should be mapped tofrom instead of to. | 8 个月前 | |
[flang] Do not produce result for void runtime call (#123155) Runtime function call to a void function are producing a ssa value because the FunctionType result is set to NoneType with is later translated to a empty struct. This is not an issue when going to LLVM IR but it breaks when lowering a gpu module to PTX. This patch update the RTModel to correctly set the FunctionType result type to nothing. This is one runtime call before this patch at the LLVM IR dialect step. %45 = llvm.call @_FortranAAssign(%arg0, %1, %44, %4) : (!llvm.ptr, !llvm.ptr, !llvm.ptr, i32) -> !llvm.struct<()> After the patch the call would be correctly formed llvm.call @_FortranAAssign(%arg0, %1, %44, %4) : (!llvm.ptr, !llvm.ptr, !llvm.ptr, i32) -> () Without the patch it would lead to error like: ptxas /tmp/mlir-cuda_device_mod-nvptx64-nvidia-cuda-sm_60-e804b6.ptx, line 10; error : Output parameter cannot be an incomplete array. ptxas /tmp/mlir-cuda_device_mod-nvptx64-nvidia-cuda-sm_60-e804b6.ptx, line 125; error : Call has wrong number of parameters The change is pretty much mechanical. | 1 年前 | |
[flang] Change traversal order for OptimizeArrayRepackingPass. (#153136) A long chain of fir.pack_arrays might require multiple iterations of the greedy rewriter, if we use down-top traversal. The rewriter may not converge in 10 (default) iterations. It is not an error, but it was reported as such. This patch changes the traversal to top-down and also disabled the hard error, if the rewriter does not converge soon enough. | 11 个月前 | |
[mlir][LLVM] Resync memory effect attribute with LLVM IR (#168568) - Add missing locations, namely 'ErrnoMem', 'TargetMem0', and 'TargetMem1'. | 8 个月前 | |
[flang] Inline fir.is_contiguous_box in some cases. (#133812) Added inlining for rank == 1 and innermost cases. | 1 年前 | |
[flang] Fixed out-of-bounds access in SimplifyIntrinsics. (#136171) When the mask is scalar, it is incorrect to cast it to !fir.box<!fir.array<1xlogical<>>>, because the coordinate operation will try to read the dim-1 stride from the box to get the address of the first element. Even though the stride value will be multiplied by 0, and does not matter, it is still a read past the allocated box object. Instead, we should just use box_addr to get the address of the scalar mask. | 1 年前 | |
[flang][OpenMP] Enable delayed privatization by default for omp.distribute (#131574) Switches delayed privatization for omp.distribute to be on by default: controlled by the -openmp-enable-delayed-privatization instead of by -openmp-enable-delayed-privatization-staging. ### GFortran & Fujitsu test suite results: #### gfotran test-suite (this PR): Testing Time: 34.51s Passed: 6569 #### Fujitsu without changes (commit: 0813c5cf5f52): Testing Time: 155.39s Passed : 88325 Failed : 156 Executable Missing: 408 #### Fujitsu with changes (this PR): Testing Time: 158.54s Passed : 88325 Failed : 156 Executable Missing: 408 | 1 年前 | |
[IR] Remove size argument from lifetime intrinsics (#150248) Now that #149310 has restricted lifetime intrinsics to only work on allocas, we can also drop the explicit size argument. Instead, the size is implied by the alloca. This removes the ability to only mark a prefix of an alloca alive/dead. We never used that capability, so we should remove the need to handle that possibility everywhere (though many key places, including stack coloring, did not actually respect this). | 11 个月前 | |
[flang][NFC] Use hlfir=false and flang-deprecated-no-hlfir in legacy tests (#71957) Patch 2/3 of the transition step 1 described in https://discourse.llvm.org/t/rfc-enabling-the-hlfir-lowering-by-default/72778/7. All the modified tests are still here since coverage for the direct lowering to FIR was still needed while it was default. Some already have an HLFIR version, some have not and will need to be ported in step 2 described in the RFC. Note that another 147 lit tests use -emit-fir/-emit-llvm outputs but do not need a flag since the HLFIR/no HLFIR output is the same for what is being tested. | 2 年前 | |
[flang][NFC] Characterize allocation based on MemAlloc effect instead of pattern matching (#166806) Flang alias analysis used to find allocation site by pattern matching allocation ops in mainly FIR dialect. This MR extends the characterization to instead characterize based on whether the result of an op has MemAlloc effect. | 8 个月前 | |
[Flang][Transform] Modify stack reclaim pass to use allocation address space when generating intrinsics (#96836) This PR aims to factor in the allocation address space provided by an architectures data layout when generating the intrinsic instructions, this allows them to be lowered later with the address spaces in tow. This aligns the intrinsic creation with the LLVM IRBuilder's https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/IRBuilder.h#L1053 This is also necessary for the below example to compile for OpenMP AMD GPU and not ICE the compiler in ISEL as AMD's stackrestore and stacksave are expected to have the appropriate allocation address space for AMD GPU. program main integer(4), allocatable :: test allocate(test) !$omp target map(tofrom:test) do i = 1, 10 test = test + 50 end do !$omp end target deallocate(test) end program The PR also fixes the issue I opened a while ago which hits the same error when compiling for AMDGPU: https://github.com/llvm/llvm-project/issues/82368 Although, you have to have the appropriate GPU LIBC and Fortran offload runtime (both compiled for AMDGPU) added to the linker for the command or it will reach another ISEL error and ICE weirdly. But with the pre-requisites it works fine with this PR. | 2 年前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
[flang] Create TBAA subtree for COMMON block variables. (#156558) In order to help LLVM disambiguate accesses to the COMMON block variables, this patch creates a TBAA sub-tree for each COMMON block, and the places all variables belonging to this COMMON block into this sub-tree. The structure looks like this: common /blk/ a, b, c "global data" | |- "blk_" | |- "blk_/bytes_0_to_3" |- "blk_/bytes_4_to_7" |- "blk_/bytes_8_to_11" The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc. The byte spans are created based on the storage information provided by fir.declare (#155742). See also: https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026 | 10 个月前 | |
Reland "[flang] Set LLVM specific attributes to fir.call's of Fortran runtime. (#128093)" This change is inspired by a case in facerec benchmark, where performance of scalar code may improve by about 6%@aarch64 due to getting rid of redundant loads from Fortran descriptors. These descriptors are corresponding to subroutine local ALLOCATABLE, SAVE variables. The scalar loop nest in LocalMove subroutine contains call to Fortran runtime IO functions, and LLVM globals-aa analysis cannot prove that these calls do not modify the globalized descriptors with internal linkage. This patch sets and propagates llvm.memory_effects attribute for fir.call operations calling Fortran runtime functions. In particular, it tries to set the Other memory effect to NoModRef. The Other memory effect includes accesses to globals and captured pointers, so we cannot set it for functions taking Fortran descriptors with one exception for calls where the Fortran descriptor arguments are all null. As long as different calls to the same Fortran runtime function may have different attributes, I decided to attach the attributes to the calls rather than functions. Moreover, attaching the attributes to func.func will require propagating these attributes to llvm.func, which is not happening right now. In addition to llvm.memory_effects, the new pass sets llvm.nosync and llvm.nocallback attributes that may also help LLVM alias analysis (e.g. see #127707). These attributes are ignored currently. I will support them in LLVM IR dialect in a separate patch. I also added another pass for developers to be able to print declarations/calls of all Fortran runtime functions that are recognized by the attributes setting pass. It should help with maintenance of the LIT tests. | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 个月前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 1 年前 |