aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
* Merge llvm-project 12.0.0 releaseDimitry Andric2021-12-251-1/+1
| | | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release. PR: 255570 MFC after: 6 weeks (cherry picked from commit d409305fa3838fb39b38c26fc085fb729b8766d5)
* Merge llvm-project main llvmorg-12-init-17869-g8e464dd76befDimitry Andric2021-12-25383-5080/+12370
| | | | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the upstream release/12.x branch was created. PR: 255570 MFC after: 6 weeks (cherry picked from commit e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2021-12-221-0/+0
| | | | | | | | | release/11.x llvmorg-11.0.1-rc2-0-g43ff75f2c3f (aka 11.0.1 rc2). MFC after: 4 weeks X-MFC-With: r364284 (cherry picked from commit eaeb601bd6a77b1f1c0889df45693d8c602e4863)
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2021-12-224-19/+12
| | | | | | | | | release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. MFC after: 6 weeks X-MFC-With: r364284 (cherry picked from commit 16d6b3b3da62aa5baaf3c66c8d4e6f8c8f70aeb7)
* Add atomic and bswap functions to libcompiler_rtDimitry Andric2021-12-221-2/+2
| | | | | | | | | | | | | | | | | | | | | There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26159 (cherry picked from commit 46c8c5540fe4995e01fcf2e173c05761e7ba9488)
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2021-12-221-3/+3
| | | | | | release/11.x llvmorg-11.0.0-rc1-47-gff47911ddfc. (cherry picked from commit 1106035d5bec5d667e553508a88e1012a89b67d3)
* r356104 | jhibbits | 2019-12-27 00:06:28 +0100 (Fri, 27 Dec 2019) | 25 linesDimitry Andric2021-12-221-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | [PowerPC] enable atomic.c in compiler_rt and do not check and forces lock/lock_free decisions in compiled time Summary: Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime decision about lock/lock_free. At compiling time, if clang can't decide if atomic operation can be lock free, it emits calls to external functions like `__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and `__atomic_always_lock_free`, postponing decision to a runtime check. According to LLVM code documentation, the mechanism exists due to differences between x86_64 processors that can't be decided at runtime. On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock free, so we force the decision at compile time and avoid having to implement it in an external library. This patch was made after 32 bit users testing the PowePC32 bit ISO reported llvm could not be compiled with in-base llvm due to `__atomic_load8` not implemented. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits, dim Differential Revision: https://reviews.freebsd.org/D22549 (cherry picked from commit 0faeaeed40a4c42a778a088cbdad0bc54468eef4)
* Reapply r354347 (by cem):Dimitry Andric2021-12-221-1/+16
| | | | | | | | | | | | | | | | | | | | | Fix llvm-libunwind userspace build on ARM GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or EHABI or whatever it's called. Export the same ones from LLVM-libunwind's libgcc_s, on ARM. As part of this, convert libgcc_s from a direct Version.map to one constructed from component Symbol.map files. This allows the ARM-specific Symbol.map to be included only on ARM. Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match non-ARM definitions and ARM-specific expectations in libcxxrt / libcompiler_rt. No functional change intended for non-ARM architectures. This commit does not actually flip the switch for ARM defaults from libgcc to llvm-libunwind, but makes it possible (to compile, anyway). (cherry picked from commit 998a72c55d958bcc1869628318477532dc6e1ffa)
* Reapply r329859 (partially, by imp):Dimitry Andric2021-12-221-0/+4
| | | | | | | | | | | Do not include float interfaces when using libsa. We don't support float in the boot loaders, so don't include interfaces for float or double in systems headers. In addition, take the unusual step of spiking double and float to prevent any more accidental seepage. (cherry picked from commit 8630bfad40a427d0ab21d9f051c876480ad15dc2)
* Undo r230021 again, further shrinking the diff against upstream.Dimitry Andric2021-12-221-23/+0
| | | | | | | | | | This revision worked around an endless recursion when compiling clzdi2.c and ctzdi2.c with gcc, upstream landed a different workaround for this in https://reviews.llvm.org/rL324593, which is effective enough. Noticed by: jrtc27 (cherry picked from commit 876f11703dabed6f07d9d7352ceb996c5ffc407f)
* Reapply r326600 (by imp):Dimitry Andric2021-12-221-1/+5
| | | | | | | | | | | Since this is contrib code, create an upstreamable version of my change. Now on FreeBSD and NetBSD if _STANDALONE is defined, we include the kernel version with alloances for the quirky differences between the two. Sponsored by: Netflix (cherry picked from commit dd6565b7a60d228f021190a538caeb652275dc5c)
* Reapply r322168 (partially, by br):Dimitry Andric2021-12-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Replace __riscv__ with __riscv o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 (cherry picked from commit fd28fec2f0ba63a68ca0c9a041facc4fd86f4ba8)
* Reapply r230021, r276851 and a few other commits to compiler-rtDimitry Andric2021-12-221-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reapply r230021 (by ed): Add a workaround to prevent endless recursion in compiler-rt. SPARC and MIPS CPUs don't have special instructions to count leading/trailing zeroes. The compiler-rt library provides fallback rountines for these. The 64-bit routines, __clzdi2 and __ctzdi2, are implemented as simple wrappers around the compiler built-in __builtin_clz(), assuming these will expand to either 32-bit CPU instructions or calls to __clzsi2 and __ctzsi2. Unfortunately, our GCC 4.2 probably thinks that because the operand is stored in a 64-bit register, it might just be a better idea to invoke its 64-bit equivalent, simply resulting into endless recursion. Fix this by defining __builtin_clz and __builtin_ctz to __clzsi2 and __ctzsi2 explicitly. Reapply r276851: Update compiler-rt to trunk r224034. This brings a number of new builtins, and also the various sanitizers. Support for these will be added in a later commit. (cherry picked from commit 71daeec70a15871cfc0071321cd1e819399aa911)
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2021-12-221-53/+50
| | | | | | release/11.x llvmorg-11-init-20933-g3c1fca803bc. (cherry picked from commit 590d96feea75246dee213cb528930df8f6234b87)
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2021-12-22295-3563/+8222
| | | | | | | | | | | master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. Note that for now, I rolled back all our local changes to make merging easier, and I will reapply the still-relevant ones after updating to 11.0.0-rc1. (cherry picked from commit 5ffd83dbcc34f10e07f6d3e968ae6365869615f4)
* MFC r364753:Dimitry Andric2020-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC r365509: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. MFC r365588: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 Notes: svn path=/stable/12/; revision=365661
* Revert r365471 as it is breaking with old gcc on various arches:Dimitry Andric2020-09-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Notes: svn path=/stable/12/; revision=365472
* MFC r364753:Dimitry Andric2020-09-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Notes: svn path=/stable/12/; revision=365471
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2020-07-244-21/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). MFC r359582 (by emaste): lldb: use lua as the default script language In the FreeBSD base system we do not have Python support in lldb, but will have Lua support. Make Lua the default. This needs to be made into a configure-time option; that is being discussed upstream and will appear in a future lldb import. For now carry this change as a tiny patch to our copy of lldb. MFC r359599 (by emaste): lldb: add rule to generate LLDBWrapLua.cpp Building lldb's lua/python bindings requires swig, but we do not want to include it in the FreeBSD base system (as a build tool) because it has non-trivial dependencies. As a workaround, add a make rule to generate LLDBWrapLua.cpp, and we will commit the generated file. Requires the swig30 package. Reviewed by: brooks Discussed with: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24265 MFC r359600 (by emaste): lldb: commit generated LLDBWrapLua.cpp MFC r359606 (by emaste): lldb: build and enable lua script bindings Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24266 MFC r360697: In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error: unsupported relocation on symbol" when assembling arm 'adr' pseudo instructions. However, the upstream commit did not take big-endian arm into account. Applying the same changes to the big-endian handling is straightforward, thanks to Andrew Turner and Peter Smith for the hint. This will also be submitted upstream. MFC r360702: Merge commit 4ca2cad94 from llvm git (by Justin Hibbits): [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF Summary: Change the default ABI to be compatible with GCC. For 32-bit ELF targets other than Linux, Clang now returns small structs in registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no change for 32-bit Linux, where Clang continues to return all structs in memory. Add clang options -maix-struct-return (to return structs in memory) and -msvr4-struct-return (to return structs in registers) to be compatible with gcc. These options are only for PPC32; reject them on PPC64 and other targets. The options are like -fpcc-struct-return and -freg-struct-return for X86_32, and use similar code. To actually return a struct in registers, coerce it to an integer of the same size. LLVM may optimize the code to remove unnecessary accesses to memory, and will return i32 in r3 or i64 in r3:r4. Fixes PR#40736 Patch by George Koehler! Reviewed By: jhibbits, nemanjai Differential Revision: https://reviews.llvm.org/D73290 Requested by: jhibbits MFC r361410: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc1-0-gf79cd71e145 (aka 10.0.1 rc1). MFC r362235 (by kp): llvm: Default to -mno-relax on RISC-V Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax'. Our default linker (ld.lld) doesn't support relaxation, so default to no-relax so we don't generate object files the linker can't handle. Reviewed by: mhorne Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25210 MFC r362445: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are still pending). MFC r362587 (by cem): Add WITH_CLANG_FORMAT option clang-format is enabled conditional on either WITH_CLANG_EXTRAS or WITH_CLANG_FORMAT. Some sources in libclang are build conditional on either rule, and obviously the clang-format binary itself depends on the rule. clang-format could still use a manual page. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D25427 MFC r362609: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-129-gd24d5c8e308. Getting closer to 10.0.1-rc2. MFC r362679: Regenerate ReStructuredText based manpages for llvm-project tools: * bugpoint.1 * clang.1 * llc.1 * lldb.1 * lli.1 * llvm-ar.1 * llvm-as.1 * llvm-bcanalyzer.1 * llvm-cov.1 * llvm-diff.1 * llvm-dis.1 * llvm-dwarfdump.1 * llvm-extract.1 * llvm-link.1 * llvm-mca.1 * llvm-nm.1 * llvm-pdbutil.1 * llvm-profdata.1 * llvm-symbolizer.1 * llvm-tblgen.1 * opt.1 Add newly generated manpages for: * llvm-addr2line.1 (this is an alias of llvm-symbolizer) * llvm-cxxfilt.1 * llvm-objcopy.1 * llvm-ranlib.1 (this is an alias of llvm-ar) Note that llvm-objdump.1 is an exception, as upstream has both a plain .1 file, and a .rst variant. These will have to be reconciled upstream first. MFC r362680: Follow-up to r362679, add more entries to OptionalObsoleteFiles.inc MFC r362719: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc2-0-g77d76b71d7d. Also add a few more llvm utilities under WITH_CLANG_EXTRAS: * llvm-dwp, a utility for merging DWARF 5 Split DWARF .dwo files into .dwp (DWARF package files) * llvm-size, a size(1) replacement * llvm-strings, a strings(1) replacement MFC r362733: Remove older llvm-ranlib.1 entry from ObsoleteFiles.inc, as it has gotten its own manpage now, and should be no longer be removed by "make delete-old". MFC r362734: Fix llvm-strings.1 not installing, this was a copy/paste error. MFC r363401: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). There were no changes since rc2, except in the upstream regression tests, which we do not ship. Relnotes: yes Notes: svn path=/stable/12/; revision=363494
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2020-05-01420-3834/+7110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10.0.0 release. MFC r356479 (by bdragon): [PowerPC] Fix libllvmminimal build when building from powerpc64 ELFv1. When bootstrapping on powerpc64 ELFv1, it is necessary to use binutils ld.bfd from ports for the bootstrap, as this is the only modern linker for ELFv1 host tools. As binutils ld.bfd is rather strict in its handling of undefined symbols, it is necessary to pull in Support/Atomic.cpp to avoid an undefined symbol. Reviewed by: dim, emaste Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23072 MFC r356930: Add more Subversion mergeinfo bootstrap information, to hopefully increase the probability of merging in vendor changes. MFC r358408 (by brooks): Merge commit 7214f7a79 from llvm git (by Sam Elliott): [RISCV] Lower llvm.trap and llvm.debugtrap Summary: Until this commit, these have lowered to a call to abort(). `llvm.trap()` now lowers to `unimp`, which should trap on all systems. `llvm.debugtrap()` now lowers to `ebreak`, which is exactly what this instruction is for. Reviewers: asb, luismarques Reviewed By: asb Tags: #llvm Differential Revision: https://reviews.llvm.org/D69390 This fixes miscompilation resulting in linking failures with INVARIANTS disabled. Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D23857 MFC r358851: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.0-rc3 c290cb61fdc. Release notes for llvm, clang, lld and libc++ 10.0.0 will become available here: https://releases.llvm.org/10.0.0/docs/ReleaseNotes.html https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html https://releases.llvm.org/10.0.0/projects/libcxx/docs/ReleaseNotes.html PR: 244251 MFC r358854: Add one additional file to libllvmminimal, to help the ppc64 bootstrap. Reported by: bdragon PR: 244251 MFC r358857: Move another file in libllvm from sources required for world, to sources required for bootstrap, as the PowerPC builds need this. Reported by: bdragon PR: 244251 MFC r358907: Allow -DNO_CLEAN build across r358851. The openmp 10.0.0 import renamed one .c file to .cpp, and this is something our dependency system does not handle correctly. Add another ad-hoc cleanup to get rid of the stale dependency. PR: 244251 MFC r358909 (by emaste): Extend r358907 to explicitly remove stale lib32 dependency After r325072 stale lib32 dependencies were not remooved. A more holistic approach is needed to address this but for the immediate issue (-DNO_CLEAN builds across r358851) just readd the explicit lib32 path. Reported by: dim Sponsored by: The FreeBSD Foundation MFC r358910 (by emaste): Makefile.inc1: move dependency hack comment to the block it applies to MFC r359035 (by emaste): Makefile.inc1: add a note when deleting stale dependencies We have ad-hoc stale dependency handling in Makefile.inc1 to handle the cases where file extensions change, but it appears that some cases are not functional. Add a note when about to clean stale deps to help when investigating failure reports. Sponsored by: The FreeBSD Foundation MFC r359082: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-rc4-5-g52c365aa9ca. The actual release should follow Real Soon Now. PR: 244251 MFC after: 6 weeks MFC r359083 (by emaste): invoke _cleanobj_fast_depend_hack unconditionally Apparently make ${CLEANDIR} is leaving stale entries in .depend files; for now invoke the hacky cleanup in both the -DNO_CLEAN and normal (no -DNO_CLEAN) cases. In collaboration with: dim Sponsored by: The FreeBSD Foundation MFC r359084: Merge commit 00925aadb from llvm git (by Fangrui Song): [ELF][PPC32] Fix canonical PLTs when the order does not match the PLT order Reviewed By: Bdragon28 Differential Revision: https://reviews.llvm.org/D75394 This is needed to fix miscompiled canonical PLTs on ppc32/lld10. Requested by: bdragon Differential Revision: https://reviews.freebsd.org/D24109 MFC r359085: Merge commit 315f8a55f from llvm git (by Fangrui Song): [ELF][PPC32] Don't report "relocation refers to a discarded section" for .got2 Similar to D63182 [ELF][PPC64] Don't report "relocation refers to a discarded section" for .toc Reviewed By: Bdragon28 Differential Revision: https://reviews.llvm.org/D75419 This is needed to fix compile errors when building for ppc32/lld10. Requested by: bdragon Differential Revision: https://reviews.freebsd.org/D24110 MFC r359086: Merge commit b8ebc11f0 from llvm git (by Sanjay Patel): [EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083) As discussed in PR41083: https://bugs.llvm.org/show_bug.cgi?id=41083 ...we can assert/crash in EarlyCSE using the current hashing scheme and instructions with flags. ValueTracking's matchSelectPattern() may rely on overflow (nsw, etc) or other flags when detecting patterns such as min/max/abs composed of compare+select. But the value numbering / hashing mechanism used by EarlyCSE intersects those flags to allow more CSE. Several alternatives to solve this are discussed in the bug report. This patch avoids the issue by doing simple matching of min/max/abs patterns that never requires instruction flags. We give up some CSE power because of that, but that is not expected to result in much actual performance difference because InstCombine will canonicalize these patterns when possible. It even has this comment for abs/nabs: /// Canonicalize all these variants to 1 pattern. /// This makes CSE more likely. (And this patch adds PhaseOrdering tests to verify that the expected transforms are still happening in the standard optimization pipelines. I left this code to use ValueTracking's "flavor" enum values, so we don't have to change the callers' code. If we decide to go back to using the ValueTracking call (by changing the hashing algorithm instead), it should be obvious how to replace this chunk. Differential Revision: https://reviews.llvm.org/D74285 This fixes an assertion when building the math/gsl port on PowerPC64. Requested by: pkubja MFC r359087: Merge commit 585a3cc31 from llvm git (by me): Fix -Wdeprecated-copy-dtor and -Wdeprecated-dynamic-exception-spec warnings. Summary: The former are like: libcxx/include/typeinfo:322:11: warning: definition of implicit copy constructor for 'bad_cast' is deprecated because it has a user-declared destructor [-Wdeprecated-copy-dtor] virtual ~bad_cast() _NOEXCEPT; ^ libcxx/include/typeinfo:344:11: note: in implicit copy constructor for 'std::bad_cast' first required here throw bad_cast(); ^ Fix these by adding an explicitly defaulted copy constructor. The latter are like: libcxx/include/codecvt:105:37: warning: dynamic exception specifications are deprecated [-Wdeprecated-dynamic-exception-spec] virtual int do_encoding() const throw(); ^~~~~~~ Fix these by using the _NOEXCEPT macro instead. Reviewers: EricWF, mclow.lists, ldionne, #libc Reviewed By: EricWF, #libc Subscribers: dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D76150 This is because we use -Wsystem-headers during buildworld, and the two warnings above are now triggered by default with clang 10, preventing most C++ code from compiling without NO_WERROR. Requested by: brooks Differential Revision: https://reviews.freebsd.org/D24049 MFC r359089 (by emaste): Revert r359083, fixed properly by r359088 r359083 introduced a workaround for stale libomp dependencies during a regular (no -DNO_CLEAN) buildworld. r359088 addressed the reason the clean step missed libomp, so revert the workaround. Sponsored by: The FreeBSD Foundation MFC r359333: Merge commit f0990e104 from llvm git (by Justin Hibbits): [PowerPC]: e500 target can't use lwsync, use msync instead The e500 core has a silicon bug that triggers an illegal instruction program trap on any sync other than msync. Other cores will typically ignore illegal sync types, and the documentation even implies that the 'illegal' bits are ignored. Address this hardware deficiency by only using msync, like the PPC440. Differential Revision: https://reviews.llvm.org/D76614 Requested by: jhibbits MFC r359334: Merge commit 459e8e948 from llvm git (by Justin Hibbits): [PowerPC]: Don't allow r0 as a target for LD_GOT_TPREL_L/32 Summary: The linker is free to relax this (relocation R_PPC_GOT_TPREL16) against R_PPC_TLS, if it sees fit (initial exec to local exec). If r0 is used, this can generate execution-invalid code (converts to 'addi %rX, %r0, FOO, which translates in PPC-lingo to li %rX, FOO). Forbid this instead. This fixes static binaries using locales on FreeBSD/powerpc (tested on FreeBSD/powerpcspe). Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D76662 Requested by: jhibbits MFC r359338: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-0-gd32170dbd5b (aka 10.0.0 release). PR: 244251 MFC r359506 (by emaste): lldb: stop excluding bindings/ subdir With liblua in the tree we should be able to enable lldb's lua scripting. We'll need the files in bindings/, so start by allowing them to come in with the next import. Approved by: dim Sponsored by: The FreeBSD Foundation MFC r359578: Merge once more from ^/vendor/llvm-project/release-10.x, to get the lldb/bindings directory, which will be used to provide lua bindings for lldb. Requested by: emaste MFC r359826: Merge commit 30588a739 from llvm git (by Erich Keane): Make target features check work with ctor and dtor- The problem was reported in PR45468, applying target features to an always_inline constructor/destructor runs afoul of GlobalDecl construction assert when checking for target-feature compatibility. The core problem is fixed by using the version of the check that takes a FunctionDecl rather than the GlobalDecl. However, while writing the test, I discovered that source locations weren't properly set for this check on ctors/dtors. This patch also fixes constructors and CALLED destructors. Unfortunately, it doesn't seem too possible to get a meaningful source location for a 'cleanup' destructor, so those are still 'frontend' level errors unfortunately. A fixme was added to the test to cover that situation. This should fix 'Assertion failed: (!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"), function Init, file /usr/src/contrib/llvm-project/clang/include/clang/AST/GlobalDecl.h, line 45' when compiling the security/botan2 port. PR: 245550 MFC r359981: Revert commit a9ad65a2b from llvm git (by Nemanja Ivanovic): [PowerPC] Change default for unaligned FP access for older subtargets This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40554 Some CPU's trap to the kernel on unaligned floating point access and there are kernels that do not handle the interrupt. The program then fails with a SIGBUS according to the PR. This just switches the default for unaligned access to only allow it on recent server CPUs that are known to allow this. Differential revision: https://reviews.llvm.org/D71954 This upstream commit causes a compiler hang when building certain ports (e.g. security/nss, multimedia/x264) for powerpc64. The hang has been reported in https://bugs.llvm.org/show_bug.cgi?id=45186, but in the mean time it is more convenient to revert the commit. Requested by: jhibbits MFC r359994: Revert commit b6cf400aa fro llvm git (by Nemanja Ivanovic): Fix bots after a9ad65a2b34f In the last commit, I neglected to initialize the new subtarget feature I added which caused failures on a few bots. This should fix that. This unbreaks the build after r359981, which reverted upstream commit a9ad65a2b34f. Reported by: jhibbits (and jenkins :) MFC r360129: Merge commit ce5173c0e from llvm git (by Reid Kleckner): Use FinishThunk to finish musttail thunks FinishThunk, and the invariant of setting and then unsetting CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't exist when I added this musttail codepath in ab2090d10765 (2014). Recently in 28328c3771, I started using this codepath on non-Windows platforms, and users reported problems during release testing (PR44987). The issue was already present for users of EH on i686-windows-msvc, so I added a test for that case as well. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D76444 This should fix 'Assertion failed: (!empty() && "popping exception stack when not empty"), function popTerminate, file /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGCleanup.h, line 583' when building the net-p2p/libtorrent-rasterbar PR: 244830 Reported by: jbeich, yuri MFC r360134: Merge commit 64b31d96d from llvm git (by Nemanja Ivanovic): [PowerPC] Do not attempt to reuse load for 64-bit FP_TO_UINT without FPCVT We call the function that attempts to reuse the conversion without checking whether the target matches the constraints that the callee expects. This patch adds the check prior to the call. Fixes: https://bugs.llvm.org/show_bug.cgi?id=43976 Differential revision: https://reviews.llvm.org/D77564 This should fix 'Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT || Subtarget.hasFPCVT()) && "i64 FP_TO_UINT is supported only with FPCVT"), function LowerFP_TO_INTForReuse, file /usr/src/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp, line 7276' when building the devel/libslang2 port (and a few others) for PowerPC64. Requested by: pkubaj MFC r360350: Tentatively apply https://reviews.llvm.org/D78877 (by Dave Green): [ARM] Only produce qadd8b under hasV6Ops When compiling for a arm5te cpu from clang, the +dsp attribute is set. This meant we could try and generate qadd8 instructions where we would end up having no pattern. I've changed the condition here to be hasV6Ops && hasDSP, which is what other parts of ARMISelLowering seem to use for similar instructions. Fixed PR45677. This fixes "fatal error: error in backend: Cannot select: t37: i32 = ARMISD::QADD8b t43, t44" when compiling sys/dev/sound/pcm/feeder_mixer.c for armv5. For some reason we do not encounter this on head, but this error popped up while building universes for stable/12. Notes: svn path=/stable/12/; revision=360545
* MFC r356100:Dimitry Andric2020-01-071-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit d3aeac8e2 from llvm git (by Justin Hibbits) [PowerPC] Only use PLT annotations if using PIC relocation model Summary: The default static (non-PIC, non-PIE) model for 32-bit powerpc does not use @PLT annotations and relocations in GCC. LLVM shouldn't use @PLT annotations either, because it breaks secure-PLT linking with (some versions of?) GNU LD. Update the available-externally.ll test to reflect that default mode should be the same as the static relocation, by using the same check prefix. Reviewed by: sfertile Differential Revision: https://reviews.llvm.org/D70570 Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22913 MFC r356104 (by jhibbits): [PowerPC] enable atomic.c in compiler_rt and do not check and forces lock/lock_free decisions in compiled time Summary: Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime decision about lock/lock_free. At compiling time, if clang can't decide if atomic operation can be lock free, it emits calls to external functions like `__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and `__atomic_always_lock_free`, postponing decision to a runtime check. According to LLVM code documentation, the mechanism exists due to differences between x86_64 processors that can't be decided at runtime. On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock free, so we force the decision at compile time and avoid having to implement it in an external library. This patch was made after 32 bit users testing the PowePC32 bit ISO reported llvm could not be compiled with in-base llvm due to `__atomic_load8` not implemented. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits, dim Differential Revision: https://reviews.freebsd.org/D22549 MFC r356112 (by jhibbits): [PowerPC64] Starting from FreeBSD 13.0, default to ELFv2 ABI This changes the LLVM default powerpc64 ABI to ELFv2, if target OS is FreeBSD >= 13.0 This will also be sent upstream. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: dim, luporl Relnotes: YES Differential Revision: https://reviews.freebsd.org/D20383 Notes: svn path=/stable/12/; revision=356467
* MFC r356004:Dimitry Andric2020-01-071-2/+7
| | | | | | | | | | | | | | | | | | Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 9.0.1 final release c1a0a213378a458fbea1a5c77b315c7dce08fd05. Release notes for llvm, clang, lld and libc++ 9.0.1 will become available here: https://releases.llvm.org/9.0.1/docs/ReleaseNotes.html https://releases.llvm.org/9.0.1/tools/clang/docs/ReleaseNotes.html https://releases.llvm.org/9.0.1/tools/lld/docs/ReleaseNotes.html https://releases.llvm.org/9.0.1/projects/libcxx/docs/ReleaseNotes.html PR: 240629 Notes: svn path=/stable/12/; revision=356465
* MFC r355948:Dimitry Andric2020-01-071-71/+0
| | | | | | | | | | | | | | | | | | | | | | | | Bootstrap mergeinfo for contrib/llvm-project Merge (record-only) the following paths to contrib/llvm-project: * ^/vendor/llvm-project/master * ^/vendor/llvm-project/release-8.x * ^/vendor/llvm-project/release-9.x MFC r355951: Merge empty dir updates from r355950 in vendor/llvm-project. MFC r355957: Merge diff elimination updates from r355953 into vendor/llvm-project. MFC r355959: Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. Notes: svn path=/stable/12/; revision=356464
* MFC r355940:Dimitry Andric2020-01-071041-0/+190842
Move all sources from the llvm project into contrib/llvm-project. This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Notes: svn path=/stable/12/; revision=356462