- Feb 17, 2021
-
-
Craig Topper authored
[SelectionDAG][AArch64] Restrict matchUnaryPredicate to only handle SPLAT_VECTOR for scalable vectors. fde24661 added support for scalable vectors to matchUnaryPredicate by handling SPLAT_VECTOR in addition to BUILD_VECTOR. This was used to enabled UDIV/SDIV/UREM/SREM by constant expansion in BuildUDIV/BuildSDIV in TargetLowering.cpp The caller there expects to call getBuildVector from the match factors. This leads to a crash right now if there is a SPLAT_VECTOR of fixed vectors since the number of vectors won't match the number of elements. To fix this, this patch updates the callers to check the opcode instead of whether the type is fixed or scalable. This assumes that only 3 opcodes are handled by matchUnaryPredicate so I've added an assertion to the final else to check that opcode. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D96174
-
Alex Zinenko authored
Verification of the LLVM IR produced when translating various MLIR dialects was only active when calling the translation programmatically. This has led to several cases of invalid LLVM IR being generated that could not be caught with textual mlir-translate tests. Add verifiers for these cases and fix the tests in preparation for enforcing the validation of LLVM IR. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D96774
-
Florian Hahn authored
ICMP & SELECT patterns extracting the sign of a value can be simplified to OR & ASR (see https://alive2.llvm.org/ce/z/Xx4iZ0). This does not save any instructions in IR, but it is profitable on AArch64, because we need at least 2 extra instructions to materialize 1 and -1 for the SELECT. The improvements result in ~5% speedups on loops of the form static int sign_of(int x) { if (x < 0) return -1; return 1; } void foo(const int *x, int *res, int cnt) { for (int i=0;i<cnt;i++) res[i] = sign_of(x[i]); } Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D96596
-
Siva Chandra Reddy authored
Few math functions manipulate errno. They assumed that LLVM libc's errno is available. However, that might not be the case when these functions are used in a libc which does not use LLVM libc's errno. This change switches such uses of LLVM libc's errno to the normal public errno macro. This does not affect LLVM libc's build because the include order ensures we get LLVM libc's errno. Also, the header check rule ensures we are only including LLVM libc's errno.h.
-
Kazu Hirata authored
This patch fixes a warning from -Wcovered-switch-default. The switch statement in question handles all the enum values.
-
Alex Zinenko authored
Make sure they can only be attached to LLVM functions as a result of converting GPU functions to the LLVM Dialect.
-
Arnold Schwaighofer authored
[coro async] Don't promote allocas to the frame or rewrite swifterror if there are no suspend points Also don't call function to update the call graph if there are no clones. The function will fail. rdar://74277860 Differential Revision: https://reviews.llvm.org/D96620
-
clementval authored
This patch introduce the fir-opt tool. Similar to mlir-opt for FIR. It will be used in following patches to test fir opt and round-trip. Reviewed By: schweitz, mehdi_amini Differential Revision: https://reviews.llvm.org/D96535
-
David Green authored
From what I can tell, a writeback is unpredictable with LR for both loads and stores. This changes the operand from a gprnopc to a rGPR in both cases (which I believe is essentially a NFC due to the tied-def already being a rGPR.) Differential Revision: https://reviews.llvm.org/D96723
-
- Feb 16, 2021
-
-
Matt Arsenault authored
In a future commit, soft clauses will be hinted with kill instructions rather than forced together with bundles. Look for kills that look like this, and erase them. I'm not sure if the check for specific uses is worthwhile, or if it would be better to just unconditionally erase kills. This reduces test churn in a future patch.
-
Simon Pilgrim authored
Fold shuffle(bop(shuffle(x,y),shuffle(z,w)),bop(shuffle(a,b),shuffle(c,d))) -> bop(shuffle(x,y),shuffle(z,w)),bop(shuffle(a,b),shuffle(c,d)) Attempt to fold from a shuffle of a pair of binops to a binop of shuffles, as long as one/both of the binop sources are also shuffles that can be merged with the outer shuffle. This should guarantee that we remove one binop without introducing any additional shuffles. Technically there's potential for a merged shuffle's lowering to be poorer than the original shuffle, but it could also be better, and I'm not seeing any regressions as long as we keep the 'don't merge splats' rule already present in MergeInnerShuffle. This expands and generalizes an existing X86 combine and attempts to merge either of each binop's sources (with an on-the-fly commutation of the shuffle mask) - we couldn't do that in the x86 version as it had to stay in a form that DAGCombine's MergeInnerShuffle would still recognise. Differential Revision: https://reviews.llvm.org/D96345
-
Matt Arsenault authored
This was allowing debug instructions to break the bundling, which would change scheduling behavior. Bundle debug info / kills inside the bundle. This seems to work OK, although the asm printer doesn't understand these in a bundle. This implicitly expects the memory legalizer to unbundle. It would probably be slightly nicer to move these after. Rewrite the loop to be clearer and make sure we don't end a bundle on a meta instruction, only allow them in between other valid bundle instructions.
-
serge-sans-paille authored
This takes advantage of the implicit default behavior to reduce the number of attributes, which in turns reduces compilation time. I've observed -3% in instruction count when compiling sqlite3 amalgamation with -O0 Differential Revision: https://reviews.llvm.org/D96400
-
Thomas Raoux authored
Some of the lowering of vector.contract didn't support integer case. Since reduction of integer cannot accumulate we always break up the reduction op, it should be merged by a separate canonicalization if possible. Differential Revision: https://reviews.llvm.org/D96461
-
Thomas Raoux authored
This helps bufferization passes by removing tensor_cast operations. Differential Revision: https://reviews.llvm.org/D96745
-
Lei Zhang authored
These patterns unrolls transfer read/write ops if the vector consumers/ producers are extract/insert slices op. Transfer ops can map to hardware load/store functionalities, where the vector size matters for bandwidth considerations. So these patterns should be collected separately, instead of being generic canonicalization patterns. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D96782
-
Colin Finck authored
This allows building libc++ against winpthreads from mingw-w64 to support operating systems older than Windows 7. The remaining libc++ code already supports `WIN32` with `LIBCXX_HAS_PTHREAD_API`. Note that there is also the older "pthreads-win32". However, that support library implements `pthread_t` as a struct, which violates the libc++ assumption that `pthread_t` is always a scalar and can be compared, ordered, and set to zero. Differential Revision: https://reviews.llvm.org/D96339
-
Lei Zhang authored
Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D96781
-
Pavel Labath authored
lldb-server can use a named pipe to communicate the port number it is listening on. This windows bits of this are already implemented, but we did not have a test for that, most likely because python does not have native pipe functionality. This patch implements the windows bits necessary to test this. I'm using the ctypes package to call the native APIs directly to avoid a dependency to non-standard python packages. This introduces some amount of boilerplate, but our named pipe use case is fairly limited, so we should not end up needing to wrap large chunks of windows APIs. Surprisingly to changes to lldb-server were needed to make the test pass. Differential Revision: https://reviews.llvm.org/D96260
-
Sam McCall authored
This finally makes it possible to implement useful modules. Differential Revision: https://reviews.llvm.org/D96726
-
LLVM GN Syncbot authored
-
Sam McCall authored
Differential Revision: https://reviews.llvm.org/D96730
-
Ta-Wei Tu authored
This is a split patch of D96644. Explicitly pass both `InnerLoop` and `OuterLoop` to function `processLoop` to remove the need to swap elements in loop list and allow making loop list an `ArrayRef`. Also, fix inconsistent spellings of `OuterLoopId` and `Inner Loop Id` in debug log. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D96650
-
David Truby authored
When a literal that cannot fit in the immediate form of the fmov instruction is used to initialise an SVE vector, an extra unnecessary fmov is currently generated. This patch adds an extra codegen pattern preventing the extra instruction from being generated. Differential Revision: https://reviews.llvm.org/D96700 Co-Authored-By:
Paul Walker <paul.walker@arm.com>
-
Jan Svoboda authored
This patch adds a test that verifies all `CompilerInvocation` members are filled correctly during command line round-trip. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D96705
-
Florian Hahn authored
The member is not needed any longer after recent changes.
-
Simon Pilgrim authored
-
Simon Pilgrim authored
Avoids so many APInt instances by directly using the APInt reference from getAPIntValue.
-
Kerry McLaughlin authored
This patch enables scalable vectorization of loops with integer/fast reductions, e.g: ``` unsigned sum = 0; for (int i = 0; i < n; ++i) { sum += a[i]; } ``` A new TTI interface, isLegalToVectorizeReduction, has been added to prevent reductions which are not supported for scalable types from vectorizing. If the reduction is not supported for a given scalable VF, computeFeasibleMaxVF will fall back to using fixed-width vectorization. Reviewed By: david-arm, fhahn, dmgreen Differential Revision: https://reviews.llvm.org/D95245 -
Jan Svoboda authored
This patch generates the `-f[no-]finite-loops` arguments from `CompilerInvocation` (added in D96419), fixing test failures of Clang built with `-DCLANG_ROUND_TRIP_CC1_ARGS=ON`. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D96761
-
Denys Petrov authored
Summary: Refactor SValBuilder::evalCast function. Make the function clear and get rid of redundant and repetitive code. Unite SValBuilder::evalCast, SimpleSValBuilder::dispatchCast, SimpleSValBuilder::evalCastFromNonLoc and SimpleSValBuilder::evalCastFromLoc functions into single SValBuilder::evalCast. This patch shall not change any previous behavior. Differential Revision: https://reviews.llvm.org/D90157
-
Faris Rehman authored
Add the following options: * -fimplicit-none and -fno-implicit-none * -fbackslash and -fno-backslash * -flogical-abbreviations and -fno-logical-abbreviations * -fxor-operator and -fno-xor-operator * -falternative-parameter-statement * -finput-charset=<value> Summary of changes: - Enable extensions in CompilerInvocation#ParseFrontendArgs - Add encoding_ to Fortran::frontend::FrontendOptions - Add encoding to Fortran::parser::Options Differential Revision: https://reviews.llvm.org/D96407
-
Tres Popp authored
Previously this might happen if there was no elseRegion and the method was asked for all successor regions. Differential Revision: https://reviews.llvm.org/D96764
-
James Henderson authored
These directives force the associated address to be interpreted as a function or data respectively. CODE is the default when not specified. Differential Revision: https://reviews.llvm.org/D96712 Reviewed by: MaskRay
-
Fraser Cormack authored
These didn't show up as failures locally.
-
Fraser Cormack authored
Non-splatted non-integer build_vector nodes were mistakenly being lowered as VID expressions, which should not happen. VID can only be used to select integer build_vector nodes. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D96718
-
Fraser Cormack authored
The patterns mostly follow the scalar counterparts, save for some extra optimizations to match the vector/scalar forms. The patch adds a DAGCombine for ISD::FCOPYSIGN to try and reorder ISD::FNEG around any ISD::FP_EXTEND or ISD::FP_TRUNC of the second operand. This helps us achieve better codegen to match vfsgnjn. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D96028
-
Andrzej Warzynski authored
-
Nicolas Vasilache authored
This revision adds support for hoisting "subtensor + vector.transfer_read" / "subtensor_insert + vector.transfer_write pairs" across scf.for. The unit of hoisting becomes a HoistableRead / HoistableWrite struct which contains a pair of "vector.transfer_read + optional subtensor" / "vector.transfer_write + optional subtensor_insert". scf::ForOp canonicalization patterns are applied greedily on the successful application of the transformation to cleanup the IR more eagerly and potentially expose more transformation opportunities. Differential revision: https://reviews.llvm.org/D96731
-
Andrzej Warzynski authored
This patch adds the following compiler frontend driver options: * -fdebug-unparse (f18 spelling: -funparse) * -fdebug-unparse-with-symbols (f18 spelling: -funparse-with-symbols) The new driver will only accept the new spelling. `f18` will accept both the original and the new spelling. A new base class for frontend actions is added: `PrescanAndSemaAction`. This is added to reduce code duplication that otherwise these new options would lead to. Implementation from * `ParseSyntaxOnlyAction::ExecutionAction` is moved to: * `PrescanAndSemaAction::BeginSourceFileAction` This implementation is now shared between: * PrescanAndSemaAction * ParseSyntaxOnlyAction * DebugUnparseAction * DebugUnparseWithSymbolsAction All tests that don't require other yet unimplemented options are updated. This way `flang-new -fc1` is used instead of `f18` when `FLANG_BUILD_NEW_DRIVER` is set to `On`. In order to facilitate this, `%flang_fc1` is added in the LIT configuration (lit.cfg.py). `asFortran` from f18.cpp is duplicated as `getBasicAsFortran` in FrontendOptions.cpp. At this stage it's hard to find a good place to share this method. I suggest that we revisit this once a switch from `f18` to `flang-new` is complete. Differential Revision: https://reviews.llvm.org/D96483
-