- Mar 01, 2022
-
-
Dimitry Andric authored
Follow-up to 458ead66, which replaced the bespoke CMakeLists.txt file for building a custom instrumented libc++ with an invocation of the runtimes build. In the the bespoke CMakeLists.txt, the LIBCXX_CXX_ABI setting was forced to libcxxabi, but this was not done for the CMake invocation for the runtimes build. This would cause CMake configuration issues on platforms where the default LIBCXX_CXX_ABI setting is not libcxxabi, such as FreeBSD. Add `-DLIBCXX_CXX_ABI=libcxxabi` to that invocation, to make sure the custom instrumented libc++ always uses the expected ABI. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D119554 (cherry picked from commit a9f1a9c0)
-
Brad Smith authored
Similar to D116843 for Gnu.cpp Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D119656 (cherry picked from commit cbd9d136)
-
Brad Smith authored
Similar to D116843 for Gnu.cpp Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D119655 (cherry picked from commit d241ce0f)
-
Chia-hung Duan authored
Use SetVector instead of DenseSet to ensure we always generate the same name for the same function. This issue is found in https://github.com/llvm/llvm-project/issues/53768. Reviewed By: quinnp, rdzhabarov Differential Revision: https://reviews.llvm.org/D120514 (cherry picked from commit d56ef5ed)
-
Jessica Clarke authored
By failing to lex the token we end up both parsing it as a binary operator ourselves and parsing it as a unary operator when calling parseExpression on the RHS. For plus this is harmless but for minus this parses "foo - 4" as "foo - -4", effectively treating a top-level minus as a plus. Fixes https://github.com/llvm/llvm-project/issues/54105 Reviewed By: asb, MaskRay Differential Revision: https://reviews.llvm.org/D120635 (cherry picked from commit 6aa8521f)
-
Joseph Huber authored
Summary: This patch changes the ClangLinkerWrapper to use the executable path when searching for the lld binary. Previously we relied on the program name. Also not finding 'llvm-strip' is not considered an error anymore because it is an optional optimization. (cherry picked from commit 7ee8bd60)
-
Kelvin Li authored
Add the build directory to the search path for llvm-strip instead of solely relying on the PATH environment variable setting. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D118965 (cherry picked from commit 8ea4aed5)
-
Florian Hahn authored
Blocks with UnreachableInst terminators are considered as root nodes in the PDT. This pessimize DSE, if there are no aliasing reads from the potentially dead store and the block with the unreachable terminator. If any of the root nodes of the PDF has UnreachableInst as terminator, fall back to the CFG scan, even the common dominator of all killing blocks does not post-dominate the block with potentially dead store. It looks like the compile-time impact for the extra scans is negligible. https://llvm-compile-time-tracker.com/compare.php?from=779bbbf27fe631154bdfaac7a443f198d4654688&to=ac59945f1bec1c6a7d7f5590c8c69fd9c5369c53&stat=instructions Fixes #53800. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D119760
-
Nikita Popov authored
-
Alex Bradbury authored
[RISCV] Avoid infinite loop between DAGCombiner::visitMUL and RISCVISelLowering::transformAddImmMulImm See https://github.com/llvm/llvm-project/issues/53831 for a full discussion. The basic issue is that DAGCombiner::visitMUL and RISCVISelLowering;:transformAddImmMullImm get stuck in a loop, as the current checks in transformAddImmMulImm aren't sufficient to avoid all cases where DAGCombiner::isMulAddWithConstProfitable might trigger a transformation. This patch makes transformAddImmMulImm bail out if C0 (the constant used for multiplication) has more than one use. Differential Revision: https://reviews.llvm.org/D120332 (cherry picked from commit c5bcfb98)
-
Nikita Popov authored
We should not assume that the cet.h header exists just because we're on x86 linux. Only include it if __CET__ is defined. This makes the code more similar to what compiler-rt does in https://github.com/llvm/llvm-project/blob/ee423d93ead39e94c2970b3cc7ef6e6faa75d10b/compiler-rt/lib/builtins/assembly.h#L17 (though that one also has a __has_include() check -- I've not found that to be necessary). Differential Revision: https://reviews.llvm.org/D119697 (cherry picked from commit 2d2ef384)
-
David Sherwood authored
(cherry picked from commit dc065727)
-
David Sherwood authored
This patch fixes an invalid TypeSize->uint64_t implicit conversion in FoldReinterpretLoadFromConst. If the size of the constant is scalable we bail out of the optimisation for now. Tests added here: Transforms/InstCombine/load-store-forward.ll Differential Revision: https://reviews.llvm.org/D120240 (cherry picked from commit 47eff645)
-
Brendon Cahoon authored
A call to getInsertIndex() in getTreeCost() is returning None, which causes an assert because a non-constant index value for insertelement was not expected. This case occurs when the insertelement index value is defined with a PHI. Differential Revision: https://reviews.llvm.org/D120223 (cherry picked from commit 3cc15e2c)
-
Todd Mortimer authored
(cherry picked from commit bcbb0375)
-
Kadir Cetinkaya authored
Allocate on ASTContext, rather than just on heap, so that template parameter lists are freed up. Differential Revision: https://reviews.llvm.org/D120081 (cherry picked from commit 977b1f57)
-
Kadir Cetinkaya authored
Differential Revision: https://reviews.llvm.org/D120065 (cherry picked from commit c79c13ca)
-
Konstantin Varlamov authored
According to Linux documentation (see e.g. https://linux.die.net/man/3/closedir): > A successful call to `closedir()` also closes the underlying file > descriptor associated with `dirp`. Thus, calling `close()` after a successful call to `closedir()` is at best redundant. Worse, should a different thread open a file in-between the calls to `closedir()` and `close()` and get the same file descriptor, the call to `close()` might actually close a different file than was intended. rdar://89251874 Differential Revision: https://reviews.llvm.org/D120453 (cherry picked from commit 3906ebf7)
-
- Feb 26, 2022
-
-
Joao Moreira authored
https://github.com/ClangBuiltLinux/linux/issues/1606 When GNU_PROPERTY_X86_FEATURE_1_IBT is enabled, ld.lld will create .plt output section even if there is no PLT entry. Fix this by implementing IBTPltSection::isNeeded instead of using the default code path (which always returns true). Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D120600 (cherry picked from commit 9d7001eb)
-
Fangrui Song authored
The no-pic large code model style `movabsq $callback, %rsi` does not work with -pie. (cherry picked from commit 84647ff3)
-
Michał Górny authored
Skip the hip-fpie-option.hip Driver test if default-pie-on-linux is used. This test currently relies on default-no-pie, and it has been changed to require default-pie in main. Differential Revision: https://reviews.llvm.org/D120577
-
Fangrui Song authored
ctfconvert seems to use REL-format `.rel.SUNW_dof` for 32-bit architectures. ``` Binary file usr/ports/lang/perl5.32/work/perl-5.32.1/dtrace_mini.o matches [alfredo.junior@dell-a ~/tmp/llvm-bug]$ readelf -r dtrace_mini.o Relocation section (.rel.SUNW_dof): r_offset r_info r_type st_value st_name 00000184 0000281a R_PPC_REL32 00000000 $dtrace1772974259.Perl_dtrace_probe_load ``` Support R_PPC_REL32 to fix `ld.lld: error: drti.c:(.SUNW_dof+0x4E4): internal linker error: cannot read addend for relocation R_PPC_REL32`. While here, add some common relocation types for AArch64, PPC, and PPC64. We perform minimum tests. Reviewed By: adalava, arichardson Differential Revision: https://reviews.llvm.org/D120535 (cherry picked from commit 767e64fc)
-
- Feb 25, 2022
-
-
Whisperity authored
[clang-tidy] Fix `readability-suspicious-call-argument` crash for arguments without name-like identifier As originally reported by @steakhal in http://github.com/llvm/llvm-project/issues/54074, the name extraction logic of `readability-suspicious-call-argument` crashes if the argument passed to a function was a function call to a non-trivially named entity (e.g. an operator). Fixed this crash case by ignoring such constructs and considering them as having no name. Reviewed By: aaron.ballman, steakhal Differential Revision: http://reviews.llvm.org/D120555 (Cherry-picked from commit 416e689e)
-
Muhammad Omair Javaid authored
LLDB windows on ARM64 14.0.0 release will include LLDB binary. This patch adds a release note about it.
-
Fangrui Song authored
prelink (will be removed by glibc 2.37) does not support PIE. (cherry picked from commit 61112289)
-
Fangrui Song authored
CLANG_DEFAULT_PIE_ON_LINUX=on will soon become the default. The purpose of these tests has gone. (cherry picked from commit 0ac6be6a)
-
Fangrui Song authored
(cherry picked from commit deee3397)
-
Fangrui Song authored
(cherry picked from commit da047445)
-
Simon Atanasyan authored
(cherry picked from commit cedc23bc)
-
- Feb 23, 2022
-
-
Rainer Orth authored
Even after D86621 <https://reviews.llvm.org/D86621>, `clang -m32` on Solaris/sparcv9 doesn't inline atomics with 8-byte operands, unlike `gcc`. This leads to many link failures in the testsuite (undefined references to `__atomic_load_8` and `__sync_val_compare_and_swap_8`. Until a proper codegen fix can be implemented, this patch works around the first of those by linking with `-latomic`. Tested on `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D118021 (cherry picked from commit a6afa9e6)
-
Rainer Orth authored
While testing LLVM 14.0.0 rc1 on Solaris, I ran into a compile failure: from /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp:22: /usr/include/sys/types.h:103:16: error: conflicting declaration ‘typedef short int index_t’ 103 | typedef short index_t; | ^~~~~~~ In file included from /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp:17: /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/include/mlir/ExecutionEngine/SparseTensorUtils.h:26:7: note: previous declaration as ‘using index_t = uint64_t’ 26 | using index_t = uint64_t; | ^~~~~~~ The same issue had already occured in the past and fixed in D72619 <https://reviews.llvm.org/D72619>. More detailed explanation can also be found there. Tested on `amd64-pc-solaris2.11` and `sparcv9-solaris2.11`. Differential Revision: https://reviews.llvm.org/D119323 (cherry picked from commit d2215e79) -
Bradley Smith authored
The lowering code for shuffle_vector has a code path that looks through extract_subvector, this code path did not properly account for the potential presense of larger than Neon vector types and could produce unselectable DAG nodes. Differential Revision: https://reviews.llvm.org/D119252 (cherry picked from commit 98936aee)
-
David Sherwood authored
The code was relying upon the implicit conversion of TypeSize to uint64_t and assuming the type in question was always fixed. However, I discovered an issue when running the canon-freeze pass with some IR loops that contains scalable vector types. I've changed the code to bail out if the size is unknown at compile time, since we cannot compute whether the step is a multiple of the type size or not. I added a test here: Transforms/CanonicalizeFreezeInLoops/phis.ll Differential Revision: https://reviews.llvm.org/D118696 (cherry picked from commit 1badfbb4)
-
David Sherwood authored
Previously the code in AArch64TargetLowering::ReconstructShuffle assumed the input vectors were always fixed-width, however this is not always the case since you can extract elements from scalable vectors and insert into fixed-width ones. We were hitting crashes here for two different cases: 1. When lowering a fixed-length vector extract from a scalable vector with i1 element types. This happens due to the fact the i1 elements get promoted to larger integer types for fixed-width vectors and leads to sequences of INSERT_VECTOR_ELT and EXTRACT_VECTOR_ELT nodes. In this case AArch64TargetLowering::ReconstructShuffle will still fail to make a transformation, but at least it no longer crashes. 2. When lowering a sequence of extractelement/insertelement operations on mixed fixed-width/scalable vectors. For now, I've just changed AArch64TargetLowering::ReconstructShuffle to bail out if it finds a scalable vector. Tests for both instances described above have been added here: (1) CodeGen/AArch64/sve-extract-fixed-vector.ll (2) CodeGen/AArch64/sve-fixed-length-reshuffle.ll Differential Revision: https://reviews.llvm.org/D116602 (cherry picked from commit a57a7f3d)
-
Bradley Smith authored
Fixes: #53679 Differential Revision: https://reviews.llvm.org/D119428 (cherry picked from commit c53ad72a)
-
Kerry McLaughlin authored
Currently, loading from or storing to a stack location with a structured load or store crashes in isAArch64FrameOffsetLegal as the opcodes are not handled by getMemOpInfo. This patch adds the opcodes for structured load/store instructions with an immediate index to getMemOpInfo & getLoadStoreImmIdx, setting appropriate values for the scale, width & min/max offsets. Reviewed By: sdesmalen, david-arm Differential Revision: https://reviews.llvm.org/D119338 (cherry picked from commit fc1b2122)
-
Nicolas Miller authored
The section name encoding for `llvm-objcopy` had two main issues, the first is that the size used for the `snprintf` in the original code is incorrect because `snprintf` adds a null byte, so this code was only able to encode offsets of 6 digits - `/`, `\0` and 6 digits of the offset - rather than the 7 digits it should support. And the second part is that it didn't support the base64 encoding for offsets larger than 7 digits. This issue specifically showed up when using the `clang-offload-bundler` with a binary containing a lot of symbols/sections, since it uses `llvm-objcopy` to add the sections containing the offload code. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D118692 (cherry picked from commit ddf528b7)
-
Nicolas Miller authored
Large COFF section names are moved into the string table and the section header field is the offset into the string table encoded in ASCII for offset smaller than 7 digits and in base64 for larger offsets. The operation of taking the string table offsets is done in a few places in the codebase, so it is helpful to move this operation into `BinaryFormat` so that it can be shared everywhere it's done. So this patch takes the implementation of this operation from `llvm/lib/MC/WinCOFFObjectWriter.cpp` and moves it into `BinaryFormat`. Reviewed By: jhenderson, rnk Differential Revision: https://reviews.llvm.org/D118793 (cherry picked from commit 85f4023e)
-
Rainer Orth authored
While testing LLVM 14.0.0 rc1 on Solaris, compilation of `FAIL`ed with /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp: In lambda function: /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp:48:58: error: call of overloaded ‘floor(int64_t)’ is ambiguous 48 | [gcd](int64_t &n) { return floor(n / gcd); }); | ^ ... /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:201:21: note: candidate: ‘long double std::floor(long double)’ 201 | inline long double floor(long double __X) { return __floorl(__X); } | ^~~~~ /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:165:15: note: candidate: ‘float std::floor(float)’ 165 | inline float floor(float __X) { return __floorf(__X); } | ^~~~~ /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:78:15: note: candidate: ‘double std::floor(double)’ 78 | extern double floor __P((double)); | ^~~~~ The same issue had already occured in the past, cf. D108750 <https://reviews.llvm.org/D108750>, and the solution is the same: cast the `floor` arg to `double`. Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D119324 (cherry picked from commit 91596755)
-
- Feb 22, 2022
-
-
Nikita Popov authored
Instead of doing an inbounds strip first and another non-inbounds strip afterward for equality comparisons, directly do a single inbounds or non-inbounds strip based on whether we have an equality predicate or not. This is NFC-ish in that the alloca equality codepath is the only part that sees additional non-inbounds offsets now, and for that codepath it doesn't matter whether or not the GEP is inbounds, as it does a stronger check itself. InstCombine would infer inbounds for such GEPs. (cherry picked from commit f35af775)
-