- Aug 06, 2021
-
-
Whisperity authored
An otherwise unexercised code path related to trying to model "array-to-pointer decay" resulted in a null pointer dereference crash when parameters of type "reference to array" were encountered. Fixes crash report http://bugs.llvm.org/show_bug.cgi?id=50995. Reviewed By: aaron.ballman Differential Revision: http://reviews.llvm.org/D106946 (cherry picked from commit 21832121)
-
AndreyChurbanov authored
Fix for https://bugs.llvm.org/show_bug.cgi?id=49723. Eliminated references from task dependency hash to node allocated on stack, thus eliminated accesses to stale memory. So the node now never freed. Uncommented assertion which triggered when stale memory accessed. Removed unneeded ref count increment for stack allocated node. Differential Revision: https://reviews.llvm.org/D106705 (cherry picked from commit 8e29b4b3)
-
Pavel Asyutchenko authored
This matches the behavior of GCC. Patch does not change remapping logic itself, so adding one simple smoke test should be enough. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D107393 (cherry picked from commit 7df405e0)
-
Dimitry Andric authored
Fixes PR51331. On FreeBSD, the elf headers don't (yet) provide the ElfW(type) macro. However, there is a similar set of macros in the <sys/elf-generic.h> header, of which `__ElfN(type)` exactly matches the indended purpose. Reviewed By: gulfem Differential Revision: https://reviews.llvm.org/D107388 (cherry picked from commit 440d9712)
-
- Aug 05, 2021
-
-
Chris Jackson authored
SCEV-based salvaging in LSR translates SCEVs to DIExpressions. SCEVs may contain very large integers but the translation does not support integers greater than 64 bits. This patch adds checks to ensure conversions of these large integers is not attempted. A regression test is added to ensure no such translation is attempted. Reviewed by: StephenTozer PR: https://bugs.llvm.org/show_bug.cgi?id=51329 Differential Revision: https://reviews.llvm.org/D107438 (cherry picked from commit 21ee38e2)
-
Jeremy Morse authored
SCEVToIterCountExpr only expects to be fed affine expressions, but DbgRewriteSalvageableDVIs is feeding it non-affine induction variables. Following this up with an obvious fix, will add test coverage too if this avoids D105207 being reverted. (cherry picked from commit 2537120c)
-
Chris Jackson authored
Reapply commit d675b594 that was reverted due to buildbot failures. A simple fix has been applied to remove an assertion. Differential Revision: https://reviews.llvm.org/D105207 (cherry picked from commit 0ba85952)
-
Eli Friedman authored
(cherry picked from commit 6eb2ffba)
-
Eli Friedman authored
Target-dependent constant folding will fold these down to simple constants (or at least, expressions that don't involve a GEP). We don't need heroics to try to optimize the form of the expression before that happens. Fixes https://bugs.llvm.org/show_bug.cgi?id=51232 . Differential Revision: https://reviews.llvm.org/D107116 (cherry picked from commit 2a284782)
-
Nathan Chancellor authored
When running this test on an aarch64 machine, it fails: ``` /usr/bin/ld.gold: error: .../test/tools/gold/X86/Output/comdat-nodeduplicate.ll.tmp/ab.lto.o: incompatible target ``` Specify the elf_x86_64 emulation as all of the other gold plugin tests do. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D107020 (cherry picked from commit 5060224d)
-
Andy Kaylor authored
Patch by Mohammad Fawaz This issues started happening after https://github.com/llvm/llvm-project/commit/b373b5990d5991a920c421b21a352e4ccf4c4993 Basically, if the memcpy is volatile, the collectUsers() function should return false, just like we do for volatile loads. Differential Revision: https://reviews.llvm.org/D106950 (cherry picked from commit b4d945ba)
-
Jeroen Dobbelaere authored
This is a second attempt to fix the EXPENSIVE_CHECKS issue that was mentioned In D91661#2875179 by @jroelofs. (The first attempt was in D105983) D91661 more or less completely reverted D49126 and by doing so also removed the cleanup logic of the created declarations and calls. This patch is a replacement for D91661 (which must itself be reverted first). It replaces the custom declaration creation with the generic version and shows the test impact. It also tracks the number of NamedValues to detect if a new prototype was added instead of looking at the available users of a prototype. Reviewed By: jroelofs Differential Revision: https://reviews.llvm.org/D106147 (cherry picked from commit 03b8c69d)
-
Jeroen Dobbelaere authored
Revert "Revert of D49126 [PredicateInfo] Use custom mangling to support ssa_copy with unnamed types." This reverts commit 77080a1e. This change introduced issues detected with EXPENSIVE_CHECKS. Reverting to restore the needed function cleanup. A next patch will then just improve on the name mangling. (cherry picked from commit dc5570d1)
-
Sanjay Patel authored
I don't know much about this pass, but we need a stronger check on the memset length arg to avoid an assert. The current code was added with D59000. The test is reduced from: https://llvm.org/PR50910 Differential Revision: https://reviews.llvm.org/D106462 (cherry picked from commit f2a322bf)
-
Joseph Huber authored
Summary: Enabling internalization in the Attributor's CGSCC pass does something different that we don't expect. Ignore this for now to pass the tests. (cherry picked from commit 97851a08)
-
Joseph Huber authored
The current implementation of function internalization creats a copy of each function and replaces every use. This has the downside that the external versions of the functions will call into the internalized versions of the functions. This prevents them from being fully independent of eachother. This patch replaces the current internalization scheme with a method that creates all the copies of the functions intended to be internalized first and then replaces the uses as long as their caller is not already internalized. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D106931 (cherry picked from commit adbaa39d)
-
Fangrui Song authored
Due to an assembler design flaw (IMO), `.symver foo,foo@v1` produces two symbols `foo` and `foo@v1` if `foo` is defined. * `v1 {};` produces both `foo` and `foo@v1`, but GNU ld only produces `foo@v1` * `v1 { foo; };` produces both `foo@@v1` and `foo@v1`, but GNU ld only produces `foo@v1` * `v2 { foo; };` produces both `foo@@v2` and `foo@v1`, matching GNU ld. (Tested by symver.s) This patch implements the GNU ld behavior by reusing the symbol redirection mechanism in D92259. The new test symver-non-default.s checks the first two cases. Without the patch, the second case will produce `foo@v1` and `foo@@v1` which looks weird and makes foo unnecessarily default versioned. Note: `.symver foo,foo@v1,remove` exists but the unfortunate `foo` will not go away anytime soon. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D107235 -
Fangrui Song authored
Currently version script patterns are ignored for .symver produced non-default version (single @) symbols. This makes such symbols not localizable by `local:`, e.g. ``` .symver foo3_v1,foo3@v1 .globl foo_v1 foo3_v1: ld.lld --version-script=a.ver -shared a.o # In a.out, foo3@v1 is incorrectly exported. ``` This patch adds the support: * Move `config->versionDefinitions[VER_NDX_LOCAL].patterns` to `config->versionDefinitions[versionId].localPatterns` * Rename `config->versionDefinitions[versionId].patterns` to `config->versionDefinitions[versionId].nonLocalPatterns` * Allow `findAllByVersion` to find non-default version symbols when `includeNonDefault` is true. (Note: `symtab` keys do not have `@@`) * Make each pattern check both the unversioned `pat.name` and the versioned `${pat.name}@${v.name}` * `localPatterns` can localize `${pat.name}@${v.name}`. `nonLocalPatterns` can prevent localization by assigning `verdefIndex` (before `parseSymbolVersion`). --- If a user notices new `undefined symbol` errors with a version script containing `local: *;`, the issue is likely due to a missing `global:` pattern. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D107234 -
Fangrui Song authored
And delete redundant tests.
-
Fangrui Song authored
GNU ld doesn't support multiple SHF_TLS SHT_NOBITS output sections (it restores the address after an SHF_TLS SHT_NOBITS section, so consecutive SHF_TLS SHT_NOBITS sections will have conflicting address ranges). That said, `threadBssOffset` implements limited support for consecutive SHF_TLS SHT_NOBITS sections. (SHF_TLS SHT_PROGBITS following a SHF_TLS SHT_NOBITS can still be incorrect.) `.` in an output section description of an SHF_TLS SHT_NOBITS section is incorrect. (https://lists.llvm.org/pipermail/llvm-dev/2021-July/151974.html) This patch saves the end address of the previous tbss section in `ctx->tbssAddr`, changes `dot` in the beginning of `assignOffset` so that `.` evaluation will be correct. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D107208 (cherry picked from commit 9bd29a73)
-
- Aug 04, 2021
-
-
Fangrui Song authored
On ELF, an SHT_INIT_ARRAY outside a section group is a GC root. The current codegen abuses SHT_INIT_ARRAY in a section group to mean a GC root. On PE/COFF, the dynamic initialization for `__declspec(selectany)` in a comdat can be garbage collected by `-opt:ref`. Call `addUsedGlobal` for the two cases to fix the abuse/bug. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D106925 (cherry picked from commit 828767f3)
-
- Aug 03, 2021
-
-
Cullen Rhodes authored
Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D106853
-
Muhammad Omair Javaid authored
This patch updates LLVM release notes to add a announcement about AArch64 SVE, PAC and LLDB prebuilt binary.
-
David Spickett authored
-
David Spickett authored
The "memory tag read" command will now tell you when the allocation tag read does not match the logical tag. (lldb) memory tag read mte_buf+(8*16) mte_buf+(8*16)+48 Logical tag: 0x9 Allocation tags: [0xfffff7ff7080, 0xfffff7ff7090): 0x8 (mismatch) [0xfffff7ff7090, 0xfffff7ff70a0): 0x9 [0xfffff7ff70a0, 0xfffff7ff70b0): 0xa (mismatch) The logical tag will be taken from the start address so the end could have a different tag. You could for example read from ptr_to_array_1 to ptr_to_array_2. Where the latter is tagged differently to prevent buffer overflow. The existing command will read 1 granule if you leave off the end address. So you can also use it as a quick way to check a single location. (lldb) memory tag read mte_buf Logical tag: 0x9 Allocation tags: [0xfffff7ff7000, 0xfffff7ff7010): 0x0 (mismatch) This avoids the need for a seperate "memory tag check" command. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D106880 (cherry picked from commit 98b5659b)
-
David Spickett authored
The type field is a signed integer. (https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html) However it's not packed in the packet in the way you might think. For example the type -1 should be: qMemTags:<addr>,<len>:ffffffff Instead of: qMemTags:<addr>,<len>:-1 This change makes lldb-server's parsing more strict and adds more tests to check that we handle negative types correctly in lldb and lldb-server. We only support one tag type value at this point, for AArch64 MTE, which is positive. So this doesn't change any of those interactions. It just brings us in line with GDB. Also check that the test target has MTE. Previously we just checked that we were AArch64 with a toolchain that supports MTE. Finally, update the tag type check for QMemTags to use the same conversion steps that qMemTags now does. Using static_cast can invoke UB and though we do do a limit check to avoid this, I think it's clearer with the new method. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D104914 (cherry picked from commit 555cd031)
-
David Spickett authored
In the latest Linux kernels synchronous tag faults include the tag bits in their address. This change adds logical and allocation tags to the description of synchronous tag faults. (asynchronous faults have no address) Process 1626 stopped * thread #1, name = 'a.out', stop reason = signal SIGSEGV: sync tag check fault (fault address: 0x900fffff7ff9010 logical tag: 0x9 allocation tag: 0x0) This extends the existing description and will show as much as it can on the rare occasion something fails. This change supports AArch64 MTE only but other architectures could be added by extending the switch at the start of AnnotateSyncTagCheckFault. The rest of the function is generic code. Tests have been added for synchronous and asynchronous MTE faults. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D105178 (cherry picked from commit d510b5f1)
-
David Spickett authored
The default mode of "memory tag write" is to calculate the range from the start address and the number of tags given. (just like "memory write" does) (lldb) memory tag write mte_buf 1 2 (lldb) memory tag read mte_buf mte_buf+48 Logical tag: 0x0 Allocation tags: [0xfffff7ff9000, 0xfffff7ff9010): 0x1 [0xfffff7ff9010, 0xfffff7ff9020): 0x2 [0xfffff7ff9020, 0xfffff7ff9030): 0x0 This new option allows you to set an end address and have the tags repeat until that point. (lldb) memory tag write mte_buf 1 2 --end-addr mte_buf+64 (lldb) memory tag read mte_buf mte_buf+80 Logical tag: 0x0 Allocation tags: [0xfffff7ff9000, 0xfffff7ff9010): 0x1 [0xfffff7ff9010, 0xfffff7ff9020): 0x2 [0xfffff7ff9020, 0xfffff7ff9030): 0x1 [0xfffff7ff9030, 0xfffff7ff9040): 0x2 [0xfffff7ff9040, 0xfffff7ff9050): 0x0 This is implemented using the QMemTags packet previously added. We skip validating the number of tags in lldb and send them on to lldb-server, which repeats them as needed. Apart from the number of tags, all the other client side checks remain. Tag values, memory range must be tagged, etc. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D105183 (cherry picked from commit 6eded00e)
-
David Spickett authored
This adds a new command for writing memory tags. It is based on the existing "memory write" command. Syntax: memory tag write <address-expression> <value> [<value> [...]] (where "value" is a tag value) (lldb) memory tag write mte_buf 1 2 (lldb) memory tag read mte_buf mte_buf+32 Logical tag: 0x0 Allocation tags: [0xfffff7ff9000, 0xfffff7ff9010): 0x1 [0xfffff7ff9010, 0xfffff7ff9020): 0x2 The range you are writing to will be calculated by aligning the address down to a granule boundary then adding as many granules as there are tags. (a repeating mode with an end address will be in a follow up patch) This is why "memory tag write" uses MakeTaggedRange but has some extra steps to get this specific behaviour. The command does all the usual argument validation: * Address must evaluate * You must supply at least one tag value (though lldb-server would just treat that as a nop anyway) * Those tag values must be valid for your tagging scheme (e.g. for MTE the value must be > 0 and < 0xf) * The calculated range must be memory tagged That last error will show you the final range, not just the start address you gave the command. (lldb) memory tag write mte_buf_2+page_size-16 6 (lldb) memory tag write mte_buf_2+page_size-16 6 7 error: Address range 0xfffff7ffaff0:0xfffff7ffb010 is not in a memory tagged region (note that we do not check if the region is writeable since lldb can write to it anyway) The read and write tag tests have been merged into a single set of "tag access" tests as their test programs would have been almost identical. (also I have renamed some of the buffers to better show what each one is used for) Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D105182 (cherry picked from commit 6a7a2ee8)
-
Matheus Izvekov authored
When substitution failed on the first constrained template argument (but only the first), we would assert / crash. Checking for failure was only being performed from the second constraint on. This changes it so the checking is performed in that case, and the code is also now simplified a little bit to hopefully avoid this confusion. Signed-off-by:
Matheus Izvekov <mizvekov@gmail.com> Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D106907
-
Markus Böck authored
The `DataLayout` class currently contains the member `layoutStack` which is hidden behind a preprocessor region dependant on the NDEBUG macro. Code wise this makes a lot of sense, as the `layoutStack` is used for extra assertions that users will want when compiling a debug build. It however has the uncomfortable consequence of leading to a different ABI in Debug and Release builds. This I think is a bit annoying for downstream projects and others as they may want to build against a stable Release of MLIR in Release mode, but be able to debug their own project depending on MLIR. This patch changes the related uses of NDEBUG to LLVM_ENABLE_ABI_BREAKING_CHECKS. As the macro is computed at configure time of LLVM, it may not change based on compiler settings of a downstream projects like NDEBUG would. Differential Revision: https://reviews.llvm.org/D107227 (cherry picked from commit 97335ad1)
-
Sanjay Patel authored
The check for size_t parameter 1 was already here for snprintf_chk, but it wasn't applied to regular snprintf. This could lead to mismatching and eventually crashing as shown in: https://llvm.org/PR50885 (cherry picked from commit 7f555577)
-
Jose M Monsalve Diaz authored
When using `-DLLVM_ENABLED_RUNTIMES` instead of `-DLLVM_ENABLED_PROJECTS` the `llvm-omp-device-info` tool is not compiled or installed. In general, no llvm tool would be build on runtimes, because the -DLLVM_BUILD_TOOLS flag is removed by the way runtimes compilation calls cmake again. This patch is simple. Just forward the value of this flag to the runtime cmake command. I'm also removing an unnecessary comment in the compilation of the tool Differential Revision: https://reviews.llvm.org/D107177 (cherry picked from commit 5424ceed)
-
Simon Pilgrim authored
(cherry picked from commit 6569b7f9)
-
Dmitry Vyukov authored
This reverts commit 5d1df6d2. There is a strong objection to this change: https://reviews.llvm.org/D106436#2905618 Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D106847 (cherry picked from commit 440e936c)
-
Tom Stellard authored
This reverts commit ae6b4000. llvm.org/PR51300
-
Sanjay Patel authored
This transform was added with D58874, but there were no tests for overflow ops. We need to change this one way or another because it can crash as shown in: https://llvm.org/PR51238 Note that if there are no uses of an overflow op's bool overflow result, we reduce it to a regular math op, so we continue to fold that case either way. If we have uses of both the math and the overflow bool, then we are likely not saving anything by creating an independent sub instruction as seen in the test diffs here. This patch makes the behavior in SDAG consistent with what we do in instcombine AFAICT. Differential Revision: https://reviews.llvm.org/D106983 (cherry picked from commit fa6b2c99)
-
Sanjay Patel authored
There's a generic combine for these, but no test coverage. It's not clear if this is actually a good fold. The combine was added with D58874, but it has a bug that can cause crashing ( https://llvm.org/PR51238 ). (cherry picked from commit e427077e)
-
Sanjay Patel authored
This transform was added with e38b7e89 and as shown in: https://llvm.org/PR51241 ...it could crash without an extra check of the blocks. There might be a more compact way to write this constraint, but we can't just count the successors/predecessors without affecting a test that includes a switch instruction. (cherry picked from commit 5b83261c)
-
Craig Topper authored
The sign_extend we insert here can get turned into a zero_extend if the sign bit is known zero. This can enable a setcc combine that shrinks compares with zero_extend. This reduces the use count of the zero_extend allowing other combines to turn it back into an any_extend. This restricts the combine to only cases where the result is used by a CopyToReg. This works for my original motivating case. I hope the CopyToReg use will prevent any converted extends from turning back into an any_extend. Reviewed By: luismarques Differential Revision: https://reviews.llvm.org/D106754 (cherry picked from commit 54588bcc)
-