- Jul 22, 2023
-
-
Sam McCall authored
The special handling for these names was added in https://github.com/llvm/llvm-project/commit/055d8090d1d5137dab88533995e0c5d9b5390c28 and the motivation was the C++ standard library. It turns out some projects like using these names anyway, in particular the linux kernel. D153946 proposed making this a config option, but there are some implementation issues with the config system. As an alternative, this patch tweaks the heuristic so we only drop these symbols in system headers. This does the right thing for linux and the C++ standard library, at least. Fixes https://github.com/clangd/clangd/issues/1680 Fixes https://github.com/llvm/llvm-project/issues/63862 Differential Revision: https://reviews.llvm.org/D155381
-
Paul Robinson authored
Differential revision: https://reviews.llvm.org/D155861
-
Peter Klausler authored
A recent patch added a new test file whose name conflicts with an existing test on case-insensitive filesystems. Rename it.
-
Peter Klausler authored
A dummy argument with an assumed (*) character length or derived type parameter value specification needs to be associated with an actual argument that can supply a value for it, so make sure that a NULL without a MOLD= is not being passed. Differential Revision: https://reviews.llvm.org/D155971
-
Sam McCall authored
This ensures it finds the definition even if not visible. Differential Revision: https://reviews.llvm.org/D155898
-
Sam McCall authored
These mark the end of CompoundStmts bodies of if/while/for/switch. To identify which statement is being ended, we include abbreviated text of the condition/loop variable. Differential Revision: https://reviews.llvm.org/D155421
-
Peter Klausler authored
The check for inappropriate usage of the ASYNCHRONOUS attribute needed to be moved in declaration checking so that it can catch attempts to use it on a subroutine. Differential Revision: https://reviews.llvm.org/D155970
-
Peter Klausler authored
An item whose declared type is ABSTRACT may not appear in an array constructor. Differential Revision: https://reviews.llvm.org/D155969
-
Joseph Huber authored
This patch does the noisy work of removing the test opcodes from the exported interface to an interface that is only visible in `libc`. The benefit of this is that we both test the exported RPC registration more directly, and we do not need to give this interface to users. I have decided to export any opcode that is not a "core" libc feature as having its MSB set in the opcode. We can think of these as non-libc "extensions". Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D154848
-
Matt Arsenault authored
The highlight change is a new denormal safe 1ulp lowering which uses rcp after using frexp to perform input scaling. This saves 2 instructions compared to other implementations which performed an explicit denormal range change. This improves the OpenCL default, and requires a flag for HIP. I don't believe there's any flag wired up for OpenMP to emit the necessary fpmath metadata. This provides several improvements and changes that were hard to separate without regressing one case or another. Disturbingly the OpenCL conformance test seems to have the reciprocal test commented out. I locally hacked it back in to test this. Starts introducing f32 rsq intrinsics in AMDGPUCodeGenPrepare. Like the rcp case, we could do this in codegen if !fpmath were preserved (although we would lose some computeKnownFPClass tricks). Start requiring contract flags to form rsq. The rsq fusion actually improves the result from ~2ulp to ~1ulp. We have some older fusion in codegen which only keys off unsafe math which should be refined. Expand rsq patterns by checking for denormal inputs and pre/post multiplying like the current library code does. We also take advantage of computeKnownFPClass to avoid the scaling when we can statically prove the input cannot be a denormal. We could do the same for the rcp case, but unlike rsq a large input can underflow to denormal. We need additional upper bound exponent checks on the input in order to do the same for rcp. This rsq handling also now starts handling the negated case. We introduce rsq with an fneg. In the case the fneg doesn't fold into its user, it's a neutral change but provides improvement if it is foldable as a source modifier. Also starts respecting the arcp attribute properly, and more strictly interprets afn. We were previously interpreting afn as implying you could do the reciprocal expansion of an fdiv. The codegen handling of these also needs to be revisited. This also effectively introduces the optimization combineRepeatedFPDivisors enables, just done in the IR instead (and only for f32). This is almost across the board better. The one minor regression is for gfx6/buggy frexp case where for multiple reciprocals, we could previously reuse rematerialized constants per instance (it's neutral for a single rcp). The fdiv.fast and sqrt handling need to be revisited next. https://reviews.llvm.org/D155593
-
Srishti Srivastava authored
This commit adds a utility to implement liveness analysis using the sparse backward data-flow analysis framework. Theoretically, liveness analysis assigns liveness to each (value, program point) pair in the program and it is thus a dense analysis. However, since values are immutable in MLIR, a sparse analysis, which will assign liveness to each value in the program, suffices here. Liveness analysis has many applications. It can be used to avoid the computation of extraneous operations that have no effect on the memory or the final output of a program. It can also be used to optimize register allocation. Both of these applications help achieve one very important goal: reducing runtime. A value is considered "live" iff it: (1) has memory effects OR (2) is returned by a public function OR (3) is used to compute a value of type (1) or (2). It is also to be noted that a value could be of multiple types (1/2/3) at the same time. A value "has memory effects" iff it: (1.a) is an operand of an op with memory effects OR (1.b) is a non-forwarded branch operand and a block where its op could take the control has an op with memory effects. A value `A` is said to be "used to compute" value `B` iff `B` cannot be computed in the absence of `A`. Thus, in this implementation, we say that value `A` is used to compute value `B` iff: (3.a) `B` is a result of an op with operand `A` OR (3.b) `A` is used to compute some value `C` and `C` is used to compute `B`. --- It is important to note that there already exists an MLIR liveness utility here: llvm-project/mlir/include/mlir/Analysis/Liveness.h. So, what is the need for this new liveness analysis utility being added by this commit? That need is explained as follows:- The similarities between these two utilities is that both use the fixpoint iteration method to converge to the final result of liveness. And, both have the same theoretical understanding of liveness as well. However, the main difference between (a) the existing utility and (b) the added utility is the "scope of the analysis". (a) is restricted to analysing each block independently while (b) analyses blocks together, i.e., it looks at how the control flows from one block to the other, how a caller calls a callee, etc. The restriction in the former implies that some potentially non-live values could be marked live and thus the full potential of liveness analysis will not be realised. This can be understood using the example below: ``` 1 func.func private @private_dead_return_value_removal_0() -> (i32, i32) { 2 %0 = arith.constant 0 : i32 3 %1 = arith.addi %0, %0 : i32 4 return %0, %1 : i32, i32 5 } 6 func.func @public_dead_return_value_removal_0() -> (i32) { 7 %0:2 = func.call @private_dead_return_value_removal_0() : () -> (i32, i32) 8 return %0#0 : i32 9 } ``` Here, if we just restrict our analysis to a per-block basis like (a), we will say that the %1 on line 3 is live because it is computed and then returned outside its block by the function. But, if we perform a backward data-flow analysis like (b) does, we will say that %0#1 of line 7 is not live because it isn't returned by the public function and thus, %1 of line 3 is also not live. So, while (a) will be unable to suggest any IR optimizations, (b) can enable this IR to convert to:- ``` 1 func.func private @private_dead_return_value_removal_0() -> i32 { 2 %0 = arith.constant 0 : i32 3 return %0 : i32 4 } 5 func.func @public_dead_return_value_removal_0() -> i32 { 6 %0 = call @private_dead_return_value_removal_0() : () -> i32 7 return %0 : i32 8 } ``` One operation was removed and one unnecessary return value of the function was removed and the function signature was modified. This is an optimization that (b) can enable but (a) cannot. Such optimizations can help remove a lot of extraneous computations that are currently being done. Signed-off-by:Srishti Srivastava <srishtisrivastava.ai@gmail.com> Reviewed By: matthiaskramm, jcai19 Differential Revision: https://reviews.llvm.org/D153779
-
Peter Klausler authored
F'2023 7.8 para 5 requires that an implied DO loop with no iterations in a character array constructor should have items whose lengths are constant expressions independent of the value of the implied DO loop index. Differential Revision: https://reviews.llvm.org/D155968
-
Daniel Hoekwater authored
Because branch relaxation needs to factor in if branches target a block in the same section or a different one, it needs to run after the Basic Block Sections / Machine Function Splitting passes. Because Jump table compression relies on block offsets remaining fixed after the table is compressed, we must also move the JT compression pass. The only tests affected are ones enforcing just the ordering and the a few that have basic block ids changed because RenumberBlocks hasn't run yet. Differential Revision: https://reviews.llvm.org/D153829
-
Alexey Bataev authored
-
Peter Klausler authored
It is an error to open a new unit with OPEN(NEWUNIT=) and have neither a file name nor a scratch status. Catch it, and report a new error code. Differential Revision: https://reviews.llvm.org/D155967
-
Florian Hahn authored
Replace the use of getMaxSafeDepDistBytes with the more direct isSafeForAnyVector. This removes the need to define getMaxSafeDepDistBytes.
-
Matt Arsenault authored
Work around the lack of proper multiple return values by looking at the extractvalue. https://reviews.llvm.org/D150982
-
Matt Arsenault authored
-
Matt Arsenault authored
-
Peter Klausler authored
When searching for a matching specific procedure for a set of actual arguments in a type-bound generic interface for a defined operator, don't discard any error messages that may have been produced for the specific that was found. Tweak the code to preserve those messages and add them to the context's messages, and add a test. Differential Revision: https://reviews.llvm.org/D155966
-
Slava Zakharin authored
Some operations using the result of hlfir.dot_product can tolerate that the type of the result changes from !fir.logical to i1 during intrinsics lowering, but some won't. I added a separate LIT case with fir.store to mimic one of the nag tests. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D155914
-
Slava Zakharin authored
Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D155912
-
Slava Zakharin authored
When MatmulTranpose reports incorrect shapes of the arguments it cannot represent itself as MATMUL, because the reading of the first argument's shape will be confusing. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D155911
-
Peter Klausler authored
DIM= arguments with constant values can be checked for validity even when other arguments to an intrinsic function can't be folded. Handle errors with assumed-rank arguments as well. Differential Revision: https://reviews.llvm.org/D155964
-
Peter Klausler authored
The runtime type information tables always flag ABSTRACT types as needing neither destruction in general nor finalization in particular. This is incorrect. Although an ABSTRACT type may not itself have a FINAL procedure -- its argument cannot be polymorphic, but ABSTRACT types in declarations must always be so -- it can still have finalizable components &/or components requiring deallocation. Differential Revision: https://reviews.llvm.org/D155965
-
Noah Goldstein authored
in `ctpop(X) eq/ne 1` or `ctpop(X) ugt/ule 1`, if there is any known-bit in `X`, instead of going through `ctpop`, we can just test if there are any other known bits in `X`. If there are, `X` is not a power of 2. If there aren't, `X` is a power of 2. https://alive2.llvm.org/ce/z/eLMJgU Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D152677
-
Noah Goldstein authored
Differential Revision: https://reviews.llvm.org/D152676
-
Noah Goldstein authored
https://alive2.llvm.org/ce/z/T8osF6 Differential Revision: https://reviews.llvm.org/D152673
-
Noah Goldstein authored
Differential Revision: https://reviews.llvm.org/D152672
-
Peter Klausler authored
A name that has been used to reference an undeclared global external procedure should be accepted as the target of a procedure pointer assignment statement. Fixes llvm-test-suite/Fortran/gfortran/regression/proc_ptr_45.f90. Differential Revision: https://reviews.llvm.org/D155963
-
Peter Klausler authored
The subroutine AreSameComponent() of the predicate AreSameDerivedType() had a TODO about checking component types that needed completion in order to properly detect that two specific procedures of a generic are distinguishable in the llvm-test-suite/Fortran/gfortran/regression test import7.f90. Differential Revision: https://reviews.llvm.org/D155962
-
Rahman Lavaee authored
Reviewed By: aidengrossman, mtrofin, JestrTulip Differential Revision: https://reviews.llvm.org/D155464
-
Joseph Huber authored
This test is excessively slow on GPU targets, taking anywhere beween 5 and 60 seconds to complete each time it's run. See https://lab.llvm.org/buildbot/#/builders/55/builds/52203/steps/12/logs/stdio for an example on the NVPTX buildbot. Simply disable testing this on the GPU for now. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D155979
-
Simon Pilgrim authored
Similar to Issue #63710 - by truncating the v8i16 result with a PACKSS node before type legalization, we fail to make use of various folds that rely on TRUNCATE nodes. This required tweaks to LowerTruncateVecPackWithSignBits to recognise when the truncation source has been widened and to more closely match combineVectorSignBitsTruncation wrt truncating with PACKSS/PACKUS on AVX512 targets. One of the last stages before we can finally get rid of combineVectorSignBitsTruncation.
-
Simon Pilgrim authored
[X86] truncateVectorWithPACK - avoid concat_vectors(extract_subvector(pack()),extract_subvector(pack())) for sub-128 bit vectors As we start using this after type legalization, we must avoid creating concat_vectors nodes so late.
-
Stanislav Mekhanoshin authored
This class has to be fast and efficient with a trivial copy constructor. Differential Revision: https://reviews.llvm.org/D155881
-
Fangrui Song authored
_ZN5test312_GLOBAL__N_11CD2Ev and _ZN5test312_GLOBAL__N_11DD0Ev are swapped in LLVM_ENABLE_REVERSE_ITERATION builds. Unsupport for now.
-
Uday Bondhugula authored
Move a bunch of lingering test cases from test/Transforms/ into test/Dialect/Affine and MemRef. Differential Revision: https://reviews.llvm.org/D155855
-
Simon Pilgrim authored
[X86] Add isUpperSubvectorUndef helper to simplify recognition of vectors widened with undef upper subvectors. NFC.
-
Arthur Eubanks authored
Followup to https://reviews.llvm.org/rG760c208f6ff9e97a9a11523c00874a1eec4f876b which XFAIL'd them, but they pass in some configurations.
-