- Oct 03, 2022
-
-
Bjorn Pettersson authored
Added a helper in TargetLibraryInfo to get size of "size_t" in bits, given a Module reference. The new getSizeTSize helper is using the same strategy as for example isValidProtoForLibFunc has been using in the past, assuming that the size can be derived by asking DataLayout about the size/type of a pointer to int. FortifiedLibCallSimplifier::optimizeStrpCpyChk was changed to use the new getSizeTSize helper instead of assuming that sizeof(size_t) is equal to sizeof(int*) by itself (that is the assumption used in TargetLibraryInfoImpl::getSizeTSize so the result will be the same). Having a common helper for this ensure that we use the same strategy when deriving the size of "size_t" in different parts of the code. One bonus with this refactoring (basing it on Module instead of just DataLayout) is that it makes it easier to override this for a specific target triple, in case the assumption of using getPointerSizeInBits wouldn't hold. Differential Revision: https://reviews.llvm.org/D110585
-
Javier Setoain authored
The only current options to create a supervectorization pass from an external dialect is to use `createSuperVectorizePass` with the virtual vector dimensions as a parameter, but the pass accepts other parameters. This patch enables external users to create a supervectorizer pass exposing all available option. Differential Revision: https://reviews.llvm.org/D134632
-
Jean Perier authored
For TRIM and REPEAT calls, semantics was creating ProcedureDesignators using the length parameter of the arguments. This caused bugs when folding LEN(TRIM(char_explicit_constant_length)). The same did not appeared in folding for REPEAT because it is rewritten at a higher level to LEN(c)*N. This is not only a folding issue since any place (like lowering) may try to use the bad length parameter from the created ProcedureDesignator. Update intrinsic resolution to not copy the length parameter for TRIM and REPEAT. Differential Revision: https://reviews.llvm.org/D134970
-
Max Kazantsev authored
-
Weining Lu authored
The same as SPARC and RISCV. See D119122. Differential Revision: https://reviews.llvm.org/D134932
-
Valentin Clement authored
The raw accessor is going away soon so switch to prefixed accessors in the fircg dialect. The main dialect was switched some months ago. https://github.com/llvm/llvm-project/issues/58090 Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D135061
-
Alvin Wong authored
Fixes https://github.com/llvm/llvm-project/issues/49958 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D135027
-
Alvin Wong authored
Delay-loaded imports creats a load thunk with a symbol name. Before this change, the name uses a `__imp_load_` prefix. On the other hand, normal import uses the `__imp_` prefix for the import address pointer. If an import symbol named `load_func` is imported normally and another named `func` is imported using delay-load, this can cause a symbol name collision. This patch changes delay-load imports to use `__imp___load_` prefix. Because it is less likely for normal imports to have a name starting in `__load_` this should reduce the chance of a name collision. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D134464
-
Alvin Wong authored
Before this, LLD sets OrdinalBase to 0, which deviates from usual practices. This technically would allow LLD to export a symbol using ordinal 0, however LLD never use export ordinal 0, which results in binaries with export tables always having an empty export at ordinal 0. This change makes LLD set OrdinalBase to 1 and not create the empty export with ordinal 0, which makes its behaviour more in line with both the MSVC linker and the GNU linker. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D134140
-
Vitaly Buka authored
-
Vitaly Buka authored
Looks like a part of reverted D131898. This reverts commit cfd5b8f1.
-
Peixin Qiao authored
The real(10) is supported on x86_64. On aarch64, the value of selected_real_kind(16) should be 16 rather than 10 since real(10) is not supported on x86_64. Previously, the real type support check is not target dependent. Support it now through the target triple information. Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D134021
-
Christian Sigg authored
-
Matthias Springer authored
One of the test cases matched IR from a subsequent test case. For this reason, the test case appeared to pass while it is actually broken. This change does not fix the test case itself. It will be fixed when we overhaul the buffer deallocation implementation. (The memory leak in this test case is an edge case.) Differential Revision: https://reviews.llvm.org/D135046
-
Amara Emerson authored
Before, the isPreLegalize() query in CombinerHelper only checked for the presence of a LegalizerInfo object. This is problematic when we want to have a combine actually check for legality in a pre-legalizer combine pass, since if we pass a LegalizerInfo object to the constructor it causes the combines to think that we're running *post* legalizer, which isn't true. This change fixes it to instead check an explicit bool that passes to signal whether the pass will be run before or after legalization. Doing so exposed a bug in the extending loads combine, which tried to check for legality of candidate extending loads if LegalizerInfo was present. Since we only ran it pre-legalizer and therefore with a null LegalizerInfo, it never actually ran. Also fixes the legality checks to keep the tests passing. Differential Revision: https://reviews.llvm.org/D135044
-
Matthias Springer authored
This interface is implemented by memref.dim and tensor.dim. This change makes it possible to remove a build dependency of the Affine dialect on the Tensor dialect (and maybe also the MemRef dialect in the future). Differential Revision: https://reviews.llvm.org/D133595
-
Fangrui Song authored
-
Vitaly Buka authored
Breaks bots https://lab.llvm.org/buildbot/#/builders/37/builds/17086 This reverts commit 2dc68b53.
-
Fangrui Song authored
-
Yuanqiang Liu authored
Add outline-shape-computation pass. This pass his pass outlines the shape computation part in high level IR by adding shape.func and populate corresponding mapping information into ShapeMappingAnalysis. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D131810
-
Fangrui Song authored
-
Fangrui Song authored
-
Matthias Springer authored
Differential Revision: https://reviews.llvm.org/D135048
-
LLVM GN Syncbot authored
-
Vitaly Buka authored
Breaks ubsan tests https://lab.llvm.org/buildbot/#/builders/85/builds/11131 This reverts commit 099384dc.
-
Stella Laurenzo authored
This is a first step towards high level representation for fp8 types that have been built in to hardware with near term roadmaps. Like the BFLOAT16 type, the family of fp8 types are inspired by IEEE-754 binary floating point formats but, due to the size limits, have been tweaked in various ways in order to maximally use the range/precision in various scenarios. The list of variants is small/finite and bounded by real hardware. This patch introduces the E5M2 FP8 format as proposed by Nvidia, ARM, and Intel in the paper: https://arxiv.org/pdf/2209.05433.pdf As the more conformant of the two implemented datatypes, we are plumbing it through LLVM's APFloat type and MLIR's type system first as a template. It will be followed by the range optimized E4M3 FP8 format described in the paper. Since that format deviates further from the IEEE-754 norms, it may require more debate and implementation complexity. Given that we see two parts of the FP8 implementation space represented by these cases, we are recommending naming of: * `F8M<N>` : For FP8 types that can be conceived of as following the same rules as FP16 but with a smaller number of mantissa/exponent bits. Including the number of mantissa bits in the type name is enough to fully specify the type. This naming scheme is used to represent the E5M2 type described in the paper. * `F8M<N>F` : For FP8 types such as E4M3 which only support finite values. The first of these (this patch) seems fairly non-controversial. The second is previewed here to illustrate options for extending to the other known variant (but can be discussed in detail in the patch which implements it). Many conversations about these types focus on the Machine-Learning ecosystem where they are used to represent mixed-datatype computations at a high level. At that level (which is why we also expose them in MLIR), it is important to retain the actual type definition so that when lowering to actual kernels or target specific code, the correct promotions, casts and rescalings can be done as needed. We expect that most LLVM backends will only experience these types as opaque `I8` values that are applicable to some instructions. MLIR does not make it particularly easy to add new floating point types (i.e. the FloatType hierarchy is not open). Given the need to fully model FloatTypes and make them interop with tooling, such types will always be "heavy-weight" and it is not expected that a highly open type system will be particularly helpful. There are also a bounded number of floating point types in use for current and upcoming hardware, and we can just implement them like this (perhaps looking for some cosmetic ways to reduce the number of places that need to change). Creating a more generic mechanism for extending floating point types seems like it wouldn't be worth it and we should just deal with defining them one by one on an as-needed basis when real hardware implements a new scheme. Hopefully, with some additional production use and complete software stacks, hardware makers will converge on a set of such types that is not terribly divergent at the level that the compiler cares about. (I cleaned up some old formatting and sorted some items for this case: If we converge on landing this in some form, I will NFC commit format only changes as a separate commit) Differential Revision: https://reviews.llvm.org/D133823
-
- Oct 01, 2022
-
-
luxufan authored
Differential Revision: https://reviews.llvm.org/D134884
-
- Oct 03, 2022
-
-
LLVM GN Syncbot authored
-
Vitaly Buka authored
Breaks msan, asan https://lab.llvm.org/buildbot/#/builders/5/builds/27904 This reverts commit 005916de.
-
Fangrui Song authored
-
Valentin Clement authored
Introduce a new ClassType for polymorphic entities. A fir.class type is similar to a fir.box type in many ways and is also base on the BaseBoxType. This patch is part of the implementation of the poltymorphic entities. https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md Depends on D134956 Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D134957
-
Valentin Clement authored
Introduce a BaseBoxType to be used by BoxType and the a new ClassType that is introduced in a follow up patch. This patch is part of the implementation of the poltymorphic entities. https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D134956
-
Fangrui Song authored
-
Mark de Wever authored
This should fix the CI.
-
Sanjay Patel authored
This is an unusual canonicalization because we create an extra instruction, but it's likely better for analysis and codegen (similar reasoning as D133399). InstCombine::Negator may create this kind of multiply from negate and shift, but this should not conflict because of the narrow negation. I don't know how to create a fully general proof for this kind of transform in Alive2, but here's an example with bitwidths similar to one of the regression tests: https://alive2.llvm.org/ce/z/J3jTjR Differential Revision: https://reviews.llvm.org/D133667
-
- Oct 02, 2022
-
-
-
Sanjay Patel authored
-
David Green authored
These go via Dag2Dag, which are better based on element sizes not the exact element types.
-
David Green authored
-
Florian Hahn authored
Update tryToSimplifyOverflowMath to indicate whether the function made any changes to the IR.
-