- Mar 03, 2021
-
-
Qiu Chaofan authored
This patch enables spilling GPR to VSRs instead of stack under AIX ABI. Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D97367
-
Craig Topper authored
[LegalizeVectorTypes] Improve SplitVecRes_INSERT_SUBVECTOR to handle subvector being in the high half of the split or not at element 0 of the low half. This function isn't exercised in lit tests today today according to the code coverage report. But will be after the tests in D97543 and D97559. Posting this patch to help a crash that Fraser hit. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D97582
-
Jianzhou Zhao authored
-
Jianzhou Zhao authored
This is a part of https://reviews.llvm.org/D95835. One issue is about origin load optimization: see the comments of useCallbackLoadLabelAndOrigin @gbalats This change may have some conflicts with your 8bit change. PTAL the change at visitLoad. Reviewed By: morehouse, gbalats Differential Revision: https://reviews.llvm.org/D97570
-
Nathan James authored
Exchanging types, reordering fields and borrowing a bit from OptionGroupIndex shrinks this from 12 bytes to 8. This knocks ~20k from the binary size. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D97553
-
Nathan James authored
Make use of the `equalsBoundNode` matcher to ensure Init, Conditon and Increment variables all refer to the same variable during matching. Reviewed By: steveire Differential Revision: https://reviews.llvm.org/D97639
-
Wang, Pengfei authored
Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D97444
-
George Balatsouras authored
This addresses ~50 clang-tidy warnings on dfsan instrumentation pass. It also contains some refactoring (all non-functional changes) to eliminate some variables and simplify code. Reviewed By: stephan.yichao.zhao Differential Revision: https://reviews.llvm.org/D97714
-
Felix Berger authored
This disables the check for false positive cases where implicit type conversion through either an implicit single argument constructor or a member conversion operator is triggered when constructing the loop variable. Fix the test cases that meant to cover these cases. Differential Revision: https://reviews.llvm.org/D97577 Reviewed-by: hokein
-
Petr Hosek authored
This reverts commit 4e421b23 as this seemed to have broke Python 3 executable detection on some builders.
-
Petr Hosek authored
We want to enable the use of Polly in Fuchsia. Differential Revision: https://reviews.llvm.org/D97819
-
Jonas Devlieghere authored
-
Jonas Devlieghere authored
-
Victor Huang authored
This patch allows generating TLS variables in assembly files on AIX. Initialized and external uninitialized variables are generated with the .csect pseudo-op and local uninitialized variables are generated with the .comm/.lcomm pseudo-ops. The patch also adds a check to explicitly say that TLS is not yet supported on AIX. Reviewed by: daltenty, jasonliu, lei, nemanjai, sfertile Originally patched by: bsaleil Commandeered by: NeHuang Differential Revision: https://reviews.llvm.org/D96184
-
Petr Hosek authored
compiler-rt needs to use standalone build because of the assumptions made by its build, but other runtimes can use non-standalone build. Differential Revision: https://reviews.llvm.org/D97575
-
zoecarver authored
Implementes [[ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0356r5.html | P0356R5 ]]. Adds `bind_front` to `functional`. Reviewed By: ldionne, #libc, Quuxplusone Differential Revision: https://reviews.llvm.org/D60368
-
Jonas Devlieghere authored
Add a column to the table of convenience variables with the equivalent API to get to the current debugger, target, process, etc. We often get asked to make convenience variables available outside of the interactive interpreter. After explaining why that's not possible, a common complaint is that it's hard to find out how to get to these variables in a non-interactive context, for example how to get to the current frame when given a thread. This patch aims to alleviate that by including the APIs to navigate between these instances in the table. Differential revision: https://reviews.llvm.org/D97778
-
Neal (nealsid) authored
A few cleanups suggested in another patch review's comments: 1. Use llvm:unique_function for storing & invoking callbacks from Editline to IOHandler 2. Change return type of one of the callback setters from bool to void, since it's return value was never used 3. Moved the callback setters inline & made them nonstatic, since that's more consistent with other setter definitions 4. Removed the baton parameter since we no longer need it anymore Differential revision: https://reviews.llvm.org/D50299
-
Arthur Eubanks authored
Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D97810
-
Andrei Elovikov authored
Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D97787
-
Fangrui Song authored
-
Aart Bik authored
Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D97795
-
Peter Steinfeld authored
It's possible to define a procedure whose interface depends on a procedure which has an interface that depends on the original procedure. Such a circular definition was causing the compiler to fall into an infinite loop when resolving the name of the second procedure. It's also possible to create circular dependency chains of more than two procedures. I fixed this by adding the function HasCycle() to the class DeclarationVisitor and calling it from DeclareProcEntity() to detect procedures with such circularly defined interfaces. I marked the associated symbols of such procedures by calling SetError() on them. When processing subsequent procedures, I called HasError() before attempting to analyze their interfaces. Unfortunately, this did not work. With help from Tim, we determined that the SymbolSet used to track the erroneous symbols was instantiated using a "<" operator which was defined using the location of the name of the procedure. But the location of the procedure name was being changed by a call to ReplaceName() between the times that the calls to SetError() and HasError() were made. This caused HasError() to incorrectly report that a symbol was not in the set of erroneous symbols. I fixed this by changing SymbolSet to be an unordered set that uses the contents of the name of the symbol as the basis for its hash function. This works because the contents of the name of the symbol is preserved by ReplaceName() even though its location changes. I also fixed the error message used when reporting recursively defined dummy procedure arguments by removing extra apostrophes and sorting the list of symbols. I also added tests that will crash the compiler without this change. Note that the "<" operator is used in other contexts, for example, in the map of characterized procedures, maps of items in equivalence sets, maps of structure constructor values, ... All of these situations happen after name resolution has been completed and all calls to ReplaceName() have already happened and thus are not subject to the problem I ran into when ReplaceName() was called when processing procedure entities. Note also that the implementation of the "<" operator uses the relative location in the cooked character stream as the basis of its implementation. This is potentially problematic when symbols from diffent compilation units (for example symbols originating in .mod files) are put into the same map since their names will appear in two different source streams which may not be allocated in the same relative positions in memory. But I was unable to create a test that caused a problem. Using a direct comparison of the content of the name of the symbol in the "<" operator has problems. Symbols in enclosing or parallel scopes can have the same name. Also using the location of the symbol in the cooked character stream has the advantage that it preserves the the order of the symbols in a structure constructor constant, which makes matching the values with the symbols relatively easy. This patch supersedes D97749. Differential Revision: https://reviews.llvm.org/D97774
-
https://reviews.llvm.org/D97335Nico Weber authored
fix attempt http://reviews.llvm.org/rGbbdb4c8c9bcef0e didn't work The problem is that the test tries to look up llvm_orc_registerJITLoaderGDBWrapper from the llvm-jitlink.exe executable, but the symbol wasn't exported. Just manually export it for now. There's a FIXME with a suggestion for a real fix.
-
Kamlesh Kumar authored
immediate build failure when Cross Unwinding enabled. Follow up patch will cleanup some Macros handling. Differential Revision: https://reviews.llvm.org/D97762
-
Hansang Bae authored
This is a preview of allocator support for target memory that depends on the offload runtime API which allocates memory as described below. llvm_omp_target_alloc_host(size_t size, int device_num); -- Returns non-migratable memory owned by host. -- Memory is accessible by host and device(s). llvm_omp_target_alloc_shared(size_t size, int device_num); -- Returns migratable memory owned by host and device. -- Memory is accessible by host and device. llvm_omp_target_alloc_device(size_t size, int device_num); -- Returns memory owned by device. -- Memory is only accessible by device. New memory space and predefined allocator names are -- llvm_omp_target_host_mem_space -- llvm_omp_target_shared_mem_space -- llvm_omp_target_device_mem_space -- llvm_omp_target_host_mem_alloc -- llvm_omp_target_shared_mem_alloc -- llvm_omp_target_device_mem_alloc Differential Revision: https://reviews.llvm.org/D96669
-
Christopher Di Bella authored
Implements part of P0898R3 Standard Library Concepts Reworks D74351 to use requires-clauses over SFINAE and so that it more closely follows the wording. Co-authored by: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com> (Michael did all the heavy lifting and I came in to polish it for submission, since Michael is focussing on `std::format` now.) Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D96657
-
Matt Arsenault authored
This merges more AMDGPU ABI lowering code into the generic call lowering. Start cleaning up by factoring away more of the pack/unpack logic into the buildCopy{To|From}Parts functions. These could use more improvement, and the SelectionDAG versions are significantly more complex, and we'll eventually have to emulate all of those cases too. This is mostly NFC, but does result in some minor instruction reordering. It also removes some of the limitations with mismatched sizes the old code had. However, similarly to the merge on the input, this is forcing gfx6/gfx7 to use the gfx8+ ABI (which is what we actually want, but SelectionDAG is stuck using the weird emergent ABI). This also changes the load/store size for stack passed EVTs for AArch64, which makes it consistent with the DAG behavior. -
Adrian Prantl authored
This is a follow-up to 188b0747. This is a very narrow fix to a more general problem. LLDB should be better at distinguishing between implict and memory location descriptions. rdar://74902042
-
Nikita Popov authored
To fix some build bots after D89264.
-
Sam McCall authored
ClangdServer already gets notified of every change, so it makes sense for it to be the source of truth. This is a step towards having ClangdServer expose a FS that includes dirty buffers: D94554 Related changes: - version is now optional for ClangdServer, to preserve our existing fuzziness in this area (missing version ==> autoincrement) - ClangdServer::format{File,Range} are now more regular ClangdServer functions that don't need the code passed in. While here, combine into one function. - incremental content update logic is moved from DraftStore to ClangdLSPServer, with most of the implementation in SourceCode.cpp. DraftStore is now fairly trivial, and will probably ultimately be *replaced* by the dirty FS stuff. Differential Revision: https://reviews.llvm.org/D97738 -
Nathan James authored
Inclusion of iostream is frobidden and using other stream classes from standard library is discouraged as per https://llvm.org/docs/CodingStandards.html#include-iostream-is-forbidden Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D97771
-
Markus Böck authored
Windows is in the unique position of having two drivers, clang-cl and normal GNU clang, depending on whether a GNU or MSVC target is used. The current implementation with the USE_TOOLCHAIN argument assumes that when CMAKE_SYSTEM_NAME is set to Windows that clang-cl should be used, which is the incorrect choice when targeting a GNU environment. This patch solves this problem by adding an optional TARGET_TRIPLE argument to llvm_ExternalProject_Add, which sets the various CMAKE_<LANG>_COMPILER_TARGET variables. Additionally, if the triple is detected as an MSVC environment, clang-cl and similar MSVC specific tools will be used instead of the GNU tools.
-
Heejin Ahn authored
This fixes two bugs in `WebAssemblyExceptionInfo` grouping, created by D97247. These two bugs are not easy to split into two different CLs, because tests that fail for one also tend to fail for the other. - In D97247, when fixing `ExceptionInfo` grouping by taking out the unwind destination' exception from the unwind src's exception, we just iterated the BBs in the function order, but this was incorrect; this changes it to dominator tree preorder. Please refer to the comments in the code for the reason and an example. - After this subexception-taking-out fix, there still can be remaining BBs we have to take out. When Exception B is taken out of Exception A (because EHPad B is the unwind destination of EHPad A), there can still be BBs within Exception A that are reachable from Exception B, which also should be taken out. Please refer to the comments in the code for more detailed explanation on why this can happen. To make this possible, this splits `WebAssemblyException::addBlock` into two parts: adding to a set and adding to a vector. We need to iterate on BBs within a `WebAssemblyException` to fix this, so we add BBs to sets first. But we add BBs to vectors later after we fix all incorrectness because deleting BBs from vectors is expensive. I considered removing the vector from `WebAssemblyException`, but it was not easy because this class has to maintain a similar interface with `MachineLoop` to be wrapped into a single interface `SortRegion`, which is used in CFGSort. Other misc. drive-by fixes: - Make `WebAssemblyExceptionInfo` do not even run when wasm EH is not used or the function doesn't have any EH pads, not to waste time - Add `LLVM_DEBUG` lines for easy debugging - Fix `preds` comments in cfg-stackify-eh.ll - Fix `__cxa_throw`'s signature in cfg-stackify-eh.ll Fixes https://github.com/emscripten-core/emscripten/issues/13554. Reviewed By: dschuff, tlively Differential Revision: https://reviews.llvm.org/D97677
-
Stephen Kelly authored
Fix handling of default construction where the constructor has a default arg. Differential Revision: https://reviews.llvm.org/D97142
-
Nikita Popov authored
Even when MemorySSA-based LICM is used, an AST is still populated for scalar promotion. As the AST has quadratic complexity, a lot of time is spent in this step despite the existing access count limit. This patch optimizes the identification of promotable stores. The idea here is pretty simple: We're only interested in must-alias mod sets of loop invariant pointers. As such, only populate the AST with loop-invariant loads and stores (anything else is definitely not promotable) and then discard any sets which alias with any of the remaining, definitely non-promotable accesses. If we promoted something, check whether this has made some other accesses loop invariant and thus possible promotion candidates. This is much faster in practice, because we need to perform AA queries for O(NumPromotable^2 + NumPromotable*NumNonPromotable) instead of O(NumTotal^2), and NumPromotable tends to be small. Additionally, promotable accesses have loop invariant pointers, for which AA is cheaper. This has a signicant positive compile-time impact. We save ~1.8% geomean on CTMark at O3, with 6% on lencod in particular and 25% on individual files. Conceptually, this change is NFC, but may not be so in practice, because the AST is only an approximation, and can produce different results depending on the order in which accesses are added. However, there is at least no impact on the number of promotions (licm.NumPromoted) in test-suite O3 configuration with this change. Differential Revision: https://reviews.llvm.org/D89264
-
Yonghong Song authored
Andrei Matei reported a llvm11 core dump for his bpf program https://bugs.llvm.org/show_bug.cgi?id=48578 The core dump happens in LiveVariables analysis phase. #4 0x00007fce54356bb0 __restore_rt #5 0x00007fce4d51785e llvm::LiveVariables::HandleVirtRegUse(unsigned int, llvm::MachineBasicBlock*, llvm::MachineInstr&) #6 0x00007fce4d519abe llvm::LiveVariables::runOnInstr(llvm::MachineInstr&, llvm::SmallVectorImpl<unsigned int>&) #7 0x00007fce4d519ec6 llvm::LiveVariables::runOnBlock(llvm::MachineBasicBlock*, unsigned int) #8 0x00007fce4d51a4bf llvm::LiveVariables::runOnMachineFunction(llvm::MachineFunction&) The bug can be reproduced with llvm12 and latest trunk as well. Futher analysis shows that there is a bug in BPF peephole TRUNC elimination optimization, which tries to remove unnecessary TRUNC operations (a <<= 32; a >>= 32). Specifically, the compiler did wrong transformation for the following patterns: %1 = LDW ... %2 = SLL_ri %1, 32 %3 = SRL_ri %2, 32 ... %3 ... %4 = SRA_ri %2, 32 ... %4 ... The current transformation did not check how many uses of %2 and did transformation like %1 = LDW ... ... %1 ... %4 = SRL_ri %2, 32 ... %4 ... and pseudo register %2 is used by not defined and caused LiveVariables analysis core dump. To fix the issue, when traversing back from SRL_ri to SLL_ri, check to ensure SLL_ri has only one use. Otherwise, don't do transformation. Differential Revision: https://reviews.llvm.org/D97792
-
Thomas Preud'homme authored
Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D97777
-
Greg McGary authored
This reverts diff D97610 (commit 0223ab03) and adds a one-line fix to verify that a `MemoryBufferRef` has sufficient length before reading a 4-byte magic number. Differential Revision: https://reviews.llvm.org/D97757
-
Amara Emerson authored
To do this while supporting the existing functionality in SelectionDAG of using PGO info, we add the ProfileSummaryInfo and LazyBlockFrequencyInfo analysis dependencies to the instruction selector pass. Then, use the predicate to generate constant pool loads for f32 materialization, if we're targeting optsize/minsize. Differential Revision: https://reviews.llvm.org/D97732
-