aboutsummaryrefslogtreecommitdiff
path: root/llvm
AgeCommit message (Collapse)AuthorFilesLines
2024-02-26[llvm-shlib] Change libLLVM-$MAJOR.so symlink to point to versioned SO (#82660)Tom Stellard2-4/+8
This symlink was added in 91a384621e5b762d9c173ffd247cfeadd5f436a2 to maintain backwards compatibility, but it needs to point to libLLVM.so.$MAJOR.$MINOR rather than libLLVM.so. This works better for distros that ship libLLVM.so and libLLVM.so.$MAJOR.$MINOR in separate packages and also prevents mistakes like libLLVM-19.so -> libLLVM.so -> libLLVM.so.18.1 Fixes #82647 (cherry picked from commit 10c48a772742b7afe665a815b7eba2047f17dc4b)
2024-02-26[llvm][AArch64] Do not inline a function with different signing scheme. ↵Dani4-8/+135
(#80642) (#82743) f the signing scheme is different that maybe the functions assumes different behaviours and dangerous to inline them without analysing them. This should be a rare case.
2024-02-26[FlattenCFG] Fix the miscompilation where phi nodes exist in the merge point ↵Yingwei Zheng2-16/+13
(#81987) When there are phi nodes in the merge point of the if-region, we cannot do the merge. Alive2: https://alive2.llvm.org/ce/z/DbgEan Fixes #70900. (cherry picked from commit f920b746ea818f1d21f317116cbb105e3e85979a)
2024-02-26[GVN] Drop nsw/nuw flags when replacing the result of a with.overflow ↵Yingwei Zheng2-1/+28
intrinsic with a overflowing binary operator (#82935) Alive2: https://alive2.llvm.org/ce/z/gyL7mn Fixes https://github.com/llvm/llvm-project/issues/82884. (cherry picked from commit 892b4beeac50920e630f10905b2916295e2eb6d8)
2024-02-26[SystemZ] Use VT (not ArgVT) for SlotVT in LowerCall(). (#82475)Jonas Paulsson2-1/+19
When an integer argument is promoted and *not* split (like i72 -> i128 on a new machine with vector support), the SlotVT should be i128, which is stored in VT - not ArgVT. Fixes #81417 (cherry picked from commit 9c0e45d7f0e2202e16dbd9a7b9f462e2bcb741ae)
2024-02-26[SystemZ] Require D12 for i128 accesses in isLegalAddressingMode() (#79221)Jonas Paulsson2-1/+25
Machines with vector support handle i128 in vector registers and therefore only have the small displacement available for memory accesses. Update isLegalAddressingMode() to reflect this. (cherry picked from commit 84dcf3d35b6ea8d8b6c34bc9cf21135863c47b8c)
2024-02-23Backport 0bf4f82 to release/18.x (#82571)Wentao Zhang5-8/+10
Manually cherry-pick 0bf4f82f661817c79bd538c82c99515837cf1cf8 (#80952) and resolve conflicts Closes #82570
2024-02-23[llvm-readobj,ELF] Support --decompress/-z (#82594)Fangrui Song10-6/+209
When a section has the SHF_COMPRESSED flag, -p/-x dump the compressed content by default. In GNU readelf, if --decompress/-z is specified, -p/-x will dump the decompressed content. This patch implements the option. Close #82507 (cherry picked from commit 26d71d9ed56c4c23e6284dac7a9bdf603a5801f3)
2024-02-23[docs][llvm-objcopy] Add missing formats (#81981)Ulrich Weigand1-0/+4
Bring list of supported formats in docs back in sync with the code. (cherry picked from commit bf471c915d14035a24ec027fb2bb0373cefdabe1)
2024-02-23[Loads] Fix crash in isSafeToLoadUnconditionally with scalable accessed type ↵Luke Lau2-3/+22
(#82650) This fixes #82606 by updating isSafeToLoadUnconditionally to handle fixed sized loads from a scalable accessed type. (cherry picked from commit b0edc1c45284586fdb12edd666f95d99f5f62b43)
2024-02-22Extend GCC workaround to GCC < 8.4 for llvm::iterator_range ctor (#82643)Thomas Preud'homme1-2/+2
GCC SFINAE error with decltype was fixed in commit ac5e28911abdfb8d9bf6bea980223e199bbcf28d which made it into GCC 8.4. Therefore adjust GCC version test accordingly. (cherry picked from commit 7f71fa909a10be182b82b9dfaf0fade6eb84796c)
2024-02-20Fix llvm-x86_64-debian-dylib buildbotllvmorg-18.1.0-rc3Tom Stellard2-4/+5
This was broken by 91a384621e5b762d9c173ffd247cfeadd5f436a2. (cherry picked from commit ff4d6c64ee4269e4a9b67a4dae7e0b82ae1c3419)
2024-02-20[cmake] Add minor version to library SONAME (#79376)Tom Stellard3-6/+9
We need to do this now that we are bumping the minor release number when we create the release branch. This also results in a slight change to the library names for LLVM. The main library now has a more convential library name: 'libLLVM.so.$major.$minor'. The old library name: libLLVM-$major.so is now a symlink that points to the new library. However, the symlink is not present in the build directory. It is only present in the install directory. The library name was changed because it helped to keep the CMake changes more simple. Fixes #76273 (cherry picked from commit 91a384621e5b762d9c173ffd247cfeadd5f436a2)
2024-02-20[workflows] Fix permissions check for creating new releases (#81163)Tom Stellard1-4/+12
The default GitHub token does not have read permissions on the org, so we need to use a custom token in order to read the members of the llvm-release-managers team. (cherry picked from commit 2836d8edbfbcd461b25101ed58f93c862d65903a)
2024-02-20[Release] Don't build during test-release.sh Phase 3 install (#82001)Rainer Orth1-0/+5
As described in [test-release.sh ninja install does builds in Phase 3](https://github.com/llvm/llvm-project/issues/80999), considerable parts of Phase 3 of a `test-release.sh` build are run by `ninja install`, ignoring both `$Verbose` and the parallelism set via `-j NUM`. This patches fixes this by not specifying any explicit build target for Phase 3, thus running the full build as usual. Tested on `sparc64-unknown-linux-gnu`. (cherry picked from commit f6ac598c104ed3c9f4bcbbe830f86500c8d1013e)
2024-02-20[IndVarSimplify] Fix poison-safety when reusing instructions (#80458)Nikita Popov3-6/+22
IndVars may replace an instruction with one of its operands, if they have the same SCEV expression. However, such a replacement may be more poisonous. First, check whether the operand being poison implies that the instruction is also poison, in which case the replacement is always safe. If this fails, check whether SCEV can determine that reusing the instruction is safe, using the same check as SCEVExpander. Fixes https://github.com/llvm/llvm-project/issues/79861. (cherry picked from commit 7d2b6f0b355bc98bbe3aa5bae83316a708da33ee)
2024-02-20[SCEV] Move canReuseInstruction() helper into SCEV (NFC)Nikita Popov3-63/+70
To allow reusing it in IndVars. (cherry picked from commit 43dd1e84df1ecdad872e1004af47b489e08fc228)
2024-02-20[SCEVExpander] Do not reuse disjoint or (#80281)Nikita Popov2-2/+10
SCEV treats "or disjoint" the same as "add nsw nuw". However, when expanding, we cannot generally replace an add SCEV node with an "or disjoint" instruction. Just dropping the poison flag is insufficient in this case, we would have to actually convert the or into an add. This is a partial fix for #79861. (cherry picked from commit 5b8e1a6ebf11b6e93bcc96a0d009febe4bb3d7bc)
2024-02-20[IndVars] Add tests for #79861 (NFC)Nikita Popov1-0/+104
(cherry picked from commit c105848fd29d3b46eeb794bb6b10dad04f903b09)
2024-02-20[llvm-objcopy] Add SystemZ support (#81841)Ulrich Weigand3-0/+15
This is also necessary for enabling ClangBuiltLinux: https://github.com/ClangBuiltLinux/linux/issues/1530 (cherry picked from commit 3c02cb7492fc78fb678264cebf57ff88e478e14f)
2024-02-20[PowerPC] Mask constant operands in ValueBit tracking (#67653)Qiu Chaofan2-13/+156
In IR or C code, shift amount larger than value size is undefined behavior. But in practice, backend lowering for shift_parts produces add/sub of shift amounts, thus constant shift amounts might be negative or larger than value size, which depends on ISA definition. PowerPC ISA says, the lowest 7 bits (6 bits for 32-bit instruction) will be taken, and if the highest among them is 1, result will be zero, otherwise the low 6 bits (or 5 on 32-bit) are used as shift amount. This commit emulates the behavior and avoids array overflow in bit permutation's value bits calculator. (cherry picked from commit 292d9e869fcfc2ece694848db4022b0b939847e3)
2024-02-20[llvm-objdump] Add support for the PT_OPENBSD_SYSCALLS segment type. (#82121)Frederic Cambus2-0/+6
Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h (cherry picked from commit 1b894864862d8049e4a2567a472efdc2eda1e035)
2024-02-20[llvm-readobj] Add support for the PT_OPENBSD_SYSCALLS segment type. (#82122)Frederic Cambus2-117/+138
Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h (cherry picked from commit a8d7511811c7d7c689c3e8f858e8e00a56aba152)
2024-02-20[InstCombine] Fold gep of exact unsigned division (#82334)Nikita Popov2-7/+5
Extend the transform added in https://github.com/llvm/llvm-project/pull/76458 to also handle unsigned division. X exact/ Y * Y == X holds independently of whether the division is signed or unsigned. Proofs: https://alive2.llvm.org/ce/z/wFd5Ec (cherry picked from commit 26d4afc3de86ca5416c8e38000362c526b6808cd)
2024-02-20[InstCombine] Add unsigned variants of gep exact div tests (NFC)Nikita Popov1-0/+56
(cherry picked from commit ec2c770b9f9a0e9eca4a893383d2b27dd4c0bfe7)
2024-02-19[RISCV] Check type is legal before combining mgather to vlse intrinsic (#81107)Luke Lau2-1/+449
Otherwise we will crash since target intrinsics don't have their types legalized. Let the mgather get legalized first, then do the combine on the legal type. Fixes #81088 Co-authored-by: Craig Topper <craig.topper@sifive.com> (cherry picked from commit 06c89bd59ca2279f76a41e851b7b2df634a6191e)
2024-02-19[ValueTracking] Fix computeKnownFPClass for fpext (#81972)Yingwei Zheng3-3/+70
This patch adds the missing `subnormal -> normal` part for `fpext` in `computeKnownFPClass`. Fixes the miscompilation reported by https://github.com/llvm/llvm-project/pull/80941#issuecomment-1947302100. (cherry picked from commit a5865c3c3dbbd17ae12ecc1c297fe1fc2605df52)
2024-02-19[Support/ELF] Add OpenBSD PT_OPENBSD_SYSCALLS constant.Frederic Cambus1-0/+1
Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h (cherry picked from commit 97eff26d0ca4d187a5efb8534af484dbb68bce30)
2024-02-17[AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873)David Green2-0/+138
If, like powi on windows, the libcall is unavailable we should fall back to SDAG. Currently we try and generate a call to "". (cherry picked from commit 47c65cf62d06add9f55a77c9d45390fa3b986fc5)
2024-02-16[SLP]Fix PR79229: Do not erase extractelement, if it used inAlexey Bataev2-1/+109
multiregister node. If the node can be span between several registers and same extractelement instruction is used in several parts, it may be required to keep such extractelement instruction to avoid compiler crash. (cherry picked from commit 6fe21bc1dac883efa0dfa807f327048ae9969b81)
2024-02-16[SLP]Fix PR79229: Check that extractelement is used only in a single nodeAlexey Bataev2-1/+154
before erasing. Before trying to erase the extractelement instruction, not enough to check for single use, need to check that it is not used in several nodes because of the preliminary nodes reordering. (cherry picked from commit 48bbd7658710ef1699bf2a6532ff5830230aacc5)
2024-02-16Backport [DAGCombine] Fix multi-use miscompile in load combine (#81586) (#81633)Nikita Popov2-1/+33
(cherry picked from commit 25b9ed6e4964344e3710359bec4c831e5a8448b9)
2024-02-16[CFI][annotation] Leave alone function pointers in function annotations (#81673)yozhu2-2/+94
Function annotation, as part of llvm.metadata, is for the function itself and doesn't apply to its corresponding jump table entry, so with CFI we shouldn't replace function pointer in function annotation with pointer to its corresponding jump table entry. (cherry picked from commit c7a0db1e20251f436e3d500eac03bd9be1d88b45)
2024-02-16[AArch64] Only apply bool vector bitcast opt if result is scalar (#81256)Nikita Popov2-1/+30
This optimization tries to optimize bitcasts from `<N x i1>` to iN, but currently also triggers for `<N x i1>` to `<M x iK>` bitcasts, if custom lowering has been requested for these for an unrelated reason. Fix this by explicitly checking that the result type is scalar. Fixes https://github.com/llvm/llvm-project/issues/81216. (cherry picked from commit 92d79922051f732560acf3791b543df1e6580689)
2024-02-16[RISCV] Make sure ADDI replacement in optimizeCondBranch has a virtual reg ↵Craig Topper2-1/+70
destination. (#81938) If it isn't virtual, we may extend the live range of the physical register past were it is valid. For example, across a call. Found while trying to enable -riscv-enable-sink-fold which enables some copy propagation in machine sink that led to ADDIs with physical register destinations. (cherry picked from commit feee627974df81e4cbf15537e4c4688aed66b12f)
2024-02-16[RISCV] Use APInt in useInversedSetcc to prevent crashes when mask is larger ↵Craig Topper2-2/+53
than UINT64_MAX. (#81888) There are no checks that the type is legal so we need to handle any type. (cherry picked from commit b57ba8ec514190b38eced26d541e8e25af66c485)
2024-02-15MipsAsmParser/O32: Don't add redundant $ to $-prefixed symbol in the la ↵YunQiang Su3-3/+30
macro (#80644) When parsing the `la` macro, we add a duplicate `$` prefix in `getOrCreateSymbol`, leading to `error: Undefined temporary symbol $$yy` for code like: ``` xx: la $2,$yy $yy: nop ``` Remove the duplicate prefix. In addition, recognize `.L`-prefixed symbols as local for O32. See: #65020. --------- Co-authored-by: Fangrui Song <i@maskray.me> (cherry picked from commit c007fbb19879f9b597b47ae772c53e53cdc65f29)
2024-02-15[PowerPC] Update V18.1.0 release notes (#81631)Maryam Moghadas1-0/+38
Adding PowerPC updates for clang and llvm into the V18.1.0 release notes. --------- Co-authored-by: Maryam Moghadas <maryammo@ca.ibm.com>
2024-02-15[AArch64][SME] Implement inline-asm clobbers for za/zt0 (#79276)Matthew Devereau3-0/+28
This enables specifing "za" or "zt0" to the clobber list for inline asm. This complies with the acle SME addition to the asm extension here: https://github.com/ARM-software/acle/pull/276 (cherry picked from commit d9c20e437fe110fb79b5ca73a52762e5b930b361)
2024-02-15Revert "[RISCV] Recurse on first operand of two operand shuffles (#79180)" ↵Philip Reames6-347/+407
(#80238) This reverts commit bdc41106ee48dce59c500c9a3957af947f30c8c3 on the release/18.x branch. This change was the first in a mini-series and while I'm not aware of any particular problem from having it on it's own in the branch, it seems safer to ship with the previous known good state.
2024-02-13[AArch64][GISel] Don't pointlessly lower G_TRUNC (#81479)Nikita Popov2-3/+26
If we have something like G_TRUNC from v2s32 to v2s16, then lowering this to a concat of two G_TRUNC s32 to s16 followed by G_TRUNC from v2s16 to v2s8 does not bring us any closer to legality. In fact, the first part of that is a G_BUILD_VECTOR whose legalization will produce a new G_TRUNC from v2s32 to v2s16, and both G_TRUNCs will then get combined to the original, causing a legalization cycle. Make the lowering condition more precise, by requiring that the original vector is >128 bits, which is I believe the only case where this specific splitting approach is useful. Note that this doesn't actually produce a legal result (the alwaysLegal is a lie, as before), but it will cause a proper globalisel abort instead of an infinite legalization loop. Fixes https://github.com/llvm/llvm-project/issues/81244. (cherry picked from commit 070848c17c2944afa494d42d3ad42929f3379842)
2024-02-13[SPARC] Support reserving arbitrary general purpose registers (#74927)Koakuma11-2/+154
This adds support for marking arbitrary general purpose registers - except for those with special purpose (G0, I6-I7, O6-O7) - as reserved, as needed by some software like the Linux kernel. (cherry picked from commit c2f9885a8aa3a820eefdacccf3fcc6b9d87e3284)
2024-02-09[RegisterCoalescer] Clear instructions not recorded in `ErasedInstrs` but ↵Quentin Dian3-5/+338
erased (#79820) Fixes #79718. Fixes #71178. The same instructions may exist in an iteration. We cannot immediately delete instructions in `ErasedInstrs`. (cherry picked from commit 95b14da678f4670283240ef4cf60f3a39bed97b4)
2024-02-09[X86] Fix lowering TLS under darwin large code model (#80907)Arthur Eubanks2-4/+7
OpFlag and WrapperKind should be chosen consistently with each other in regards to PIC, otherwise we hit asserts later on. Broken by c04a05d8. Fixes #80831. (cherry picked from commit 5a83bccb35d6b0e6914b52af6db067aa01dd3efb)
2024-02-06[AArch64] Add some release notes items (#79983)Momchil Velikov1-0/+8
2024-02-06Refactor recomputeLiveIns to operate on whole CFG (#79498) (#79641)Oskar Wirga12-46/+98
Currently, the way that recomputeLiveIns works is that it will recompute the livein registers for that MachineBasicBlock but it matters what order you call recomputeLiveIn which can result in incorrect register allocations down the line. Now we do not recompute the entire CFG but we do ensure that the newly added MBB do reach convergence. This fixes a register allocation bug introduced in AArch64 stack probing. (cherry picked from commit ff4636a4ab00b633c15eb3942c26126ceb2662e6)
2024-02-06[X86][tablgen] Fix the broadcast tables (#79675)Shengchen Kan5-237/+223
(cherry picked from commit 7c3ee7cbe6419ea5e37ce2723cc1a1688380581f)
2024-02-06[LV] Fix handling of interleaving linear args (#78725)Graham Hunter2-24/+42
Currently when interleaving vector calls with linear arguments, the Part is ignored and all vector calls use the initial value from the first lane of the current iteration. Fix this to extract from the correct part of the linear vector. (cherry picked from commit d4c01714239e80d21e441c3886749fc56b743f81)
2024-02-06[docs] Add release notes for Windows specific changes in 18.x (#80011)Martin Storsjö1-0/+15
2024-02-06[ConstraintElim] Make sure min/max intrinsic results are not poison.Florian Hahn3-4/+13
The result of umin may be poison and in that case the added constraints are not be valid in contexts where poison doesn't cause UB. Only queue facts for min/max intrinsics if the result is guaranteed to not be poison. This could be improved in the future, by only adding the fact when solving conditions using the result value. Fixes https://github.com/llvm/llvm-project/issues/78621. (cherry picked from commit 3d91d9613e294b242d853039209b40a0cb7853f2)