-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang] Crash with O2 optimization flag #106239
Labels
confirmed
Verified by a second party
crash
Prefer [crash-on-valid] or [crash-on-invalid]
llvm:transforms
regression
release:backport
Milestone
Comments
github-actions
bot
added
the
clang
Clang issues not falling into any other category
label
Aug 27, 2024
EugeneZelenko
added
llvm:optimizations
confirmed
Verified by a second party
crash
Prefer [crash-on-valid] or [crash-on-invalid]
and removed
clang
Clang issues not falling into any other category
labels
Aug 27, 2024
Looks like a regression, does not crash in clang-18: https://godbolt.org/z/1zYqs3sbz |
Reproducer: https://godbolt.org/z/bbdhPxx5E
cc @nikic |
5c4lar
pushed a commit
to 5c4lar/llvm-project
that referenced
this issue
Aug 29, 2024
WideInc/WideIncExpr can be null. Previously this worked out because the comparison with WideIncExpr would fail. Now we have accesses to WideInc prior to that. Avoid the issue with an explicit check. Fixes llvm#106239.
/cherry-pick c9a5e1b |
llvmbot
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Sep 1, 2024
WideInc/WideIncExpr can be null. Previously this worked out because the comparison with WideIncExpr would fail. Now we have accesses to WideInc prior to that. Avoid the issue with an explicit check. Fixes llvm#106239. (cherry picked from commit c9a5e1b)
/pull-request #106892 |
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Sep 3, 2024
WideInc/WideIncExpr can be null. Previously this worked out because the comparison with WideIncExpr would fail. Now we have accesses to WideInc prior to that. Avoid the issue with an explicit check. Fixes llvm#106239. (cherry picked from commit c9a5e1b)
PhilippvK
added a commit
to PhilippvK/CoreDSL2LLVM
that referenced
this issue
Sep 21, 2024
commit a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4 Author: Tobias Hieta <[email protected]> Date: Tue Sep 17 13:26:36 2024 +0200 Bump version to 19.1.0 (final) commit 560ed047d183348b341ffd4e27712c254d82f589 Author: Tobias Hieta <[email protected]> Date: Tue Sep 17 09:39:18 2024 +0200 Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)" This reverts commit 78654faa0c6d9dc2f72b81953b9cffbb7675755b. commit bd4ff65a601895ba816623cddb36ce466cceabe6 Author: Tobias Hieta <[email protected]> Date: Tue Sep 17 09:39:01 2024 +0200 Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)" This reverts commit d752f29fb333d47724484e08b32d6499cc1e460e. commit bdae3c487cbb2b4161e7fbb54a855f0ba55da61a Author: Zaara Syeda <[email protected]> Date: Tue Sep 10 14:14:01 2024 -0400 [PowerPC] Fix assert exposed by PR 95931 in LowerBITCAST (#108062) Hit Assertion failed: Num < NumOperands && "Invalid child # of SDNode!" Fix by checking opcode and value type before calling getOperand. (cherry picked from commit 22067a8eb43a7194e65913b47a9c724fde3ed68f) commit 149a150b50c112e26fc5acbdd58250c44ccd777f Author: Ganesh Gopalasubramanian <[email protected]> Date: Mon Sep 16 11:16:14 2024 +0000 [X86] AMD Zen 5 Initial enablement commit 82e85b62da3f62759ab94aecd0ebac61f3856719 Author: Brian Cain <[email protected]> Date: Fri Sep 13 17:10:03 2024 -0500 [lld] select a default eflags for hexagon (#108431) Empty archives are apparently routine in linux kernel builds, so instead of asserting, we should handle this case with a sane default value. (cherry picked from commit d1ba432533aafc52fc59158350af937a8b6b9538) commit 82f3a4a32d2500ab1e6c51e0d749ffbac9afb1fa Author: Konstantin Varlamov <[email protected]> Date: Fri Sep 13 01:26:57 2024 -0700 Guard an include of `<ostream>` in `<chrono>` with availability macro (#108429) This fixes a regression introduced in https://github.com/llvm/llvm-project/pull/96035. (cherry picked from commit 127c34948bd54e92ef2ee544e8bc42acecf321ad) commit a847b66a750291f8b63c03b9f355c6f4d09cdfe3 Author: Jonathon Penix <[email protected]> Date: Wed Sep 11 09:53:11 2024 -0700 [RISCV] Don't outline pcrel_lo when the function has a section prefix (#107943) GNU ld will error when encountering a pcrel_lo whose corresponding pcrel_hi is in a different section. [1] introduced a check to help prevent this issue by preventing outlining in a few circumstances. However, we can also hit this same issue when outlining from functions with prefixes ("hot"/"unlikely"/"unknown" from profile information, for example) as the outlined function might not have the same prefix, possibly resulting in a "paired" pcrel_lo and pcrel_hi ending up in different sections. To prevent this issue, take a similar approach as [1] and additionally prevent outlining when we see a pcrel_lo and the function has a prefix. [1] https://github.com/llvm/llvm-project/commit/96c85f80f0d615ffde0f85d8270e0a8c9f4e5430 Fixes #107520 (cherry picked from commit 866b93e6b33fac9a4bc62bbc32199bd98f434784) commit 6278084bc69a427cf7a610076817c420e3dc8594 Author: Nikolas Klauser <[email protected]> Date: Wed Sep 11 08:47:24 2024 +0200 [Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (#107815) Fixes #107777 (cherry picked from commit 6dbdb8430b492959c399a7809247424c6962902f) commit d752f29fb333d47724484e08b32d6499cc1e460e Author: hev <[email protected]> Date: Tue Sep 10 16:52:21 2024 +0800 [LoongArch] Eliminate the redundant sign extension of division (#107971) If all incoming values of `div.d` are sign-extended and all users only use the lower 32 bits, then convert them to W versions. Fixes: #107946 (cherry picked from commit 0f47e3aebdd2a4a938468a272ea4224552dbf176) commit 78654faa0c6d9dc2f72b81953b9cffbb7675755b Author: Yingwei Zheng <[email protected]> Date: Tue Sep 10 09:19:39 2024 +0800 [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432) After https://github.com/llvm/llvm-project/pull/92205, LoongArch ISel selects `div.w` for `trunc i64 (sdiv i64 3202030857, (sext i32 X to i64)) to i32`. It is incorrect since `3202030857` is not a signed 32-bit constant. It will produce wrong result when `X == 2`: https://alive2.llvm.org/ce/z/pzfGZZ This patch adds additional `sexti32` checks to operands of `PatGprGpr_32`. Alive2 proof: https://alive2.llvm.org/ce/z/AkH5Mp Fix #107414. (cherry picked from commit a111f9119a5ec77c19a514ec09454218f739454f) commit f0010d131b79a1b401777aa32e96defc4a935c9d Author: R-Goc <[email protected]> Date: Wed Sep 4 20:10:36 2024 +0200 [Windows SEH] Fix crash on empty seh block (#107031) Fixes https://github.com/llvm/llvm-project/issues/105813 and https://github.com/llvm/llvm-project/issues/106915. Adds a check for the end of the iterator, which can be a sentinel. The issue was introduced in https://github.com/llvm/llvm-project/commit/0efe111365ae176671e01252d24028047d807a84 from what I can see, so along with the introduction of /EHa support. (cherry picked from commit 2e0ded3371f8d42f376bdfd4d70687537e36818e) commit 93998aff7662d9b3f94d9627179dffe342e2b399 Author: Jay Foad <[email protected]> Date: Tue Aug 27 17:09:40 2024 +0100 [AMDGPU] Fix sign confusion in performMulLoHiCombine (#105831) SMUL_LOHI and UMUL_LOHI are different operations because the high part of the result is different, so it is not OK to optimize the signed version to MUL_U24/MULHI_U24 or the unsigned version to MUL_I24/MULHI_I24. commit 373180b440d04dc3cc0f6111b06684d18779d7c8 Author: Alexey Bataev <[email protected]> Date: Thu Aug 15 07:21:10 2024 -0700 [SLP]Fix PR104422: Wrong value truncation The minbitwidth restrictions can be skipped only for immediate reduced values, for other nodes still need to check if external users allow bitwidth reduction. Fixes https://github.com/llvm/llvm-project/issues/104422 (cherry picked from commit 56140a8258a3498cfcd9f0f05c182457d43cbfd2) commit 32a8b56bbf0a3c7678d44ba690427915446a9a72 Author: Tom Stellard <[email protected]> Date: Thu Sep 12 09:50:57 2024 -0700 workflows/release-binaries: Fix automatic upload (#107315) (cherry picked from commit ab96409180aaad5417030f06a386253722a99d71) commit 8290ce0998788b6a575ed7b4988b093f48c25b3d Author: cor3ntin <[email protected]> Date: Tue Sep 3 20:36:15 2024 +0200 [Clang] Fix handling of placeholder variables name in init captures (#107055) We were incorrectly not deduplicating results when looking up `_` which, for a lambda init capture, would result in an ambiguous lookup. The same bug caused some diagnostic notes to be emitted twice. Fixes #107024 commit 327ca6c02f0dbf13dd6f039d30d320a7ba1456b8 Author: Owen Pan <[email protected]> Date: Thu Sep 5 23:59:11 2024 -0700 [clang-format] Correctly annotate braces in macro definition (#107352) This reverts commit 2d90e8f7402b0a8114978b6f014cfe76c96c94a1 and backports commit 616a8ce6203d8c7569266bfaf163e74df1f440ad. commit 2651d09ec9c4d87d09ae72d8bf42fab566fb02d0 Author: Hua Tian <[email protected]> Date: Thu Aug 15 19:03:27 2024 +0800 [llvm][CodeGen] Resolve issues when updating live intervals in window scheduler (#101945) Corrupted live interval information can cause window scheduling to crash in some cases. By adding the missing MBB's live interval information in the ModuloScheduleExpander, the information can be correctly analyzed in the window scheduler. (cherry picked from commit 43ba1097ee747b4ec5e757762ed0c9df6255a292) commit f64404e32187a6f45771e72e1b65e99be82acaba Author: Rainer Orth <[email protected]> Date: Sat Aug 3 22:18:11 2024 +0200 [builtins] Fix divtc3.c etc. compilation on Solaris/SPARC with gcc (#101662) `compiler-rt/lib/builtins/divtc3.c` and `multc3.c` don't compile on Solaris/sparcv9 with `gcc -m32`: ``` FAILED: projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-sparc.dir/divtc3.c.o [...] compiler-rt/lib/builtins/divtc3.c: In function ‘__divtc3’: compiler-rt/lib/builtins/divtc3.c:22:18: error: implicit declaration of function ‘__compiler_rt_logbtf’ [-Wimplicit-function-declaration] 22 | fp_t __logbw = __compiler_rt_logbtf( | ^~~~~~~~~~~~~~~~~~~~ ``` and many more. It turns out that while the definition of `__divtc3` is guarded with `CRT_HAS_F128`, the `__compiler_rt_logbtf` and other declarations use `CRT_HAS_128BIT && CRT_HAS_F128` as guard. This only shows up with `gcc` since, as documented in Issue #41838, `clang` violates the SPARC psABI in not using 128-bit `long double`, so this code path isn't used. Fixed by changing the guards to match. Tested on `sparcv9-sun-solaris2.11`. (cherry picked from commit 63a7786111c501920afc4cc27a4633f76cdaf803) commit bb79e7f668456473e13985a8f135cc3a45340fb5 Author: Nicolas van Kempen <[email protected]> Date: Mon Sep 9 07:12:46 2024 -0400 [clang][analyzer] Fix #embed crash (#107764) Fix #107724. (cherry picked from commit d84d9559bdc7aeb4ce14c251f6a3490c66db8d3a) commit 5e1a55eaa0bb592dd04f1b8474b8f064aded7b2e Author: Sander de Smalen <[email protected]> Date: Thu Sep 5 15:06:19 2024 +0100 [AArch64] Disable SVE paired ld1/st1 for callee-saves. The functionality to make use of SVE's load/store pair instructions for the callee-saves is broken because the offsets used in the instructions are incorrect. This is addressed by #105518 but given the complexity of this code and the subtleties around calculating the right offsets, we favour disabling the behaviour altogether for LLVM 19. This fix is critical for any programs being compiled with `+sme2`. commit 42f18eedc2cf2d1f64fd5d78fda376adf39a9b3d Author: Alexey Bataev <[email protected]> Date: Tue Sep 3 04:52:47 2024 -0700 [SLP]Fix PR107036: Check if the type of the user is sizable before requesting its size. Only some instructions should be considered as potentially reducing the size of the operands types, not all instructions should be considered. Fixes https://github.com/llvm/llvm-project/issues/107036 (cherry picked from commit f381cd069965dabfeb277f30a4e532d7fd498f6e) commit 11e2a1552f92ccb080d08083ceb71f7e6ed4db78 Author: Orlando Cazalet-Hyams <[email protected]> Date: Thu Aug 29 14:12:02 2024 +0100 [RemoveDIs] Fix spliceDebugInfo splice-to-end edge case (#105671) Fix #105571 which demonstrates an end() iterator dereference when performing a non-empty splice to end() from a region that ends at Src::end(). Rather than calling Instruction::adoptDbgRecords from Dest, create a marker (which takes an iterator) and absorbDebugValues onto that. The "absorb" variant doesn't clean up the source marker, which in this case we know is a trailing marker, so we have to do that manually. (cherry picked from commit 43661a1214353ea1773a711f403f8d1118e9ca0f) commit 64015eee93062b34df290338c45e87868fa750a9 Author: Hans Wennborg <[email protected]> Date: Mon Sep 9 10:56:37 2024 +0200 Release note about targets built in the Windows packages LLVM_TARGETS_TO_BUILD was set in #106059 commit 52e5a72e9200667e8a62436268fdaff4411f7216 Author: Sander de Smalen <[email protected]> Date: Thu Sep 5 17:54:57 2024 +0100 [AArch64] Remove redundant COPY from loadRegFromStackSlot (#107396) This removes a redundant 'COPY' instruction that #81716 probably forgot to remove. This redundant COPY led to an issue because because code in LiveRangeSplitting expects that the instruction emitted by `loadRegFromStackSlot` is an instruction that accesses memory, which isn't the case for the COPY instruction. (cherry picked from commit 91a3c6f3d66b866bcda8a0f7d4815bc8f2dbd86c) commit 5cf78453b3de39247364ddf97b1c18c011283948 Author: Yingwei Zheng <[email protected]> Date: Wed Sep 4 13:36:32 2024 +0800 [Clang][CodeGen] Don't emit assumptions if current block is unreachable. (#106936) Fixes https://github.com/llvm/llvm-project/issues/106898. When emitting an infinite loop, clang codegen will delete the whole block and leave builder's current block as nullptr: https://github.com/llvm/llvm-project/blob/837ee5b46a5f7f898f0de7e46a19600b896a0a1f/clang/lib/CodeGen/CGStmt.cpp#L597-L600 Then clang will create `zext (icmp slt %a, %b)` without parent block for `a < b`. It will crash here: https://github.com/llvm/llvm-project/blob/837ee5b46a5f7f898f0de7e46a19600b896a0a1f/clang/lib/CodeGen/CGExprScalar.cpp#L416-L420 Even if we disabled this optimization, it still crashes in `Builder.CreateAssumption`: https://github.com/llvm/llvm-project/blob/837ee5b46a5f7f898f0de7e46a19600b896a0a1f/llvm/lib/IR/IRBuilder.cpp#L551-L561 This patch disables assumptions emission if current block is null. (cherry picked from commit c94bd96c277e0b48e198fdc831bb576d9a04aced) commit 82a11e46ce87ea570358e4c25ee445929402a490 Author: cor3ntin <[email protected]> Date: Wed Sep 4 10:02:55 2024 +0200 [Clang] Workaround dependent source location issues (#106925) In #78436 we made some SourceLocExpr dependent to deal with the fact that their value should reflect the name of specialized function - rather than the rtemplate in which they are first used. However SourceLocExpr are unusual in two ways - They don't depend on template arguments - They morally depend on the context in which they are used (rather than called from). It's fair to say that this is quite novels and confuses clang. In particular, in some cases, we used to create dependent SourceLocExpr and never subsequently transform them, leaving dependent objects in instantiated functions types. To work around that we avoid replacing SourceLocExpr when we think they could remain dependent. It's certainly not perfect but it fixes a number of reported bugs, and seem to only affect scenarios in which the value of the SourceLocExpr does not matter (overload resolution). Fixes #106428 Fixes #81155 Fixes #80210 Fixes #85373 --------- Co-authored-by: Aaron Ballman <[email protected]> commit e657e0256509f6f665917904078a5389684fc716 Author: Tom Stellard <[email protected]> Date: Fri Jul 26 07:38:53 2024 -0700 workflows: Fix tag name for release sources job (#100752) (cherry picked from commit 3c2ce7088886a22ab8dc0e9488600c43644b5102) commit 8664666823b3eb8d96fde58f79d71d36bd7f9115 Author: Eli Friedman <[email protected]> Date: Thu Aug 1 16:18:20 2024 -0700 Fix codegen of consteval functions returning an empty class, and related issues (#93115) Fix codegen of consteval functions returning an empty class, and related issues If a class is empty, don't store it to memory: the store might overwrite useful data. Similarly, if a class has tail padding that might overlap other fields, don't store the tail padding to memory. The problem here turned out a bit more general than I initially thought: basically all uses of EmitAggregateStore were broken. Call lowering had a method that did mostly the right thing, though: CreateCoercedStore. Adapt CreateCoercedStore so it always does the conservatively right thing, and use it for both calls and ConstantExpr. Also, along the way, fix the "overlap" bit in AggValueSlot: the bit was set incorrectly for empty classes in some cases. Fixes #93040. (cherry picked from commit 1762e01cca0186f1862db561cfd9019164b8c654) commit 0c641568515a797473394694f05937e1f1913d87 Author: Tobias Hieta <[email protected]> Date: Tue Sep 3 16:09:11 2024 +0200 Bump version to 19.1.0-rc4 commit a01d631a1c2c3902b383b6491f27b72d63f6257b Author: Patryk Wychowaniec <[email protected]> Date: Fri Aug 30 16:50:56 2024 +0200 [AVR] Fix LLD test (#106739) Since we don't generate relocations for those, it doesn't make sense to assert them here; fallout of https://github.com/llvm/llvm-project/pull/106722. (cherry picked from commit a3816b5a573dbf57ba3082a919ca2de6b47257e9) commit 830b7ebac09ebef91671f0863986aee1a1d60e5e Author: Patryk Wychowaniec <[email protected]> Date: Fri Aug 30 15:25:54 2024 +0200 [AVR] Fix parsing & emitting relative jumps (#106722) Ever since 6859685a87ad093d60c8bed60b116143c0a684c7 (or, precisely, 84428dafc0941e3a31303fa1b286835ab2b8e234) relative jumps emitted by the AVR codegen are off by two bytes - this pull request fixes it. ## Abstract As compared to absolute jumps, relative jumps - such as rjmp, rcall or brsh - have an implied `pc+2` behavior; that is, `jmp 100` is `pc = 100`, but `rjmp 100` gets understood as `pc = pc + 100 + 2`. This is not reflected in the AVR codegen: https://github.com/llvm/llvm-project/blob/f95026dbf66e353128a3a3d7b55f3e52d5985535/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp#L89 ... which always emits relative jumps that are two bytes too far - or rather it _would_ emit such jumps if not for this check: https://github.com/llvm/llvm-project/blob/f95026dbf66e353128a3a3d7b55f3e52d5985535/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp#L517 ... which causes most of the relative jumps to be actually resolved late, by the linker, which applies the offsetting logic on its own, hiding the issue within LLVM. [Some time ago](https://github.com/llvm/llvm-project/commit/697a162fa63df328ec9ca334636c5e85390b2bf0) we've had a similar "jumps are off" problem that got solved by touching `shouldForceRelocation()`, but I think that has worked only by accident. It's exploited the fact that absolute vs relative jumps in the parsed assembly can be distinguished through a "side channel" check relying on the existence of labels (i.e. absolute jumps happen to named labels, but relative jumps are anonymous, so to say). This was an alright idea back then, but it got broken by 6859685a87ad093d60c8bed60b116143c0a684c7. I propose a different approach: - when emitting relative jumps, offset them by `-2` (well, `-1`, strictly speaking, because those instructions rely on right-shifted offset), - when parsing relative jumps, treat `.` as `+2` and read `rjmp .+1234` as `rjmp (1234 + 2)`. This approach seems to be sound and now we generate the same assembly as avr-gcc, which can be confirmed with: ```cpp // avr-gcc test.c -O3 && avr-objdump -d a.out int main() { asm( " foo:\n\t" " rjmp .+2\n\t" " rjmp .-2\n\t" " rjmp foo\n\t" " rjmp .+8\n\t" " rjmp end\n\t" " rjmp .+0\n\t" " end:\n\t" " rjmp .-4\n\t" " rjmp .-6\n\t" " x:\n\t" " rjmp x\n\t" " .short 0xc00f\n\t" ); } ``` avr-gcc is also how I got the opcodes for all new tests like `inst-brbc.s`, so we should be good. (cherry picked from commit 86a60e7f1e8f361f84ccb6e656e848dd4fbaa713) commit f3da9af3fd2696fbbe437dea599eda088fcb5592 Author: Jeremy Morse <[email protected]> Date: Mon Sep 2 11:56:40 2024 +0100 [DebugInfo][RemoveDIs] Find types hidden in DbgRecords (#106547) When serialising to textual IR, there can be constant Values referred to by DbgRecords that don't appear anywhere else, and have types hidden even deeper in side them. Enumerate these when enumerating all types. Test by Mikael Holmén. (cherry picked from commit 25f87f2d703178bb4bc13a62cb3df001b186cba2) commit 2d90e8f7402b0a8114978b6f014cfe76c96c94a1 Author: Owen Pan <[email protected]> Date: Mon Sep 2 01:40:13 2024 -0700 [clang-format] Correctly annotate braces in macro definition (#106662) Fixes #106418. (cherry picked from commit 0fa78b6c7bd43c2498700a98c47a02cf4fd06388) commit e594b284810c73b09da9436fdc6f1cbbfb4a7924 Author: Nikita Popov <[email protected]> Date: Wed Aug 28 12:54:14 2024 +0200 [IndVars] Check if WideInc available before trying to use it WideInc/WideIncExpr can be null. Previously this worked out because the comparison with WideIncExpr would fail. Now we have accesses to WideInc prior to that. Avoid the issue with an explicit check. Fixes https://github.com/llvm/llvm-project/issues/106239. (cherry picked from commit c9a5e1b665dbba898e9981fd7d48881947e6560e) commit e3abd19242dd908e6186639d091f6ecc219963f0 Author: Martin Storsjö <[email protected]> Date: Thu Aug 8 13:51:07 2024 +0300 [compiler-rt] Support building runtimes for Windows on arm32 (#101462) In these environments, the architecture name is armv7; recognize that and enable the relevant runtimes. Fix building the sanitizer_common library for this target, by using the right registers for the architecture - this is similar to what 0c391133c9201ef29273554a1505ef855ce17668 did for aarch64. (Still, address sanitizer doesn't support hooking functions at runtime on armv7 or aarch64 - but other runtimes such as ubsan do work.) (cherry picked from commit 5ea9dd8c7076270695a1d90b9c73718e7d95e0bf) commit 9b6180ed2ecbbb54f26caa78082e7b955a634117 Author: kadir çetinkaya <[email protected]> Date: Mon Sep 2 15:25:26 2024 +0200 [clangd] Update TidyFastChecks for release/19.x (#106354) Run for clang-tidy checks available in release/19.x branch. Some notable findings: - altera-id-dependent-backward-branch, stays slow with 13%. - misc-const-correctness become faster, going from 261% to 67%, but still above 8% threshold. - misc-header-include-cycle is a new SLOW check with 10% runtime implications - readability-container-size-empty went from 16% to 13%, still SLOW. (cherry picked from commit b47d7ce8121b1cb1923e879d58eaa1d63aeaaae2) commit d9cb501ec0012de5d4e1c6310df55f4e8af011a9 Author: Hans <[email protected]> Date: Mon Sep 2 15:04:13 2024 +0200 Win release packaging: Don't try to use rpmalloc for 32-bit x86 (#106969) because that doesn't work (results in `LINK : error LNK2001: unresolved external symbol malloc`). Based on the title of #91862 it was only intended for use in 64-bit builds. (cherry picked from commit ef26afcb88dcb5f2de79bfc3cf88a8ea10f230ec) commit 95fa0bee9314a878b3a58d748998c3b3ef42bd75 Author: Owen Pan <[email protected]> Date: Thu Aug 29 19:14:19 2024 -0700 [clang-format] Correctly identify token-pasted record names (#106484) See https://github.com/llvm/llvm-project/pull/89706#issuecomment-2315549955. (cherry picked from commit 7579787e05966f21684dd4b4a15b9deac13d09e1) commit 6d7e428df611861fb1f5151dea938ebfcc7b1363 Author: OverMighty <[email protected]> Date: Fri Aug 30 12:59:05 2024 +0200 [builtins] Fix missing main() function in float16/bfloat16 support checks (#104478) The CMake docs state that `check_c_source_compiles()` checks whether the supplied code "can be compiled as a C source file and linked as an executable (so it must contain at least a `main()` function)." https://cmake.org/cmake/help/v3.30/module/CheckCSourceCompiles.html In practice, this command is a wrapper around `try_compile()`: - https://gitlab.kitware.com/cmake/cmake/blob/2904ce00d2ed6ad5dac6d3459af62d8223e06ce0/Modules/CheckCSourceCompiles.cmake#L54 - https://gitlab.kitware.com/cmake/cmake/blob/2904ce00d2ed6ad5dac6d3459af62d8223e06ce0/Modules/Internal/CheckSourceCompiles.cmake#L101 When `CMAKE_SOURCE_DIR` is compiler-rt/lib/builtins/, `CMAKE_TRY_COMPILE_TARGET_TYPE` is set to `STATIC_LIBRARY`, so the checks for `float16` and `bfloat16` support work as intended in a Clang + compiler-rt runtime build for example, as it runs CMake recursively from that directory. However, when using llvm/ or compiler-rt/ as CMake source directory, as `CMAKE_TRY_COMPILE_TARGET_TYPE` defaults to `EXECUTABLE`, these checks will indeed fail if the code doesn't have a `main()` function. This results in LLVM using x86 SIMD registers when generating calls to builtins that, with Arch Linux's compiler-rt package for example, actually use a GPR for their argument or return value as they use `uint16_t` instead of `_Float16`. This had been caught in post-commit review: https://reviews.llvm.org/D145237#4521152. Use of the internal `CMAKE_C_COMPILER_WORKS` variable is not what hides the issue, however. PR #69842 tried to fix this by unconditionally setting `CMAKE_TRY_COMPILE_TARGET_TYPE` to `STATIC_LIBRARY`, but it apparently caused other issues, so it was reverted. This PR just adds a `main()` function in the checks, as per the CMake docs. (cherry picked from commit 68d8b3846ab1e6550910f2a9a685690eee558af2) commit f131edf6fbe8e2ab7306aba72698daa6153ec91e Author: Avi Kivity <[email protected]> Date: Mon Aug 26 17:56:45 2024 +0300 [Instrumentation] Fix EdgeCounts vector size in SetBranchWeights (#99064) (cherry picked from commit 46a4132e167aa44d8ec7776262ce2a0e6d47de59) commit 1ccd19c4b297e9a2bd1b2bb6bbb9d9ad2acbab40 Author: Owen Pan <[email protected]> Date: Fri Aug 30 19:23:45 2024 -0700 [clang-format] Correctly annotate braces in ObjC square brackets (#106654) See https://github.com/llvm/llvm-project/pull/88238#issuecomment-2316954781. (cherry picked from commit e0f2368cdeb7312973a92fb2d22199d1de540db8) commit 6f623478d48c171d59e95b25ea2aca49dca8f135 Author: Ties Stuij <[email protected]> Date: Tue Jul 23 14:09:34 2024 +0100 [libcxx] don't `#include <cwchar>` if wide chars aren't enabled (#99911) Pull request #96032 unconditionall adds the `cwchar` include in the `format` umbrella header. However support for wchar_t can be disabled in the build system (LIBCXX_ENABLE_WIDE_CHARACTERS). This patch guards against inclusion of `cwchar` in `format` by checking the `_LIBCPP_HAS_NO_WIDE_CHARACTERS` define. For clarity I've also merged the include header section that `cwchar` was in with the one above as they were both guarded by the same `#if` logic. (cherry picked from commit ec56790c3b27df4fa1513594ca9a74fd8ad5bf7f) commit e1be8cf8723e8577abaeef586ec4c39f30053913 Author: Orlando Cazalet-Hyams <[email protected]> Date: Wed Aug 28 14:20:33 2024 +0100 [RemoveDIs] Simplify spliceDebugInfo, fixing splice-to-end edge case (#105670) Not quite NFC, fixes splitBasicBlockBefore case when we split before an instruction with debug records (but without the headBit set, i.e., we are splitting before the instruction but after the debug records that come before it). splitBasicBlockBefore splices the instructions before the split point into a new block. Prior to this patch, the debug records would get shifted up to the front of the spliced instructions (as seen in the modified unittest - I believe the unittest was checking erroneous behaviour). We instead want to leave those debug records at the end of the spliced instructions. The functionality of the deleted `else if` branch is covered by the remaining `if` now that `DestMarker` is set to the trailing marker if `Dest` is `end()`. Previously the "===" markers were sometimes detached, now we always detach them and always reattach them. Note: `deleteTrailingDbgRecords` only "unlinks" the tailing marker from the block, it doesn't delete anything. The trailing marker is still cleaned up properly inside the final `if` body with `DestMarker->eraseFromParent();`. Part 1 of 2 needed for #105571 (cherry picked from commit f5815534d180c544bffd46f09c28b6fc334260fb) commit 894ec4e3a1d56a5dd5a8205b4fd734136db87cfd Author: Luke Shingles <[email protected]> Date: Thu Aug 29 11:09:07 2024 +0100 [analyzer] Add missing include <unordered_map> to llvm/lib/Support/Z3Solver.cpp (#106410) Resolves #106361. Adding #include <unordered_map> to llvm/lib/Support/Z3Solver.cpp fixes compilation errors for homebrew build on macOS with Xcode 14. https://github.com/Homebrew/homebrew-core/actions/runs/10604291631/job/29390993615?pr=181351 shows that this is resolved when the include is patched in (Linux CI failure is due to unrelated timeout). (cherry picked from commit fcb3a0485857c749d04ea234a8c3d629c62ab211) commit 03cc174e0307ec90091c31c621bd6cee4338c4da Author: Corentin Jabot <[email protected]> Date: Thu Aug 29 11:11:39 2024 +0200 Revert "[clang] fix broken canonicalization of DeducedTemplateSpecializationType (#95202)" This reverts commit 2e1ad93961a3f444659c5d02d800e3144acccdb4. Reverting #95202 in the 19.x branch Fixes #106182 The change in #95202 causes code to crash and there is no good way to backport a fix for that as there are ABI-impacting changes at play. Instead we revert #95202 in the 19x branch, fixing the regression and preserving the 18.x behavior (which is GCC's behavior) https://github.com/llvm/llvm-project/pull/106335#discussion_r1735174841 commit c8c66e01d83323a3db57fade24befb26b0e6fe84 Author: Chuanqi Xu <[email protected]> Date: Thu Aug 29 15:42:57 2024 +0800 [C++20] [Modules] Don't insert class not in named modules to PendingEmittingVTables (#106501) Close https://github.com/llvm/llvm-project/issues/102933 The root cause of the issue is an oversight in https://github.com/llvm/llvm-project/pull/102287 that I didn't notice that PendingEmittingVTables should only accept classes in named modules. (cherry picked from commit 47615ff2347a8be429404285de3b1c03b411e7af) commit 72a74e44ef6f27c10a2da55fa67bde22d52516c6 Author: Tom Stellard <[email protected]> Date: Wed Aug 28 22:18:08 2024 -0700 workflows/release-tasks: Pass required secrets to all called workflows (#106286) Called workflows don't have access to secrets by default, so we need to explicitly pass secrets that we use. (cherry picked from commit 9d81e7e36e33aecdee05fef551c0652abafaa052) commit bac3db3c8b41c921d8ec895a9dc89ce310a670cb Author: Owen Pan <[email protected]> Date: Wed Aug 28 18:23:54 2024 -0700 [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (#105923) …519)" This reverts commit e00d32afb9d33a1eca48e2b041c9688436706c5b and adds a test for lambda arrow SplitPenalty. Fixes #105480. commit 491375504831aae3da85ffb288ca3c8b3c94b1ea Author: Joseph Huber <[email protected]> Date: Tue Aug 6 21:33:25 2024 -0500 Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (#102226) This reverts commit 90ccf2187332ff900d46a58a27cb0353577d37cb. Fixes: https://github.com/llvm/llvm-project/issues/100212 (cherry picked from commit 030ee841a9c9fbbd6e7c001e751737381da01f7b) Conflicts: clang/test/Driver/linker-wrapper-passes.c commit f88180bbc489a587954adfce40cc5c90adc74962 Author: Krasimir Georgiev <[email protected]> Date: Wed Aug 28 13:45:17 2024 +0200 [clang-format] js handle anonymous classes (#106242) Addresses a regression in JavaScript when formatting anonymous classes. --------- Co-authored-by: Owen Pan <[email protected]> (cherry picked from commit 77d63cfd18aa6643544cf7acd5ee287689d54cca) commit 9ec54c307b6151b1ddb3f7fe3b7cba4d9309b26c Author: Owen Pan <[email protected]> Date: Tue Aug 27 19:13:27 2024 -0700 [clang-format] Fix misalignments of pointers in angle brackets (#106013) Fixes #105898. (cherry picked from commit 656d5aa95825515a55ded61f19d41053c850c82d) commit 32927ca57e805681fa93ed913c0f0d3c075563b7 Author: Alexander Richardson <[email protected]> Date: Tue Aug 27 15:37:24 2024 -0700 [compiler-rt] Fix definition of `usize` on 32-bit Windows 32-bit Windows uses `unsigned int` for uintptr_t and size_t. Commit 18e06e3e2f3d47433e1ed323b8725c76035fc1ac changed uptr to unsigned long, so it no longer matches the real size_t/uintptr_t and therefore the current definition of usize result in: `error C2821: first formal parameter to 'operator new' must be 'size_t'` However, the real problem is that uptr is wrong to work around the fact that we have local SIZE_T and SSIZE_T typedefs that trample on the basetsd.h definitions of the same name and therefore need to match exactly. Unlike size_t/ssize_t the uppercase ones always use unsigned long (even on 32-bit). This commit works around the build breakage by keeping the existing definitions of uptr/sptr and just changing usize. A follow-up change will attempt to fix this properly. Fixes: https://github.com/llvm/llvm-project/issues/101998 Reviewed By: mstorsjo Pull Request: https://github.com/llvm/llvm-project/pull/106151 (cherry picked from commit bb27dd853a713866c025a94ead8f03a1e25d1b6e) commit 6883c490e04a0f681b95e32eaa74aa82458bdb28 Author: Louis Dionne <[email protected]> Date: Tue Aug 27 14:22:25 2024 -0400 [libc++] Add missing include to three_way_comp_ref_type.h We were using a `_LIBCPP_ASSERT_FOO` macro without including `<__assert>`. rdar://134425695 (cherry picked from commit 0df78123fdaed39d5135c2e4f4628f515e6d549d) commit 52ab956704050302926e8afe1c7dbda4578acb9d Author: Younan Zhang <[email protected]> Date: Tue Aug 27 09:25:53 2024 +0800 [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (#89934) In the last patch #82310, we used template depths to tell if such alias decls contain lambdas, which is wrong because the lambda can also appear as a part of the default argument, and that would make `getTemplateInstantiationArgs` provide extra template arguments in undesired contexts. This leads to issue #89853. Moreover, our approach for https://github.com/llvm/llvm-project/issues/82104 was sadly wrong. We tried to teach `DeduceReturnType` to consider alias template arguments; however, giving these arguments in the context where they should have been substituted in a `TransformCallExpr` call is never correct. This patch addresses such problems by using a `RecursiveASTVisitor` to check if the lambda is contained by an alias `Decl`, as well as twiddling the lambda dependencies - we should also build a dependent lambda expression if the surrounding alias template arguments were dependent. Fixes #89853 Fixes #102760 Fixes #105885 (cherry picked from commit b412ec5d3924c7570c2c96106f95a92403a4e09b) commit 456006bc91c3d972f3c549b6296cad5e83630c7d Author: SpencerAbson <[email protected]> Date: Fri Aug 23 14:27:49 2024 +0100 [clang][AArch64] Add SME2.1 feature macros (#105657) (cherry picked from commit 2617023923175b0fd2a8cb94ad677c061c01627f) commit ed699666de2d82eab266bf41372175da73202834 Author: Zaara Syeda <[email protected]> Date: Thu Aug 22 09:55:46 2024 -0400 [PowerPC] Fix mask for __st[d/w/h/b]cx builtins (#104453) These builtins are currently returning CR0 which will have the format [0, 0, flag_true_if_saved, XER]. We only want to return flag_true_if_saved. This patch adds a shift to remove the XER bit before returning. (cherry picked from commit 327edbe07ab4370ceb20ea7c805f64950871d835) commit d9806ffe4e4d26de9c01f6b8ac0deae169b1d88d Author: Owen Pan <[email protected]> Date: Sat Aug 24 20:10:03 2024 -0700 [clang-format] Fix a misannotation of less/greater as angle brackets (#105941) Fixes #105877. (cherry picked from commit 0916ae49b89db6eb9eee9f6fee4f1a65fd9cdb74) commit 1b1ddb767e430a29c35c8b12760b7aa21f508d15 Author: Owen Pan <[email protected]> Date: Sat Aug 24 19:12:15 2024 -0700 [clang-format] Fix a misannotation of redundant r_paren as CastRParen (#105921) Fixes #105880. (cherry picked from commit 6bc225e0630f28e83290a43c3d9b25b057fc815a) commit 00ff55d61c765467e9a72c0fd570343d3cfb3b43 Author: Ian Anderson <[email protected]> Date: Thu Aug 22 13:44:58 2024 -0700 [libunwind] Stop installing the mach-o module map (#105616) libunwind shouldn't know that compact_unwind_encoding.h is part of a MachO module that it doesn't own. Delete the mach-o module map, and let whatever is in charge of the mach-o directory be the one to say how its module is organized and where compact_unwind_encoding.h fits in. (cherry picked from commit 172c4a4a147833f1c08df1555f3170aa9ccb6cbe) commit 09cca6b1897d501020c02769f9a937401f13e37a Author: Jay Foad <[email protected]> Date: Fri Aug 23 10:31:33 2024 +0100 [AMDGPU] Remove one case of vmcnt loop header flushing for GFX12 (#105550) When a loop contains a VMEM load whose result is only used outside the loop, do not bother to flush vmcnt in the loop head on GFX12. A wait for vmcnt will be required inside the loop anyway, because VMEM instructions can write their VGPR results out of order. (cherry picked from commit fa2dccb377d0b712223efe5b62e5fc633580a9e6) commit 441fb41cb487d286977b7e1cdabc3efe4c2010cf Author: Jay Foad <[email protected]> Date: Thu Aug 22 11:46:51 2024 +0100 [AMDGPU] GFX12 VMEM loads can write VGPR results out of order (#105549) Fix SIInsertWaitcnts to account for this by adding extra waits to avoid WAW dependencies. (cherry picked from commit 5506831f7bc8dc04ebe77f4d26940007bfb4ab39) commit daea6b9c40a1ee9d44f5658c182094147bb78340 Author: Jay Foad <[email protected]> Date: Thu Aug 22 11:42:57 2024 +0100 [AMDGPU] Add GFX12 test coverage for vmcnt flushing in loop headers (#105548) (cherry picked from commit 61194617ad7862f144e0f6db34175553e8c34763) commit 3f768dd6806aeca74bfdf21bde9135d96b137ef3 Author: Maciej Gabka <[email protected]> Date: Thu Aug 22 12:40:01 2024 +0000 Add release note about ABI implementation changes for _BitInt on Arm commit 45b149d2531948d2cc0e9d699a8e5371360a3bdf Author: Tim Gymnich <[email protected]> Date: Thu Aug 8 02:51:04 2024 +0200 [PowerPC] Respect endianness when bitcasting to fp128 (#95931) Fixes #92246 Match the behaviour of `bitcast v2i64 (BUILD_PAIR %lo %hi)` when encountering `bitcast fp128 (BUILD_PAIR %lo $hi)`. by inserting a missing swap of the arguments based on endianness. ### Current behaviour: **fp128** bitcast fp128 (BUILD_PAIR %lo $hi) => BUILD_FP128 %lo %hi BUILD_FP128 %lo %hi => MTVSRDD %hi %lo **v2i64** bitcast v2i64 (BUILD_PAIR %lo %hi) => BUILD_VECTOR %hi %lo BUILD_VECTOR %hi %lo => MTVSRDD %lo %hi (cherry picked from commit 408d82d352eb98e2d0a804c66d359cd7a49228fe) commit 40b076410194df3783b0c9cefa9f018fb190bdff Author: alx32 <[email protected]> Date: Wed Aug 14 19:30:41 2024 -0700 [lld-macho] Fix crash: ObjC category merge + relative method lists (#104081) A crash was happening when both ObjC Category Merging and Relative method lists were enabled. ObjC Category Merging creates new data sections and adds them by calling `addInputSection`. `addInputSection` uses the symbols within the added section to determine which container to actually add the section to. The issue is that ObjC Category merging is calling `addInputSection` before actually adding the relevant symbols the the added section. This causes `addInputSection` to add the `InputSection` to the wrong container, eventually resulting in a crash. To fix this, we ensure that ObjC Category Merging calls `addInputSection` only after the symbols have been added to the `InputSection`. (cherry picked from commit 0df91893efc752a76c7bbe6b063d66c8a2fa0d55) commit 78f97e22e5d87f9efc6b2c0ec76f60667458ca8a Author: Balazs Benics <[email protected]> Date: Wed Aug 21 14:24:56 2024 +0200 [analyzer] Limit `isTainted()` by skipping complicated symbols (#105493) As discussed in https://discourse.llvm.org/t/rfc-make-istainted-and-complex-symbols-friends/79570/10 Some `isTainted()` queries can blow up the analysis times, and effectively halt the analysis under specific workloads. We don't really have the time now to do a caching re-implementation of `isTainted()`, so we need to workaround the case. The workaround with the smallest blast radius was to limit what symbols `isTainted()` does the query (by walking the SymExpr). So far, the threshold 10 worked for us, but this value can be overridden using the "max-tainted-symbol-complexity" config value. This new option is "deprecated" from the getgo, as I expect this issue to be fixed within the next few months and I don't want users to override this value anyways. If they do, this message will let them know that they are on their own, and the next release may break them (as we no longer recognize this option if we drop it). Mitigates #89720 CPP-5414 (cherry picked from commit 848658955a9d2d42ea3e319d191e2dcd5d76c837) commit 54579830d81a67cfa52b90c34bcf9a631f53fcc5 Author: Kai Yan <[email protected]> Date: Mon Aug 5 17:44:05 2024 +0800 [llvm][CodeGen] Address the issue of multiple resource reservations In window scheduling (#101665) Address the issue of multiple resource reservations in window scheduling. commit 5a164a28e37fe3cda99236595167f7762b47c76d Author: Kai Yan <[email protected]> Date: Wed Jul 24 12:06:10 2024 +0800 [llvm][CodeGen] Fixed max cycle calculation with zero-cost instructions for window scheduler (#99454) We discovered some scheduling failures occurring when zero-cost instructions were involved. This issue will be addressed by this patch. commit 06d009789f771e8cef82714549c3136e320312be Author: Kai Yan <[email protected]> Date: Thu Jul 25 19:16:23 2024 +0800 [llvm][CodeGen] Fixed a bug in stall cycle calculation for window scheduler (#99451) Fixed a bug in stall cycle calculation. When a register defined by an instruction in the current iteration is used by an instruction in the next iteration, we have modified the number of stall cycle that need to be inserted. commit 7b86034dcb8c7fd7ea125cec43f0117cd4a428b6 Author: Kai Yan <[email protected]> Date: Wed Jul 24 12:11:58 2024 +0800 [llvm][CodeGen] Added a new restriction for II by pragma in window scheduler (#99448) Added a new restriction for window scheduling. Window scheduling is disabled when llvm.loop.pipeline.initiationinterval is set. commit e81188d58202ee7b887e48bc3e4b102fc5f45619 Author: Kai Yan <[email protected]> Date: Wed Jul 24 12:06:35 2024 +0800 [llvm][CodeGen] Added missing initialization failure information for window scheduler (#99449) Added missing initialization failure information for window scheduler. commit 816fde1cbb700ebcc8b3df81fb93d675c04c12cd Author: Michał Górny <[email protected]> Date: Thu Aug 29 20:57:25 2024 +0200 [clang] Install scan-build-py into plain "lib" directory (#106612) Install scan-build-py modules into the plain `lib` directory, without LLVM_LIBDIR_SUFFIX appended, to match the path expected by `intercept-build` executable. This fixes the program being unable to find its modules. Using unsuffixed path makes sense here, since Python modules are not subject to multilib. This change effectively reverts 1334e129a39cb427e7b855e9a711a3e7604e50e5. The commit in question changed the path without a clear justification ("does not respect the given prefix") and the Python code was never modified to actually work with the change. Fixes #106608 (cherry picked from commit 0c4cf79defe30d43279bf4526cdf32b6c7f8a197) commit c21b039178b2efd17bc4eef906ab7b3a07cab288 Author: Tom Stellard <[email protected]> Date: Fri Aug 30 19:46:33 2024 -0700 workflows/release-binaries: Remove .git/config file from artifacts (#106310) The .git/config file contains an auth token that can be leaked if the .git directory is included in a workflow artifact. (cherry picked from commit ef50970204384643acca42ba4c7ca8f14865a0c2) commit eba1ef5a1b7a84ed1954797dcd6d6f073b1f1a56 Author: Ahmed Bougacha <[email protected]> Date: Thu Aug 29 09:50:44 2024 -0700 [AArch64] Make apple-m4 armv8.7-a again (from armv9.2-a). (#106312) This is a partial revert of c66e1d6f3429. Even though that allowed us to declare v9.2-a support without picking up SVE2 in both the backend and the driver, the frontend itself still enabled SVE via the arch version's default extensions. Avoid that by reverting back to v8.7-a while we look into longer-term solutions. (cherry picked from commit e5e38ddf1b8043324175868831da21e941c00aff) commit 1b643dbad74986718460f28347cbd17085402383 Author: Hans <[email protected]> Date: Thu Aug 29 13:54:30 2024 +0200 Restrict LLVM_TARGETS_TO_BUILD in Windows release packaging (#106059) When including all targets, some files become too large for the NSIS installer to handle. Fixes #101994 (cherry picked from commit 2a28df66dc3f7ff5b6233241837854acefb68d77) commit 53c43bab2077644ecf152bebffd921572e418692 Author: Nathan Ridge <[email protected]> Date: Sun Aug 25 02:10:45 2024 -0400 [clangd] Add clangd 19 release notes commit 5f744ee5c770d7332740bb6247f961e7d99ee359 Author: Dan Gohman <[email protected]> Date: Thu Aug 22 08:13:20 2024 -0700 [DwarfEhPrepare] Assign dummy debug location for more inserted _Unwind_Resume calls (#105513) Similar to the fix for #57469, ensure that the other `_Unwind_Resume` call emitted by DwarfEHPrepare has a debug location if needed. This fixes https://github.com/nbdd0121/unwinding/issues/34. (cherry picked from commit e76db25832d6ac2d3a36769b26f982d9dee4b346) commit cfe8eb89cbb8b8d873579123555a5238d9ad502c Author: Simon Pilgrim <[email protected]> Date: Thu Aug 1 16:08:33 2024 +0100 [MCA][X86] Add missing 512-bit vpscatterqd/vscatterqps schedule data (REAPPLIED) This doesn't match uops.info yet - but it matches the existing vpscatterdq/vscatterqpd entries like uops.info says it should Reapplied with codegen fix for scatter-schedule.ll Fixes #105675 (cherry picked from commit cf6cd1fd67356ca0c2972992928592d2430043d2) commit 3ff9d92aae0945daa85ec6f85f05a3aeaaa9f962 Author: Yingwei Zheng <[email protected]> Date: Fri Aug 23 16:06:00 2024 +0800 [ConstraintElim] Fix miscompilation caused by PR97974 (#105790) Fixes https://github.com/llvm/llvm-project/issues/105785. (cherry picked from commit 85b6aac7c25f9d2a976a76045ace1e7afebb5965) commit 1241c762c165972690c4edfb82ec7421c1e64658 Author: Owen Pan <[email protected]> Date: Thu Aug 22 20:02:48 2024 -0700 [clang-format] Don't insert a space between :: and * (#105043) Also, don't insert a space after ::* for method pointers. See https://github.com/llvm/llvm-project/pull/86253#issuecomment-2298404887. Fixes #100841. (cherry picked from commit 714033a6bf3a81b1350f969ddd83bcd9fbb703e8) commit 1503d18171e569996bf3e107364b1f0fd5f750e9 Author: Simon Pilgrim <[email protected]> Date: Tue Aug 20 11:11:33 2024 +0100 [X86] Use correct fp immediate types in _mm_set_ss/sd Avoids implicit sint_to_fp which wasn't occurring on strict fp codegen Fixes #104848 (cherry picked from commit 6dcce422ca06601f2b00e85cc18c745ede245ca6) commit b6a562d90fa08543171bafbb9c897c03f6cf691f Author: Björn Pettersson <[email protected]> Date: Wed Aug 21 17:56:27 2024 +0200 [DAGCombiner] Fix ReplaceAllUsesOfValueWith mutation bug in visitFREEZE (#104924) In visitFREEZE we have been collecting a set/vector of MaybePoisonOperands that later was iterated over, applying a freeze to those operands. However, C-level fuzzy testing has discovered that the recursiveness of ReplaceAllUsesOfValueWith may cause later operands in the MaybePoisonOperands vector to be replaced when replacing an earlier operand. That would then turn up as Assertion `N1.getOpcode() != ISD::DELETED_NODE && "Operand is DELETED_NODE!"' failed. failures when trying to freeze those later operands. So we need to make sure that the vector with MaybePoisonOperands is mutated as well when needed. Or as the solution used in this patch, make sure to keep track of operand numbers that should be frozen instead of having a vector of SDValues. And then we can refetch the operands while iterating over operand numbers. The problem was seen after adding SELECT_CC to the set of operations including in "AllowMultipleMaybePoisonOperands". I'm not sure, but I guess that this could happen for other operations as well for which we allow multiple maybe poison operands. (cherry picked from commit 278fc8efdf004a1959a31bb4c208df5ee733d5c8) commit 43b455b2d2e5107e19d7d47e77ba513d1f9f5e2f Author: Carl Ritson <[email protected]> Date: Sat Aug 17 16:52:38 2024 +0900 [AMDGPU] Disable inline constants for pseudo scalar transcendentals (#104395) Prevent operand folding from inlining constants into pseudo scalar transcendental f16 instructions. However still allow literal constants. (cherry picked from commit fc6300a5f7ef430e4ec86d16be0b146de7fbd16b) commit 38f3dbefab0a4965abad99aa23eced96d5d8dc16 Author: Bryce Kahle <[email protected]> Date: Tue Aug 20 12:25:33 2024 -0700 use default intrinsic attrs for BPF packet loads The BPF packet load intrinsics lost attribute WillReturn due to 0b20c30. The attribute loss causes excessive bitshifting, resulting in previously working programs failing the BPF verifier due to instruction/complexity limits. cherry picked only the BPF changes from 99a10f1 Signed-off-by: Bryce Kahle <[email protected]> commit 6420a2ea06b6fc21547907eb447035be3e2b6b16 Author: Amy Kwan <[email protected]> Date: Tue Aug 20 10:30:09 2024 -0500 Add AIX/PPC Clang/LLVM release notes for LLVM 19. commit 8ea372d8b628b0a11016f5282d47c372e3843b93 Author: Koakuma <[email protected]> Date: Tue Aug 20 20:05:06 2024 +0700 [SPARC] Remove assertions in printOperand for inline asm operands (#104692) Inline asm operands could contain any kind of relocation, so remove the checks. Fixes https://github.com/llvm/llvm-project/issues/103493 (cherry picked from commit 576b7a781aac6b1d60a72248894b50e565e9185a) commit 9dc4bdf9fd1e4be051fe19998d64230d999b777d Author: Ian Anderson <[email protected]> Date: Tue Aug 20 03:29:11 2024 -0700 [clang][modules] Built-in modules are not correctly enabled for Mac Catalyst (#104872) Mac Catalyst is the iOS platform, but it builds against the macOS SDK and so it needs to be checking the macOS SDK version instead of the iOS one. Add tests against a greater-than SDK version just to make sure this works beyond the initially supporting SDKs. (cherry picked from commit b9864387d9d00e1d4888181460d05dbc92364d75) commit 9301cd5b57c09214256edf19753e2e047a5b5f91 Author: Rainer Orth <[email protected]> Date: Tue Jul 30 10:06:45 2024 +0200 [sanitizer_common] Make sanitizer_linux.cpp kernel_stat* handling Linux-specific fcd6bd5587cc376cd8f43b60d1c7d61fdfe0f535 broke the Solaris/sparcv9 buildbot: ``` compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:39:14: fatal error: 'asm/unistd.h' file not found 39 | # include <asm/unistd.h> | ^~~~~~~~~~~~~~ ``` That section should have been Linux-specific in the first place, which is what this patch does. Tested on sparcv9-sun-solaris2.11. (cherry picked from commit 16e9bb9cd7f50ae2ec7f29a80bc3b95f528bfdbf) commit 437434df21d839becb453f6821564662e9824f02 Author: Tobias Hieta <[email protected]> Date: Tue Aug 20 10:06:55 2024 +0200 Bump version to 19.1.0-rc3 commit 72d2932da5a7c70885a1fdfaa809ff1ede0984ff Author: John Brawn <[email protected]> Date: Thu Aug 8 11:20:09 2024 +0100 [libunwind] Fix problems caused by combining BTI and GCS (#102322) The libunwind assembly files need adjustment in order to work correctly when both BTI and GCS are both enabled (which will be the case when using -mbranch-protection=standard): * __libunwind_Registers_arm64_jumpto can't use br to jump to the return location, instead we need to use gcspush then ret. * Because we indirectly call __libunwind_Registers_arm64_jumpto it needs to start with bti jc. * We need to set the GCS GNU property bit when it's enabled. --------- Co-authored-by: Daniel Kiss <[email protected]> (cherry picked from commit 39529107b46032ef0875ac5b809ab5b60cd15a40) commit c3da16b094511e42022e534b5eb665dbc3f8db0f Author: John Brawn <[email protected]> Date: Mon Aug 5 18:54:05 2024 +0100 [libunwind] Be more careful about enabling GCS (#101973) We need both GCS to be enabled by the compiler (which we do by checking if __ARM_FEATURE_GCS_DEFAULT is defined) and for arm_acle.h to define the GCS intrinsics. Check the latter by checking if _CHKFEAT_GCS is defined. (cherry picked from commit c649194a71b47431f2eb2e041435d564e3b51072) commit 7e7e8125cfabf7daf5de63612e6f2c646dd8cad3 Author: John Brawn <[email protected]> Date: Sun Aug 4 13:27:12 2024 +0100 [libunwind] Add GCS support for AArch64 (#99335) AArch64 GCS (Guarded Control Stack) is similar enough to CET that we can re-use the existing code that is guarded by _LIBUNWIND_USE_CET, so long as we also add defines to locate the GCS stack and pop the entries from it. We also need the jumpto function to exit using br instead of ret, to prevent it from popping the GCS stack. GCS support is enabled using the LIBUNWIND_ENABLE_GCS cmake option. This enables -mbranch-protection=standard, which enables GCS. For the places we need to use GCS instructions we use the target attribute, as there's not a command-line option to enable a specific architecture extension. (cherry picked from commit b32aac4358c1f6639de7c453656cd74fbab75d71) commit 64b8514e6c1a663660fbb93ec7f623b3e40a2020 Author: Chuanqi Xu <[email protected]> Date: Thu Aug 8 13:14:09 2024 +0800 Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (#102287) Reland https://github.com/llvm/llvm-project/pull/75912 The differences of this PR between https://github.com/llvm/llvm-project/pull/75912 are: - Fixed a regression in `Decl::isInAnotherModuleUnit()` in DeclBase.cpp pointed by @mizvekov and add the corresponding test. - Fixed the regression in windows https://github.com/llvm/llvm-project/issues/97447. The changes are in `CodeGenModule::getVTableLinkage` from `clang/lib/CodeGen/CGVTables.cpp`. According to the feedbacks from MSVC devs, the linkage of vtables won't affected by modules. So I simply skipped the case for MSVC. Given this is more or less fundamental to the use of modules. I hope we can backport this to 19.x. (cherry picked from commit 847f9cb0e868c8ec34f9aa86fdf846f8c4e0388b) commit 3ffa5421ca657c04d4df170307c1f9a3c6293003 Author: Aaron Ballman <[email protected]> Date: Mon Aug 19 16:54:12 2024 -0400 [C++23] Fix infinite recursion (Clang 19.x regression) (#104829) d469794d0cdfd2fea50a6ce0c0e33abb242d744c was fixing an issue with triggering vtable instantiations, but it accidentally introduced infinite recursion when the type to be checked is the same as the type used in a base specifier or field declaration. Fixes #104802 (cherry picked from commit 435cb0dc5eca08cdd8d9ed0d887fa1693cc2bf33) commit 6dbc0e236b3e3a651302d079d1c64934976bc0b3 Author: Martin Storsjö <[email protected]> Date: Sun Aug 18 00:44:16 2024 +0300 [LLD] [MinGW] Recognize the -rpath option (#102886) GNU ld silently accepts the -rpath option for Windows targets, as a no-op. This has lead to some build systems (and users) passing this option while building for Windows/MinGW, even if Windows doesn't have any concept like rpath. Older versions of Conan did include -rpath in the pkg-config files it generated, see e.g. https://github.com/conan-io/conan/blob/17c58f0c61931f9de218ac571cd97a8e0befa68e/conans/client/generators/pkg_config.py#L104-L114 and https://github.com/conan-io/conan/blob/17c58f0c61931f9de218ac571cd97a8e0befa68e/conans/client/build/compiler_flags.py#L26-L34 - and see https://github.com/mstorsjo/llvm-mingw/issues/300 for user reports about this issue. Recognize the option in LLD for MinGW targets, to improve drop-in compatibility compared to GNU ld, but produce a warning to alert users that the option really has no effect for these targets. (cherry picked from commit 69f76c782b554a004078af6909c19a11e3846415) commit c1336c9e3bd6c0887ead386043c547b3a3ed76a9 Author: David Green <[email protected]> Date: Mon Aug 19 18:50:47 2024 +0100 [GlobalISel] Bail out early for big-endian (#103310) If we continue through the function we can currently hit crashes. We can bail out early and fall back to SDAG. Fixes #103032 (cherry picked from commit 05d17a1c705e1053f95b90aa37d91ce4f94a9287) commit 263965ebe237e2f82d714a12a8c9338b46237a33 Author: Tomas Matheson <[email protected]> Date: Sat Aug 17 13:36:40 2024 +0100 [AArch64] Add a check for invalid default features (#104435) This adds a check that all ExtensionWithMArch which are marked as implied features for an architecture are also present in the list of default features. It doesn't make sense to have something mandatory but not on by default. There were a number of existing cases that violated this rule, and some changes to which features are mandatory (indicated by the Implies field). This resulted in a bug where if a feature was marked as `Implies` but was not added to `DefaultExt`, then for `-march=base_arch+nofeat` the Driver would consider `feat` to have never been added and therefore would do nothing to disable it (no `-target-feature -feat` would be added, but the backend would enable the feature by default because of `Implies`). See clang/test/Driver/aarch64-negative-modifiers-for-default-features.c. Note that the processor definitions do not respect the architecture DefaultExts. These apply only when specifying `-march=<some architecture version>`. So when a feature is moved from `Implies` to `DefaultExts` on the Architecture definition, the feature needs to be added to all processor definitions (that are based on that architecture) in order to preserve the existing behaviour. I have checked the TRMs for many cases (see specific commit messages) but in other cases I have just kept the current behaviour and not tried to fix it. commit bb46c721211b901f7ab34551e4bb240308203da9 Author: Vladislav Khmelevsky <[email protected]> Date: Sat Jul 27 23:07:59 2024 +0400 release/19.x: [BOLT] Fix relocations handling Backport https://github.com/llvm/llvm-project/commit/097ddd3565f830e6cb9d0bb8ca66844b7f3f3cbb commit 8595e91b16dadc33fbb321cfd30b77f43f64e10e Author: Anton Korobeynikov <[email protected]> Date: Fri Aug 16 18:09:53 2024 -0700 Add some brief LLVM 19 release notes for Pointer Authentication ABI support. commit 9545ef53ebe8be2a53ef6f84626f52bed73c82ba Author: Craig Topper <[email protected]> Date: Fri Aug 16 14:54:51 2024 -0700 [Mips] Fix fast isel for i16 bswap. (#103398) We need to mask the SRL result to 8 bits before ORing in the SLL. This is needed in case bits 23:16 of the input aren't zero. They will have been shifted into bits 15:8. We don't need to AND the result with 0xffff. It's ok if the upper 16 bits of the register are garbage. Fixes #103035. (cherry picked from commit ebe7265b142f370f0a563fece5db22f57383ba2d) commit 6fcbfb8ebc9650a2ea184aac244d067efdbe441e Author: Sharadh Rajaraman <[email protected]> Date: Mon Aug 19 12:17:58 2024 +0100 [clang][driver] `TY_ModuleFile` should be a 'CXX' file type commit 38a591de66a86aaf523f78f8266a2d5f01a1b106 Author: Tulio Magno Quites Machado Filho <[email protected]> Date: Tue Aug 13 15:34:41 2024 -0300 [OpenMP][AArch64] Fix branch protection in microtasks (#102317) Start __kmp_invoke_microtask with PACBTI in order to identify the function as a valid branch target. Before returning, SP is authenticated. Also add the BTI and PAC markers to z_Linux_asm.S. With this patch, libomp.so can now be generated with DT_AARCH64_BTI_PLT when built with -mbranch-protection=standard. The implementation is based on the code available in compiler-rt. (cherry picked from commit 0aa22dcd2f6ec5f46b8ef18fee88066463734935) commit 6e3026883d77124e32a2a7be72c3361fba3e7457 Author: Mariya Podchishchaeva <[email protected]> Date: Mon Aug 12 09:08:46 2024 +0200 [clang] Avoid triggering vtable instantiation for C++23 constexpr dtor (#102605) In C++23 anything can be constexpr, including a dtor of a class whose members and bases don't have constexpr dtors. Avoid early triggering of vtable instantiation int this case. Fixes https://github.com/llvm/llvm-project/issues/102293 (cherry picked from commit d469794d0cdfd2fea50a6ce0c0e33abb242d744c) commit 8fbe69a407b2784c7e9d91a3c69daa9786b14391 Author: Hari Limaye <[email protected]> Date: Tue Aug 6 11:39:01 2024 +0100 [AArch64] Add streaming-mode stack hazard optimization remarks (#101695) Emit an optimization remark when objects in the stack frame may cause hazards in a streaming mode function. The analysis requires either the `aarch64-stack-hazard-size` or `aarch64-stack-hazard-remark-size` flag to be set by the user, with the former flag taking precedence. (cherry picked from commit a98a0dcf63f54c54c5601a34c9f8c10cde0162d6) commit b45f75295e3038ef79dce4ac63fbf95b659eebe5 Author: Piotr Zegar <[email protected]> Date: Thu Jul 25 17:26:01 2024 +0200 [clang-tidy] Fix crash in C language in readability-non-const-parameter (#100461) Fix crash that happen when redeclaration got different number of parameters than definition. Fixes #100340 (cherry picked from commit a27f816fe56af9cc7f4f296ad6c577f6ea64349f) commit 90f2d48965ca8a27f4b814ada987d169ca6a6f44 Author: Louis Dionne <[email protected]> Date: Fri Aug 16 11:08:34 2024 -0400 [libc++] Fix rejects-valid in std::span copy construction (#104500) Trying to copy-construct a std::span from another std::span holding an incomplete type would fail as we evaluate the SFINAE for the range-based constructor. The problem was that we checked for __is_std_span after checking for the range being a contiguous_range, which hard-errored because of arithmetic on a pointer to incomplete type. As a drive-by, refactor the whole test and format it. Fixes #104496 (cherry picked from commit 99696b35bc8a0054e0b0c1a26e8dd5049fa8c41b) commit 02cafa895c917a4b1726e64a5870877c95826be4 Author: Spencer Abson <[email protected]> Date: Fri Aug 16 14:39:43 2024 +0000 [AArch64] Adopt updated B16B16 target flags The enablement of SVE/SME non-widening BFloat16 instructions was recently changed in response to an architecture update, in which: - FEAT_SVE_B16B16 was weakened - FEAT_SME_B16B16 was introduced New flags, 'sve-b16b16' and 'sme-b16b16' were introduced to replace the existing 'b16b16'. This was acheived in the below two patches. - https://github.com/llvm/llvm-project/pull/101480 - https://github.com/llvm/llvm-project/pull/102501 Ideally, the interface change introduced here will be valid in LLVM-19. We do not see it necessary to back-port the entire change, but just to add 'sme-b16b16' and 'sve-b16b16' as aliases to the existing (and unchanged) 'b16b16' and 'sme2' flags which together cover all of these features. The predication of Bf16 variants of svmin/svminnm and svmax/svmaxnm is also fixed in this change. commit 9e90c40564e21dc5f1a12e08cfdf29305aaf9f50 Author: Gulfem Savrun Yeniceri <[email protected]> Date: Tue Jul 23 11:06:30 2024 +0000 Revert "[CGData] llvm-cgdata (#89884)" This reverts commit d3fb41dddc11b0ebc338a3b9e6a5ab7288ff7d1d and forward fix patches because of the issue explained in: https://github.com/llvm/llvm-project/pull/89884#issuecomment-2244348117. Revert "Fix tests for https://github.com/llvm/llvm-project/pull/89884 (#100061)" …
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed
Verified by a second party
crash
Prefer [crash-on-valid] or [crash-on-invalid]
llvm:transforms
regression
release:backport
I compiled this code with -O2 flag and it crashed. The code is:
The crash is: clang: /root/llvm-project/llvm/include/llvm/Support/Casting.h:662: decltype(auto) llvm::dyn_cast(From*) [with To = llvm::BinaryOperator; From = llvm::Instruction]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed.
The details can be found here: https://godbolt.org/z/37WsGxMcv
The text was updated successfully, but these errors were encountered: