- Nov 13, 2020
-
-
Fangrui Song authored
Fixes PR48071 * The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which normally does not have the flag) * `.debug_gdb_scripts` sections are removed from `inputSections` due to --strip-debug/--strip-all * When processing --gc-sections, pieces of a SHF_MERGE section can be marked live separately `=>` segfault when marking liveness of a `.debug_gdb_scripts` which is not split into pieces (because it is not in `inputSections`) This patch circumvents the problem by not treating SHF_ALLOC ".debug*" as debug sections (to prevent --strip-debug's stripping) (which is still useful on its own). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D91291
-
Kevin P. Neal authored
As of D80952 we are disabling strict floating point on all hosts except those that are explicitly listed as supported. Use of strict floating point on other hosts requires use of the -fexperimental-strict-floating-point flag. This is to avoid bugs like "https://bugs.llvm.org/show_bug.cgi?id=45329" (which has an incorrect link in the previous review). In the review for D80952 I was asked to mark the -fexperimental option as a MarshallingInfoFlag. This patch does exactly that. Differential Revision: https://reviews.llvm.org/D88987
-
Sanjay Patel authored
-
Jamie Schmeiser authored
Reland: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source Summary: Expand the print-memoryssa and print<memoryssa> passes with a new hidden option -cfg-dot-mssa that names a file. When set, a dot-cfg style file will be generated into the named file with the memoryssa comments retained and those blocks containing them shown in light pink. The option does nothing in isolation. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By: asbirlea (Alina Sbirlea), dblaikie (David Blaikie) Differential Revision: https://reviews.llvm.org/D90638
-
Nico Weber authored
-
Alexander Kornienko authored
-
Simon Pilgrim authored
[ValueTracking] Update computeKnownBitsFromShiftOperator callbacks to take KnownBits shift amount. NFCI. We were creating this internally, but will need to support general KnownBits amounts as part of D90479.
-
Fangrui Song authored
Input sections `.ctors/.ctors.N` may go to either the output section `.init_array` or the output section `.ctors`: * output `.ctors`: currently we sort them by name. This patch changes to sort by priority from high to low. If N in `.ctors.N` is in the form of %05u, there is no semantic difference. Actually GCC and Clang do use %05u. (In the test `ctors_dtors_priority.s` and Gold's test `gold/testsuite/script_test_14.s`, we can see %03u, but they are not really produced by compilers.) * output `.init_array`: users can provide an input section description `SORT_BY_INIT_PRIORITY(.init_array.* .ctors.*)` to mix `.init_array.*` and `.ctors.*`. This can make .init_array.N and .ctors.(65535-N) interchangeable. With this change, users can mix `.ctors.N` and `.init_array.N` in `.init_array` (PR44698 and PR48096) with linker scripts. As an example: ``` SECTIONS { .init_array : { *(SORT_BY_INIT_PRIORITY(.init_array.* .ctors.*)) *(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors) } } INSERT AFTER .fini_array; SECTIONS { .fini_array : { *(SORT_BY_INIT_PRIORITY(.fini_array.* .dtors.*)) *(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors) } } INSERT BEFORE .init_array; ``` Reviewed By: psmith Differential Revision: https://reviews.llvm.org/D91187 -
Fangrui Song authored
According to https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html#Input-Section-Basics for `*(.a .b)`, the order should match the input order: * for `ld 1.o 2.o`, sections from 1.o precede sections from 2.o * within a file, `.a` and `.b` appear in the section header table order This patch implements the behavior. The interaction with `SORT*` and --sort-section is: Matched sections are ordered by radix sort with the keys being `(SORT*, --sort-section, input order)`, where `SORT*` (if present) is most significant. > Note, multiple `SORT*` within an input section description has undocumented and > confusing behaviors in GNU ld: > https://sourceware.org/pipermail/binutils/2020-November/114083.html > Therefore multiple `SORT*` is not the focus for this patch but > this patch still strives to have an explainable behavior. As an example, we partition `SORT(a.*) b.* c.* SORT(d.*)`, into `SORT(a.*) | b.* c.* | SORT(d.*)` and perform sorting within groups. Sections matched by patterns between two `SORT*` are sorted by input order. If --sort-alignment is given, they are sorted by --sort-alignment, breaking tie by input order. This patch also allows a section to be matched by multiple patterns, previously duplicated sections could occupy more space in the output and had erroneous zero bytes. The patch is in preparation for support for `*(SORT_BY_INIT_PRIORITY(.init_array.* .ctors.*)) *(.init_array .ctors)`, which will allow LLD to mix .ctors*/.init_array* like GNU ld (gold's --ctors-in-init-array) PR44698 and PR48096 Reviewed By: grimar, psmith Differential Revision: https://reviews.llvm.org/D91127
-
Fangrui Song authored
The second `SORT` in `*(SORT(...) SORT(...))` is incorrectly parsed as a file pattern. Fix the bug by stopping at `SORT*` in `readInputSectionsList`. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D91180
-
Baptiste Saleil authored
We want to allow using MMA on P10 CPU only. This patch prevents the use of MMA with the -mmma option on P9 CPUs and earlier. Differential Revision: https://reviews.llvm.org/D91200
-
Raphael Isemann authored
When I added TestAbortExitCode I actually planned this to be a generic test for the exit code functionality on POSIX systems. However due to all the different test setups we can have I don't think this worked out. Right now the test had to be made so permissive that it pretty much can't fail. Just to summarize, we would need to support the following situations: 1. ToT debugserver (on macOS) 2. lldb-server (on other platforms) 3. Any old debugserver version when using the system debugserver (on macOS) This patch is removing TestAbortExitCode and adds a ToT debugserver specific test that checks the patch that motivated the whole exit code testing. There is already an exit-code test for lldb-server from what I can see and 3) is pretty much untestable as we don't know anything about the system debugserver. Reviewed By: kastiglione Differential Revision: https://reviews.llvm.org/D89305
-
Zbigniew Sarbinowski authored
This patch is one part of many steps required to build libc++ and libc++abi libraries on z/OS. This particular deals with time related functions and consists of the following 3 parts. 1) Initialization of :timeval within libc++ library need to be adjusted to work on z/OS. The following is z/OS definition from time.h which includes additional aggregate member. typedef signed int suseconds_t; struct timeval { time_t tv_sec; char tv_usec_pad[4]; suseconds_t tv_usec; }; In contracts the following is definition from time.h on Linux. typedef long int __suseconds_t; struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; 2) In addition, retrieving ::timespec within libc++ library needs to be adjusted to compensate the difference of some of the members of ::stat depending of the target host. Here are the 2 members in conflict on z/OS extracted from stat.h. struct stat { ... time_t st_atime; time_t st_mtime; ... }; In contract here is Linux equivalent from stat.h. struct stat { ... struct timespec st_atim; struct timespec st_mtim; ... }; 3) On Linux both members are of type timespec whereas on z/OS an object of type timespec need to be constructed first before retrieving it within libc++ library. The libc++ header file __threading_support calls nanosleep, which is not available on z/OS. The equivalent functionality will be implemented by using both sleep() and usleep(). Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D87940 -
Simon Pilgrim authored
Helper for cases where we need to create a KnownBits from a (fully known) constant value.
-
- Nov 12, 2020
-
-
Anh Tuyen Tran authored
Revert "Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source" This reverts commit 45d459e7 due to build issue in Poly.
-
Craig Topper authored
-Use MCRegister instead of Register in MC layer. -Move some enums from RISCVInstrInfo.h to RISCVBaseInfo.h to be with other TSFlags bits. Differential Revision: https://reviews.llvm.org/D91114
-
Jamie Schmeiser authored
Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source Summary: Expand the print-memoryssa and print<memoryssa> passes with a new hidden option -cfg-dot-mssa that names a file. When set, a dot-cfg style file will be generated into the named file with the memoryssa comments retained and those blocks containing them shown in light pink. The option does nothing in isolation. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By: asbirlea (Alina Sbirlea), dblaikie (David Blaikie) Differential Revision: https://reviews.llvm.org/D90638
-
Craig Topper authored
The fshl and fshr intrinsics are defined to modulo their shift amount by the bitwidth of one of their inputs. The FSR/FSL instructions read one extra bit from the shift amount. If that bit is set the inputs are swapped. In order to preserve the semantics of the llvm intrinsics we need to make sure that the extra bit isn't set. DAG combine or instcombine may have removed any mask that was originally present. We could be smarter here and try to use computeKnownBits to check if the bit is known zero, but wanted to start with correctness. Differential Revision: https://reviews.llvm.org/D90905
-
Simon Pilgrim authored
[ValueTracking] Update computeKnownBitsFromShiftOperator callbacks to use KnownBits shift handling. NFCI.
-
Jamie Schmeiser authored
Summary: Add an option -print-before-changed that modifies the print-changed behaviour so that it prints the IR before a pass that changed it in addition to printing the IR after the pass. Note that the option does nothing in isolation. The filtering options work as expected. Lit tests are included. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By: aeubanks (Arthur Eubanks) Differential Revision: https://reviews.llvm.org/D88757
-
Raphael Isemann authored
This adds `expect_var_path` to test variable paths so we no longer have to use `frame var` and find substrs in the command output. The behaviour is identical with `expect_expr` (and it also uses the same checking backend), but it instead calls `GetValueForVariablePath` to evaluate the string as a variable path. Also rewrites a few of the tests that previously used `frame variable` to use `expect_var_path`. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D90450
-
Zhuojia Shen authored
This patch enables building compiler-rt builtins for ARM targets that only support single-precision floating point instructions (e.g., those with -mfpu=fpv4-sp-d16). This fixes PR42838 Differential Revision: https://reviews.llvm.org/D90698
-
Jamie Schmeiser authored
[NFC intended] Refactor SinkAndHoistLICMFlags to allow others to construct without exposing internals Summary: Refactor SinkAdHoistLICMFlags from a struct to a class with accessors and constructors to allow other classes to construct flags with meaningful defaults while not exposing LICM internal details. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By: asbirlea (Alina Sbirlea) Differential Revision: https://reviews.llvm.org/D90482
-
Paul C. Anagnostopoulos authored
-
Jean-Michel Gorius authored
-
Raphael Isemann authored
Also moves the curious isprint8 function (which was used to check whether we have a valid short option) into the struct and documents it.
-
Sylvain Audi authored
[clang-scan-deps] Fix for input file given as relative path in compilation database "command" entry. Differential Revision: https://reviews.llvm.org/D91204
-
David Green authored
Of course there was something missing, in this case a check that the def of the count register we are adding to a t2DoLoopStartTP would dominate the insertion point. In the future, when we remove some of these COPY's in between, the t2DoLoopStartTP will always become the last instruction in the block, preventing this from happening. In the meantime we need to check they are created in a sensible order. Differential Revision: https://reviews.llvm.org/D91287
-
Alexandre Ganea authored
-
Alexander Kornienko authored
-
Alexandre Ganea authored
This is a follow-up for D70378 (Cover usage of LLD as a library). While debugging an intermittent failure on a bot, I recalled this scenario which causes the issue: 1.When executing lld/test/ELF/invalid/symtab-sh-info.s L45, we reach lld::elf::Obj-File::ObjFile() which goes straight into its base ELFFileBase(), then ELFFileBase::init(). 2.At that point fatal() is thrown in lld/ELF/InputFiles.cpp L381, leaving a half-initialized ObjFile instance. 3.We then end up in lld::exitLld() and since we are running with LLD_IN_TEST, we hapily restore the control flow to CrashRecoveryContext::RunSafely() then back in lld::safeLldMain(). 4.Before this patch, we called errorHandler().reset() just after, and this attempted to reset the associated SpecificAlloc<ObjFile<ELF64LE>>. That tried to free the half-initialized ObjFile instance, and more precisely its ObjFile::dwarf member. Sometimes that worked, sometimes it failed and was catched by the CrashRecoveryContext. This scenario was the reason we called errorHandler().reset() through a CrashRecoveryContext. But in some rare cases, the above repro somehow corrupted the heap, creating a stack overflow. When the CrashRecoveryContext's filter (that is, __except (ExceptionFilter(GetExceptionInformation()))) tried to handle the exception, it crashed again since the stack was exhausted -- and that took the whole application down. That is the issue seen on the bot. Locally it happens about 1 times out of 15. Now this situation can happen anywhere in LLD. Since catching stack overflows is not a reliable scenario ATM when using CrashRecoveryContext, we're now preventing further re-entrance when such failures occur, by signaling lld::SafeReturn::canRunAgain=false. When running with LLD_IN_TEST=2 (or above), only one iteration will be executed, instead of two. Differential Revision: https://reviews.llvm.org/D88348
-
Michał Górny authored
Add a test verifying that after the 'watchpoint' command, new values of x86 debug registers can be read back correctly. The primary purpose of this test is to catch broken DRn reading and help debugging it. Differential Revision: https://reviews.llvm.org/D91264
-
Michał Górny authored
Fix Debug Register offsets to be specified relatively to UserArea on FreeBSD/amd64 and FreeBSD/i386, and add them to UserArea on i386. This fixes overlapping GPRs and DRs in gdb-remote protocol, making it impossible to correctly get and set debug registers from the LLDB client. Differential Revision: https://reviews.llvm.org/D91254
-
Raphael Isemann authored
This reverts commit 856fd98a. The type formatters use inline namespaces to find the formatter that fits the type ABI, so they can't just ignore the inline namespaces. The failing tests should be fixed by da121fff .
-
Raphael Isemann authored
Commit 5f12f4ff made suppressing inline namespaces when printing typenames default to true. As we're using the inline namespaces in LLDB to construct internal type names (which need internal namespaces in them to, for example, differentiate libc++'s std::__1::string from the std::string from libstdc++), this broke most of the type formatting logic.
-
Hans Wennborg authored
For dllexported default constructors with default arguments, we export default constructor closures which pass in the default args. (See D8331 for a good explanation.) For templates, that means those default args must be instantiated even if the function isn't called. That is done by the InstantiateDefaultCtorDefaultArgs() function, but it wasn't done for explicit specializations, causing asserts (see bug). Differential revision: https://reviews.llvm.org/D91089
-
Jean-Michel Gorius authored
The tokens are already handled by the lexer. This revision exposes them through the parser interface. This revision also adds missing functions for question mark parsing and completes the list of valid punctuation tokens in the documentation. Differential Revision: https://reviews.llvm.org/D90907
-
Hans Wennborg authored
[dllexport] Avoid assert for explicitly defaulted methods in explicit instantiation definitions (PR47683) Clang was asserting due to attempting to codegen such methods twice. Differential revision: https://reviews.llvm.org/D90849
-
Alex Zinenko authored
Add an ODS-backed generator of default builders. This currently does not support operation with attribute arguments, for which the builder is just ignored. Attribute support will be introduced separately for builders and accessors. Default builders are always generated with the same number of result and operand groups as the ODS specification, i.e. one group per each operand or result. Optional elements accept None but cannot be omitted. Variadic groups accept iterable objects and cannot be replaced with a single object. For some operations, it is possible to infer the result type given the traits, but most traits rely on inline pieces of C++ that we cannot (yet) forward to Python bindings. Since the Ops where the inference is possible (having the `SameOperandAndResultTypes` trait or `TypeMatchesWith` without transform field) are a small minority, they also require the result type to make the builder syntax more consistent. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D91190
-
Kazushi (Jam) Marukawa authored
Change the default type of v64 register class from v512i32 to v256f64. Add a regression test also. Reviewed By: simoll Differential Revision: https://reviews.llvm.org/D91301
-