| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980) This patch renames the modules in f18 to use a capital letter in the module name Signed-off-by: Caroline Concatto <caroline.concatto@arm.com> Original-commit: flang-compiler/f18@d2eb7a1c443d1539ef12b6f027074a0eb15b1ea0 Reviewed-on: https://github.com/flang-compiler/f18/pull/980 | 6 年前 | |
[flang] Add clang-tidy check for braces around if Flang diverges from the llvm coding style in that it requires braces around the bodies of if/while/etc statements, even when the body is a single statement. This commit adds the readability-braces-around-statements check to flang's clang-tidy config file. Hopefully the premerge bots will pick it up and report violations in Phabricator. We also explicitly disable the check in the directories corresponding to the Lower and Optimizer libraries, which rely heavily on mlir and llvm and therefore follow their coding style. Likewise for the tools directory. We also fix any outstanding violations in the runtime and in lib/Semantics. Differential Revision: https://reviews.llvm.org/D104100 | 5 年前 | |
[flang] CUDA Fortran - part 1/5: parsing Begin upstreaming of CUDA Fortran support in LLVM Flang. This first patch implements parsing for CUDA Fortran syntax, including: - a new LanguageFeature enum value for CUDA Fortran - driver change to enable that feature for *.cuf and *.CUF source files - parse tree representation of CUDA Fortran syntax - dumping and unparsing of the parse tree - the actual parsers for CUDA Fortran syntax - prescanning support for !@CUF and !$CUF - basic sanity testing via unparsing and parse tree dumps ... along with any minimized changes elsewhere to make these work, mostly no-op cases in common::visitors instances in semantics and lowering to allow them to compile in the face of new types in variant<> instances in the parse tree. Because CUDA Fortran allows the kernel launch chevron syntax ("call foo<<<blocks, threads>>>()") only on CALL statements and not on function references, the parse tree nodes for CallStmt, FunctionReference, and their shared Call were rearranged a bit; this caused a fair amount of one-line changes in many files. More patches will follow that implement CUDA Fortran in the symbol table and name resolution, and then semantic checking. Differential Revision: https://reviews.llvm.org/D150159 | 3 年前 | |
[Flang][OpenMP][Lower] Program level implicit SAVE variable handling for declare target This is an attempt at mimicing the method in which threadprivate handles the following type of variables: program main integer :: i !$omp declare target to(i) end Which essentially generates a GlobalOp for the variable (which would normally only be an alloca) when it's instantiated. The main difference is there is no operation generated within the function, instead the declare target attribute is appended later within handleDeclareTarget. Reviewers: kiranchandramohan Differential Revision: https://reviews.llvm.org/D152037 | 3 年前 | |
[flang][hlfir][NFC] refactor transformational intrinsic lowering The old code had overgrown itself and become difficult to read and modify. I've rewritten it and moved it into its own translation unit. I moved PreparedActualArgument to the header file for the transformational intrinsic lowering. Logically, it belongs in ConvertCall.h, but putting it there would create a circular dependency between HlfirIntrinsics and ConvertCall. Differential Revision: https://reviews.llvm.org/D154235 | 3 年前 | |
[flang] Support for PowerPC vector type The following PowerPC vector type syntax is added: VECTOR ( element-type-spec ) where element-type-sec is integer-type-spec, real-type-sec or unsigned-type-spec. Two opaque types (__VECTOR_PAIR and __VECTOR_QUAD) are also added. A finite set of functionalities are implemented in order to support the new types: 1. declare objects 2. declare function result 3. declare type dummy arguments 4. intrinsic assignment between the new type objects (e.g. v1=v2) 5. reference functions that return the new types Submit on behalf of @tislam @danielcchen Authors: @tislam @danielcchen Differential Revision: https://reviews.llvm.org/D150876 | 3 年前 | |
[flang][NFC] Move Todo.h from Lower to Optimizer Remove a backwards dependence from Optimizer -> Lower by moving Todo.h to the optimizer and out of lowering. This patch is part of the upstreaming effort from fir-dev branch. Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D127292 | 4 年前 | |
Don't use Optional::getValue (NFC) | 4 年前 | |
[flang][hlfir] Removed incorrect clean-up in the implied-do lowering. The lowering of calls/expressions unconditionally inserts DestroyOp clean-up for hlfir.expr values, which is wrong in the case where the value is used as a result of the elemental operation created during the implied-do lowering. A cleaner fix could be to avoid DestroyOp insertion at all, but I have not figure out an easy way to do it. The DestroyOp look-up I used seems to be quite reliable, so it should just work. Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D155665 | 3 年前 | |
[Flang] Remove unused variable 'converter' in genCustomIntrinsicRefCore /data/workspace/llvm-project/flang/lib/Lower/ConvertCall.cpp:1281:9: error: unused variable 'converter' [-Werror,-Wunused-variable] auto &converter = callContext.converter; ^ 1 error generated. | 3 年前 | |
Reland "[flang] Handle array constants of any rank" Fixes gfortran test-suite regression. Differential Revision: https://reviews.llvm.org/D150686 | 3 年前 | |
[NFC][flang] Fix PushSemantics macro Add and use the CONCAT macro to force the expansion of __LINE__ in PushSemantics body. Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D153460 | 3 年前 | |
[flang][hlfir] Fixed character allocatable in structure constructor. The problem appeared as a segfault for case like this: type t character(11), allocatable :: c end type character(12), alloctable :: x type(t) y y = t(x) The frontend representes y = t(x) as y=t(c=%SET_LENGTH(x,11_8)). When 'x' is unallocated the hlfir.set_length lowering results in segfault. It could probably be handled in hlfir.set_length lowering by using NULL base for the hlfir.declare depending on the allocation status of 'x', but I am not sure if !hlfir.expr, in general, is supposed to represent an expression created from unallocated allocatable. I believe in Fortran that would mean referencing an unallocated allocatable, which is not allowed. I decided to special case SET_LENGTH in structure constructor, so that we use its 'x' operand as the RHS for the assign operation implying the isAllocatable check for cases when 'x' is allocatable. This requires setting keep_lhs_length_if_realloc flag for the assign operation. Note that when the component being intialized has deferred length the frontend does not produce SET_LENGTH. Differential Revision: https://reviews.llvm.org/D155151 | 3 年前 | |
[flang][hlfir] Lower procedure designators to HLFIR - Add a convertProcedureDesignatorToHLFIR that converts the fir::ExtendedValue from the current lowering to a fir.boxproc/tuple<fir.boxproc, len> mlir::Value. - Allow fir.boxproc/tuple<fir.boxproc, len> as hlfir::Entity values (a function is an address, but from a Fortran entity point of view, procedure that are not procedure pointers cannot be assigned to, so it makes a lot more sense to consider those as values). - Modify symbol association to not generate an hlfir.declare for dummy procedures. They are not needed and allowing hlfir.declare to declare function values would make its verifier and handling overly complex for little benefits (maybe an hlfir.declare_proc could be added if it turnout out useful later for debug info and attributes storing purposes). - Allow translation from hlfir::Entity to fir::ExtendedValue. convertToBox return type had to be relaxed because some intrinsics handles both object and procedure arguments and need to lower their object arguments "asBox". fir::BoxValue is not intended to carry dummy procedures (all its member functions would make little sense and its verifier does not accept such type). Note that AsAddr, AsValue and AsBox will always return the same MLIR value for procedure designators because they are always handled the same way in FIR. Differential Revision: https://reviews.llvm.org/D143585 | 3 年前 | |
[flang] Support for PowerPC vector type The following PowerPC vector type syntax is added: VECTOR ( element-type-spec ) where element-type-sec is integer-type-spec, real-type-sec or unsigned-type-spec. Two opaque types (__VECTOR_PAIR and __VECTOR_QUAD) are also added. A finite set of functionalities are implemented in order to support the new types: 1. declare objects 2. declare function result 3. declare type dummy arguments 4. intrinsic assignment between the new type objects (e.g. v1=v2) 5. reference functions that return the new types Submit on behalf of @tislam @danielcchen Authors: @tislam @danielcchen Differential Revision: https://reviews.llvm.org/D150876 | 3 年前 | |
Reland "[flang] Handle array constants of any rank" Fixes gfortran test-suite regression. Differential Revision: https://reviews.llvm.org/D150686 | 3 年前 | |
[flang] move ASSOCIATED intrinsic optional TARGET handling ASSOCIATED intrinsic TARGET handling is weird for OPTIONAL, because as opposed to other intrinsic arguments, OPTIONAL allocatable and pointers may be absent when passed to it, and a diassociated pointer TARGET is not the same as when TARGET is not provided. Hence, it needs custom handling in lowering. The handling was done late (in genIntrinsicCall, without the semantic context), and assumed it would be possible to retrieve the optionality aspects, but this is brittle, and hard to share with HLFIR. Move it in CustomIntrinsicCall that is intended to deal with these corner case. Also avoid using fir.box<None> as the related fir.if result, and used the correct fir.box/fir.class type for the target: using a fir.box<None> here is risky since fir.box<None> are now meant for scalar TYPE(*), and the TARGET may be ranked. Move the introduction of the fir.box<None> around the runtime (when assumed rank are supported, these will become !fir.box<!fir.array<..xNone>>). Differential Revision: https://reviews.llvm.org/D147224 | 3 年前 | |
[flang] Simple array assignment lowering This patch handles lowering of simple array assignment. a(:) = 10 or a(1) = 1 This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: PeteSteinfeld, schweitz Differential Revision: https://reviews.llvm.org/D120501 Co-authored-by: Jean Perier <jperier@nvidia.com> Co-authored-by: V Donaldson <vdonaldson@nvidia.com> Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> | 4 年前 | |
[flang][hlfir] Inherit constant length for the result of hlfir.transpose. Character length may be unknown for the type of Fortran::evaluate::FunctionRef expression, but we can try to propagate it from the argument of TRANSPOSE if it is known constant. Alternatively, we could relax hlfir.transpose verification (i.e. allow character types mismatch for the argument and the result). Depends on D155912 Reviewed By: tblah Differential Revision: https://reviews.llvm.org/D155913 | 2 年前 | |
[flang][hlfir] Map scalar character symbols in internal procedures I missed addCharSymbol in the patch adding the hlfir.declare in internal procedures for "captured" entities (https://reviews.llvm.org/D143481). Differential Revision: https://reviews.llvm.org/D145361 | 3 年前 | |
[flang] Non-type-bound defined IO lowering Generate supporting data structures and calls to new runtime IO functions for defined IO that accesses non-type-bound procedures, such as wft in: module m1 type t integer n end type interface write(formatted) module procedure wft end interface contains subroutine wft(dtv, unit, iotype, v_list, iostat, iomsg) class(t), intent(in) :: dtv integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg iostat = 0 write(unit,*,iostat=iostat,iomsg=iomsg) 'wft was called: ', dtv%n end subroutine end module module m2 contains subroutine test1 use m1 print *, 'test1, should call wft: ', t(1) end subroutine subroutine test2 use m1, only: t print *, 'test2, should not call wft: ', t(2) end subroutine end module use m1 use m2 call test1 call test2 print *, 'main, should call wft: ', t(3) end | 3 年前 | |
[flang] Fixed global name creation for literal constants. The global names were created using a hash based on the address of std::vector::data address. Since the memory may be reused by different std::vector's, this may cause non-equivalent constant expressions to map to the same name. This is what is happening in the modified flang/test/Lower/constant-literal-mangling.f90 test. I changed the name creation to use a map between the constant expressions and corresponding unique names. The uniquing is done using a name counter in FirConverter. The effect of this change is that the equivalent constant expressions are now mapped to the same global, and the naming is "stable" (i.e. it does not change from compilation to compilation). Though, the issue is not HLFIR specific it was affecting several tests when using HLFIR lowering. Differential Revision: https://reviews.llvm.org/D150380 | 3 年前 | |
[flang] Configure FirOpBuilder based on math driver options. Added MathOptionsBase to share fastmath config between different components. Frontend driver translates LangOptions into MathOptionsBase. FirConverter configures FirOpBuilder using MathOptionsBase config passed to it via LoweringOptions. Depends on D137390 Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D137391 | 3 年前 | |
[flang] Block containing an interface Name mangling may be invoked for an interface procedure contained in a block in a context that does not have access to block ID mapping. Procedures can't be defined inside a block, so name mangling doesn't need a block map. Relax an assert to account for this. block interface subroutine ss(n) bind(c) integer :: n end subroutine end interface call ss(5) end block end | 3 年前 | |
[flang][openacc] Keep original array size in reduction init region with slice Keep the original array size when materializing the private copy. Depends on D155882 Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D155893 | 2 年前 | |
[Flang][OpenMP] Use typed assignment in Atomic Write lowering Use typed assignment in Atomic Write lowering to better handle type conversions of allowed types. Note: We should make similar changes for other constructs in later patches. Reviewed By: NimishMishra Differential Revision: https://reviews.llvm.org/D154163 | 3 年前 | |
[flang] IEEE_ARITHMETIC intrinsic module procedures Implement - IEEE_CLASS - IEEE_COPY_SIGN - IEEE_GET_ROUNDING_MODE - IEEE_IS_FINITE - IEEE_IS_NAN - IEEE_IS_NEGATIVE - IEEE_IS_NORMAL - IEEE_SET_ROUNDING_MODE - IEEE_SIGNBIT - IEEE_SUPPORT_ROUNDING - IEEE_UNORDERED - IEEE_VALUE for all REAL kinds (2, 3, 4, 8, 10, 16) where applicable. | 3 年前 | |
[flang][OpenMP][OpenACC] Support stop statement in OpenMP/OpenACC region [flang][OpenMP][OpenACC] Support stop statement in OpenMP/OpenACC region This supports lowering of stop statement in OpenMP/OpenACC region. * OpenMP/OpenACC: Emit fir.unreachable only if the block is not terminated by any terminator. This avoids knocking off an existing OpenMP/OpenACC terminator. * OpenMP: Emit the OpenMP terminator instead of fir.unreachable since OpenMP regions can only be terminated by OpenMP terminators. This is currently skipped for OpenACC since unstructured code is not yet handled specially in OpenACC lowering. Fixes #60737 Fixes #61877 Co-authored-by: Kiran Chandramohan <kiranchandramohan@gmail.com> Co-authored-by: Val Donaldson <vdonaldson@nvidia.com> Reviewed By: vdonaldson, peixin Differential Revision: https://reviews.llvm.org/D129969 | 3 年前 | |
[flang][NFC] addSymbol/lookupSymbol clean-up HLFIR requires mapping symbol to a single mlir::Value (produced by a fir::FortranVariableOpInterface), while the current lowering maps the value to a fir::ExtdendedValue. So far, the HLFIR symbol query was a special one. Hence, all the code directly using symMap.lookupSymbol and symMap.addSymbol did not work with the lowering to HLFIR. Refactor the code so that symbol lookup and add symbol go through the converter in a centralize place that handles the HLFIR case (translate fir::FortranVariableOpInterface to fir::ExtdendedValue in lookups, and generate hlfir.declare when adding symbols). In the refactoring, fir::FortranVariableOpInterface is added as a symbolBox variant to avoid special casing all lookups (shallowLookup...). Remove some unused SymbolBox member function instead of updating them. Differential Revision: https://reviews.llvm.org/D143395 | 3 年前 | |
[flang] Use std::nullopt instead of None (NFC) This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 6 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 |