| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR][OpenMP] Introduce overlapped record type map support (#119588) This PR introduces a new additional type of map lowering for record types that Clang currently supports, in which a user can map a top-level record type and then individual members with different mapping, effectively creating a sort of "overlapping" mapping that we attempt to cut around. This is currently most predominantly used in Fortran, when mapping descriptors and there data, we map the descriptor and its data with separate map modifiers and "cut around" the pointer data, so that wedo not overwrite it unless the runtime deems it a neccesary action based on its reference counting mechanism. However, it is a mechanism that will come in handy/trigger when a user explitily maps a record type (derived type or structure) and then explicitly maps a member with a different map type. These additions were predominantly in the OpenMPToLLVMIRTranslation.cpp file and phase, however, one Flang test that checks end-to-end IR compilation (as far as we care for now at least) was altered. 2/3 required PRs to enable declare target to mapping, should look at PR 3/3 to check for full green passes (this one will fail a number due to some dependencies). Co-authored-by: Raghu Maddhipatla raghu.maddhipatla@amd.com | 8 个月前 | |
[Flang] Add new Integration tests directory to Flang (#73141) As per the RFC: [https://discourse.llvm.org/t/rfc-flang-new-directory-for-adding-end-to-end-tests-for-lowering-to-llvm-ir-in-flang/74872/11](https://discourse.llvm.org/t/rfc-flang-new-directory-for-adding-end-to-end-tests-for-lowering-to-llvm-ir-in-flang/74872/11), this patch adds a new Integration test directory for OpenMP- flang/test/Integration/OpenMP and moves the existing OpenMP integration tests from flang/test/Driver/OpenMP to this directory. **This directory can be used to add Integration tests involving multiple stages of the compiler (for eg. from Fortran to LLVM IR). It should not contain executable tests. We should only add tests here sparingly and only if there is no other way to test. Repeat this message in each test that is added to this directory and sub-directories.** | 2 年前 | |
[flang]Add support for -moutline-atomics and -mno-outline-atomics (#78755) This adds the support to add the target-feature to outline atomic operations (calling the runtime library instead). | 2 年前 | |
[flang] add ABI argument attributes in indirect calls (#126896) Last piece that implements the TODO for sret and byval setting on indirect calls. This includes a fix to the codegen last patch. I thought types in in type attributes were automatically converted in dialect conversion passes, but that is not the case. The sret and byval type needs to be converted to llvm types in codegen (mlir FuncOp conversion is doing a similar conversion). | 1 年前 | |
[Flang][Driver][AMDGPU] Fix -mcode-object-version (#134230) This patch updates flang to follow clang's behavior when processing the -mcode-object-version option. It is now used to populate an LLVM module flag called amdhsa_code_object_version expected by the backend and also updates the driver to add the --amdhsa-code-object-version option to the frontend invocation for device compilation of AMDGPU targets. | 1 年前 | |
[flang] Emit fir.global in the global address space (#146653) Instead of emitting globals in the program/default address space, emit them in the global address space. This also requires changes how address of code-gen is handled, we need to cast to the default address space to prevent code-gen issues. | 1 年前 | |
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
[flang][debug] Fix issue with argument numbering. (#120726) Currently fir::isDummyArgument is being used to check if a DeclareOp represents a dummy argument. The argument passed to the function is declOp.getMemref(). This bypasses the code in isDummyArgument that checks for dummy_scope because the Value returned by the getMemref() may not have DeclareOp as its defining op. This bypassing mean that sometime a variable will be marked as argument when it should not. This happened in this case where same arg was being used for 2 different result variables with use of entry in the function. The solution is to check directly if the declOp has a dummy_scope. If yes, we know this is dummy argument. We can now check if the memref points to the BlockArgument and use its number. This will still miss arguments where memref does not directly point to a BlockArgument but that is missed currently too. Note that we can still evaluate those variable in debugger. It is just that they are not marked as arguments. Fixes #116525. | 1 年前 | |
[flang][debug] Better handle array lower bound of assumed shape arrays. (#110302) As mentioned in #108633, we don't respect the lower bound of the assumed shape arrays if those were specified. It happens in both cases: 1. When caller has non-default lower bound and callee has default 2. When callee has non-default lower bound and caller has default This PR tries to fix this issue by improving our generation of lower bound attribute on DICompositeTypeAttr. If we see a lower bound in the declaration, we respect that. Note that same function is also used for allocatable/pointer variables. We make sure that we get the lower bound from descriptor in those cases. Please note that DWARF assumes a lower bound of 1 so in many cases we don't need to generate the lower bound. Fixes #108633. | 1 年前 | |
[flang][debug] Better handle array lower bound of assumed shape arrays. (#110302) As mentioned in #108633, we don't respect the lower bound of the assumed shape arrays if those were specified. It happens in both cases: 1. When caller has non-default lower bound and callee has default 2. When callee has non-default lower bound and caller has default This PR tries to fix this issue by improving our generation of lower bound attribute on DICompositeTypeAttr. If we see a lower bound in the declaration, we respect that. Note that same function is also used for allocatable/pointer variables. We make sure that we get the lower bound from descriptor in those cases. Please note that DWARF assumes a lower bound of 1 so in many cases we don't need to generate the lower bound. Fixes #108633. | 1 年前 | |
[flang][debug] Support assumed size arrays. (#96316) Here we don't know the size of last dimension and use a null subrange for that. User will have to provide the dimension when evaluating variable of this type. The debugging looks like as follows: subroutine fn(a1, a2) integer a1(5, *), a2(*) ... end (gdb) p a1(1,2) $2 = 2 (gdb) p a2(3) $3 = 3 (gdb) ptype a1 type = integer (5,*) (gdb) ptype a2 type = integer (*) | 2 年前 | |
[flang][debug] Handle array types with variable size/bounds. (#110686) The debug information generated by flang did not handle the cases where dimension or lower bounds of the arrays were variable. This PR fixes this issue. It will help distinguish assumed size arrays from cases where array size are variable. It also handles the variable lower bounds for assumed shape arrays. Fixes #98879. | 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][debug] Handle allocatable strings. (#95906) The allocatable strings also use DIStringType but provide dwarf expressions to find the location and length of the string. With this change in place, the debugging of the allocatable strings looks like this: character(len=:), allocatable :: first character(len=:), allocatable :: second character(len=:), allocatable :: third first = 'Mount' second = 'Everest' third = first // " " // second print *, third (gdb) p third $1 = "" (gdb) n 18 print *, third (gdb) p third $2 = 'Mount Everest' (gdb) ptype third type = character (13) | 2 年前 | |
[flang] Main program symbol no longer conflicts with the other symbols (#149169) The following code is now accepted: module m end program m use m end The PROGRAM name doesn't really have an effect on the compilation result, so it shouldn't result in symbol name conflicts. This change makes the main program symbol name all uppercase in the cooked character stream. This makes it distinct from all other symbol names that are all lowercase in cooked character stream. Modified the tests that were checking for lower case main program name. | 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][debug] Run AddDebugInfo before TargetRewrite. (#114418) This help us generate debug info that better represents the actual Fortran source code. It was briefly discussed [here](https://github.com/llvm/llvm-project/pull/113917#pullrequestreview-2401339038). Fixes #108711. | 1 年前 | |
[flang][debug] Support derived type components with box types. (#109424) Our support for derived types uses getTypeSizeAndAlignment to calculate the offset of the members. The fir.box was not supported in that function. It meant that any member which required descriptor was not supported in the derived type. We convert the type into an llvm type and then use the DataLayout to calculate the size/offset of a member. There is no dependency on getTypeSizeAndAlignment to get the size of the types. There are 2 other changes in this PR: 1. The recID field is used to handle cases where we have a member references its parent type. 2. A type cache is maintained to avoid duplication. It is also needed for circular reference case. Fixes #108001. | 1 年前 | |
[flang][debug] Avoid redundant debug data generation for derived types. (#124473) Since https://github.com/llvm/llvm-project/pull/122770, we have seen that compile time have become extremely slow for cyclic derived types. In #122770, we made the criteria to cache a derived type very strict. As a result, some types which are safe to cache were also being re-generated every type they were required. This increased the compile time and also the size of the debug info. Please see the description of PR# 122770. We decided that when processing t1, the type generated for t2 and t3 were not safe to cached. But our algorithm also denied caching to t1 which as top level type was safe. type t1 type(t2), pointer :: p1 end type type t2 type(t3), pointer :: p2 end type type t3 type(t1), pointer :: p3 end type I have tinkered the check a bit so that top level type is always cached. To detect a top level type, we use a depth counter that get incremented before call to convertRecordType and decremented after it returns. After this change, the following [file](https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0394/0394_0031.f90) from Fujitsu get compiled around 40s which is same as it was before #122770. The smaller testcase present in issue #124049 takes less than half a second. I also added check to make sure that duplicate entries of the DICompositeType are not present in the IR. Fixes #124049 and #123960. | 1 年前 | |
| 1 年前 | ||
[flang] improve DITypeAttr caching with recursive derived types (#146543) The current DITypeAttr caching for derived type debug metadata generation strategy is not optimal. This turns out to be an issue for compile times in apps with very very complex derived types like CP2K See the added debug-cyclic-derived-type-caching-simple.f90 test for more details about the duplication issue. As a real world example justifying the new non trivial caching strategy, in CP2K, emitting debug type info for the swarm_worker_type in swarm_worker.F caused 1,747,347 llvm debug metadata nodes to be emitted instead of 8023 after this patch (200x less) leading to noticeable compile time improvements (I measured 0.12s spent in AddDebugInfo pass instead of 7.5s prior to this patch). The main idea is that caching is now associating to the cached DITypeAttr tree for a derived type a list of parent nodes being referred to recursively via indices in this DITypeAttr. When leaving the context of a parent node, all types that were cached and linked to this parent node are cleared from the cache. This allows more reusage in sub-trees while still fulfilling the MLIR requirements that DITypeAttr types referring to a parent DITypeAttr via integer id should only be used inside the DITypeAttr of the parent. Most of the complexity comes from computing the "list of parent nodes" by merging the ones from the components. This is made is such a way that the extra cost for apps without recursive derived type is minimal because the extra data structure should not require extra dynamic allocations when they are no or little recursion. Example: Take the following type graph (Fortran source for it in the added debug-cyclic-derived-type-caching-complex.f90). A is the tope level types, and has direct components of types B, C, and E. There are cycles in the type tree introduced by type B and D. Types C and E are of interest here because they are in the middle of those cycles and appear in several places in the type tree. There occurrences is labeled in brackets in the order of visit by the DebugTypeGenerator. A -> B -> C [1] -> D -> E [1] -> F -> G -> B | | | | | | | | -> D | | | | | | -> H -> E [2] -> F -> G -> B | | | | | |-> D | | | | -> I -> E [3] -> F -> G -> B | | | | | |-> D | | -> C [2] | | -> C [3] -> D | -> E [4] -> F -> G -> B | | -> D ` With this patch, E[2] and E[3] can share the same DITypeAttr as well as C[1] and C[2] while they previously all got there own nodes. To be safe with regards to cycles in MLIR, a DITypeAttr created for a node N2 under a node N1 being recursively referred to and above the recursive reference to N1 shall not be used above N1 in the DITypeAttr tree. It can however be used in several places under N1. Hence here: -E[2] cannot reuse E[1] DITypeAttr because D appears above and under E[1]. -E[3] can reuse E[2] DITypeAttr because they are both under B and above D. -E[4] cannot reuse E[3] DITypeAttr because it is above B. This is achieved by this patch because when visiting A and reaching B, the recursive reference to B is registered in the visit context. This context is added D when going back-up in F. So when reaching back E[1] with the information to build its DITypeAttr, its recursive references are known and saved along the DITypeAttr in the cache. When reaching back D, the cache for E is cleared because it is known it depended on D. A new DITypeAttr is created after E[2], and this time it only depends on B because the D under E[2] is not a recursive reference (D is not above E[2]). Hence, when reaching E[3] it can be reused, and the cache entry for E[2] is cleared when reaching B, which leads to a new DITypeAttr to be created for E[4]. | 1 年前 | |
[flang] improve DITypeAttr caching with recursive derived types (#146543) The current DITypeAttr caching for derived type debug metadata generation strategy is not optimal. This turns out to be an issue for compile times in apps with very very complex derived types like CP2K See the added debug-cyclic-derived-type-caching-simple.f90 test for more details about the duplication issue. As a real world example justifying the new non trivial caching strategy, in CP2K, emitting debug type info for the swarm_worker_type in swarm_worker.F caused 1,747,347 llvm debug metadata nodes to be emitted instead of 8023 after this patch (200x less) leading to noticeable compile time improvements (I measured 0.12s spent in AddDebugInfo pass instead of 7.5s prior to this patch). The main idea is that caching is now associating to the cached DITypeAttr tree for a derived type a list of parent nodes being referred to recursively via indices in this DITypeAttr. When leaving the context of a parent node, all types that were cached and linked to this parent node are cleared from the cache. This allows more reusage in sub-trees while still fulfilling the MLIR requirements that DITypeAttr types referring to a parent DITypeAttr via integer id should only be used inside the DITypeAttr of the parent. Most of the complexity comes from computing the "list of parent nodes" by merging the ones from the components. This is made is such a way that the extra cost for apps without recursive derived type is minimal because the extra data structure should not require extra dynamic allocations when they are no or little recursion. Example: Take the following type graph (Fortran source for it in the added debug-cyclic-derived-type-caching-complex.f90). A is the tope level types, and has direct components of types B, C, and E. There are cycles in the type tree introduced by type B and D. Types C and E are of interest here because they are in the middle of those cycles and appear in several places in the type tree. There occurrences is labeled in brackets in the order of visit by the DebugTypeGenerator. A -> B -> C [1] -> D -> E [1] -> F -> G -> B | | | | | | | | -> D | | | | | | -> H -> E [2] -> F -> G -> B | | | | | |-> D | | | | -> I -> E [3] -> F -> G -> B | | | | | |-> D | | -> C [2] | | -> C [3] -> D | -> E [4] -> F -> G -> B | | -> D ` With this patch, E[2] and E[3] can share the same DITypeAttr as well as C[1] and C[2] while they previously all got there own nodes. To be safe with regards to cycles in MLIR, a DITypeAttr created for a node N2 under a node N1 being recursively referred to and above the recursive reference to N1 shall not be used above N1 in the DITypeAttr tree. It can however be used in several places under N1. Hence here: -E[2] cannot reuse E[1] DITypeAttr because D appears above and under E[1]. -E[3] can reuse E[2] DITypeAttr because they are both under B and above D. -E[4] cannot reuse E[3] DITypeAttr because it is above B. This is achieved by this patch because when visiting A and reaching B, the recursive reference to B is registered in the visit context. This context is added D when going back-up in F. So when reaching back E[1] with the information to build its DITypeAttr, its recursive references are known and saved along the DITypeAttr in the cache. When reaching back D, the cache for E is cleared because it is known it depended on D. A new DITypeAttr is created after E[2], and this time it only depends on B because the D under E[2] is not a recursive reference (D is not above E[2]). Hence, when reaching E[3] it can be reused, and the cache entry for E[2] is cleared when reaching B, which leads to a new DITypeAttr to be created for E[4]. | 1 年前 | |
[flang][debug] Support derived type components with box types. (#109424) Our support for derived types uses getTypeSizeAndAlignment to calculate the offset of the members. The fir.box was not supported in that function. It meant that any member which required descriptor was not supported in the derived type. We convert the type into an llvm type and then use the DataLayout to calculate the size/offset of a member. There is no dependency on getTypeSizeAndAlignment to get the size of the types. There are 2 other changes in this PR: 1. The recID field is used to handle cases where we have a member references its parent type. 2. A type cache is maintained to avoid duplication. It is also needed for circular reference case. Fixes #108001. | 1 年前 | |
[flang] Disable -gdwarf-5 tests on AIX. (#159533) After recent addition of -gdwarf-N options in flang, I saw that newly added tests failing on AIX bot. The gdwarf-5 option is not supported on that platform. Disabling the dwarf-5 tests on AIX for now. | 10 个月前 | |
flang][debug] Run AddDebugInfo before TargetRewrite. (#114418) This help us generate debug info that better represents the actual Fortran source code. It was briefly discussed [here](https://github.com/llvm/llvm-project/pull/113917#pullrequestreview-2401339038). Fixes #108711. | 1 年前 | |
[flang][debug] Don't generate debug for compiler-generated variables (#112423) Flang generates many globals to handle derived types. There was a check in debug info to filter them based on the information that their names start with a period. This changed since PR#104859 where 'X' is being used instead of '.'. This PR fixes this issue by also adding 'X' in that list. As user variables gets lower cased by the NameUniquer, there is no risk that those will be filtered out. I added a test for that to be sure. | 1 年前 | |
[flang][debug] Don't generate debug for compiler-generated variables (#112423) Flang generates many globals to handle derived types. There was a check in debug info to filter them based on the information that their names start with a period. This changed since PR#104859 where 'X' is being used instead of '.'. This PR fixes this issue by also adding 'X' in that list. As user variables gets lower cased by the NameUniquer, there is no risk that those will be filtered out. I added a test for that to be sure. | 1 年前 | |
[flang][debug] Handle array types with variable size/bounds. (#110686) The debug information generated by flang did not handle the cases where dimension or lower bounds of the arrays were variable. This PR fixes this issue. It will help distinguish assumed size arrays from cases where array size are variable. It also handles the variable lower bounds for assumed shape arrays. Fixes #98879. | 1 年前 | |
[flang][OMPIRBuilder] Keep debug location in sync with insert point. (#89953) A customer reported an issue which I have reduced to the test in the PR. If built with debug info enabled, the build fails with the following error in the verifier. !dbg attachment points at wrong subprogram for function The problem happened because some of the functions in OMPIRBuilder.cpp updated the insertion point with the passed in location but did not change the current debug location. This caused a stale debug location to be attached to the instruction. I have solved it by replacing restoreIP with updateToLocation which updates both the insertion point and debug location. The updateToLocation is used in many places already, so this PR brings functions that I have changed in line with rest of the file. Slight issue is that I am not checking the return type of updateToLocation as there is no good value I could return in that case. But if we have a condition where updateToLocation will return false, these functions will fail in any case. I have added a test that checks that build does not fail. I was not sure what is the correct location for the test should be. Happy to move it to more appropriate location. | 2 年前 | |
[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] Handle 'used' module. (#107626) As described in #98883, we have to qualify a module variable name in debugger to get its value. This PR tries to remove this limitation. LLVM provides DIImportedEntity to handle such cases but the PR is made more complicated due to the following 2 issues. 1. The MLIR attributes are readonly and we have a circular dependency here. This has to be handled using the recursive interface provided by the MLIR. This requires us to first create a place holder DISubprogramAttr which is used in creating DIImportedEntityAttr. Later another DISubprogramAttr is created which replaces the place holder. 2. The flang IR does not provide any information about the 'used' module so this has to be extracted by doing a pass over the DeclareOp in the function. This presents certain limitation as 'only' and module variable renaming may not be handled properly. Due to the change in DISubprogramAttr, some tests also needed to be adjusted. Fixes #98883. | 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 个月前 | |
| 8 个月前 | ||
[flang][debug] Better handle array lower bound of assumed shape arrays. (#110302) As mentioned in #108633, we don't respect the lower bound of the assumed shape arrays if those were specified. It happens in both cases: 1. When caller has non-default lower bound and callee has default 2. When callee has non-default lower bound and caller has default This PR tries to fix this issue by improving our generation of lower bound attribute on DICompositeTypeAttr. If we see a lower bound in the declaration, we respect that. Note that same function is also used for allocatable/pointer variables. We make sure that we get the lower bound from descriptor in those cases. Please note that DWARF assumes a lower bound of 1 so in many cases we don't need to generate the lower bound. Fixes #108633. | 1 年前 | |
[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 个月前 | |
[OpenMPIRBuilder] Don't drop debug info for target region. (#80692) When an outlined function is generated for omp target region, a corresponding DISubprogram was not being generated. This resulted in all the debug information for the target region being dropped. This commit adds DISubprogram for the outlined function if there is one available for the parent function. It also updates the current debug location so that the right scope is used for the entries in the outlined function. There are places in the OpenMPIRBuilder which changes insertion point but don't update the debug location accordingly. They cause issue when debug info is enabled. I have fixed a few that I observed to cause issue. But there may be more and a systematic cleanup may be required. With this change in place, I can set source line breakpoint in target region and run to them in debugger. | 1 年前 | |
[flang][debug] Handle array types with variable size/bounds. (#110686) The debug information generated by flang did not handle the cases where dimension or lower bounds of the arrays were variable. This PR fixes this issue. It will help distinguish assumed size arrays from cases where array size are variable. It also handles the variable lower bounds for assumed shape arrays. Fixes #98879. | 1 年前 | |
[flang] Implement !DIR$ [NO]INLINE and FORCEINLINE directives (#134350) This patch adds the support of these two directives : !dir$ inline and !dir$ noinline. - !dir$ noinline tells to the compiler to not perform inlining on specific function calls by adding the noinline metadata on the call. - !dir$ inline tells to the compiler to attempt inlining on specific function calls by adding the inlinehint metadata on the call. - !dir$ forceinline tells to the compiler to always perfom inlining on specific function calls by adding the alwaysinline metadata on the call. Currently, these directives can be placed before a DO LOOP, call functions or assignments. Maybe other statements can be added in the future if needed. For the inline directive the correct name might be forceinline but I'm not sure ? | 9 个月前 | |
[flang] Fix buildbot failure after #152914 (#153578) Buildbot failure: https://lab.llvm.org/buildbot/#/builders/201/builds/5894 | 11 个月前 | |
[flang] Implement !DIR$ IVDEP directive (#133728) This directive tells the compiler to ignore vector dependencies in the following loop and it must be placed before a do loop. Sometimes the compiler may not have sufficient information to decide whether a particular loop is vectorizable due to potential dependencies between iterations and the directive is here to tell to the compiler that vectorization is safe with parallelAccesses metadata. This directive is also equivalent to #pragma clang loop assume(safety) in C++ | 8 个月前 | |
[flang] fix skip-external-rtti-definition for ppc (#146826) PPC does not use comdat. There is no need to check for that in the test, just remove it. Fix for https://lab.llvm.org/buildbot/#/builders/201/builds/5278 | 1 年前 | |
Reland [VPlan] Expand WidenInt inductions with nuw/nsw (#168354) Changes: The previous patch had to be reverted to a mismatching-OpType assert in cse. The reduced-test has now been added corresponding to a RVV pointer-induction, and the pointer-induction case has been updated to use createOverflowingBinaryOp. While at it, record VPIRFlags in VPWidenInductionRecipe. | 8 个月前 | |
[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 个月前 | |
[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 个月前 | |
[flang] Add loop annotation attributes to the loop backedge (#126082) Flang currently adds loop metadata to a conditional branch in the loop preheader, while clang adds it to the loop latch's branch instruction. Langref says: > Currently, loop metadata is implemented as metadata attached to the branch instruction in the loop latch block. > > https://llvm.org/docs/LangRef.html#llvm-loop I misread langref a couple times, but I think this is the appropriate branch op for the LoopAnnotationAttr. In a couple examples I found that the metadata was lost entirely during canonicalization. This patch makes the codegen look more like clang's and the annotations persist through codegen. * current clang: https://godbolt.org/z/8WhbcrnG3 * current flang: https://godbolt.org/z/TrPboqqcn | 1 年前 |
Flang Integration Tests
This directory can be used to add Integration tests involving multiple stages of the compiler (for eg. from Fortran to LLVM IR). It should not contain executable tests. We should only add tests here sparingly and only if there is no other way to test. Repeat this message in each test that is added to this directory and sub-directories.