aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-06-03[𝘀𝗽𝗿] changes to main this commit is based onusers/koachan/spr/main.sparcias-add-support-for-uhi-and-ulo-extensionsKoakuma2-3/+18
Created using spr 1.3.4 [skip ci]
2024-05-19Quick fix for a waning in clang_rt.ctx_profile [-Wgnu-anonymous-struct]NAKAMURA Takumi2-0/+4
`__sanitizer_siginfo` has been introduced in D142117. (llvmorg-16-init-17950-ged9ef9b4f248) It is incompatible to -pedantic. `clang_rt.ctx_profile` has been introduced in #92456.
2024-05-19ReformatNAKAMURA Takumi1-1/+1
2024-05-18[nfc][InstrFDO]Encapsulate header writes in a class member function (#90142)Mingming Liu2-36/+40
The smaller class member are more focused and easier to maintain. This also paves the way for partial header forward compatibility in https://github.com/llvm/llvm-project/pull/88212 --------- Co-authored-by: Kazu Hirata <kazu@google.com>
2024-05-18[ThinLTO]Sort imported GUIDs before cache key update (#92622)Mingming Liu1-1/+7
Add 'sort' here since it's helpful when container type changes (for example, https://github.com/llvm/llvm-project/pull/88024 wants to change container type from `unordered_set` to `DenseMap) @MaskRay points out `std::` doesn't randomize the iteration order of `unordered_{set,map}`, and the iteration order for single build is deterministic.
2024-05-19update_test_checks: match IR basic block labels (#88979)Nicolai Hähnle9-516/+534
Labels are matched using a regexp of the form '^(pattern):', which requires the addition of a "suffix" concept to NamelessValue. Aside from that, the key challenge is that block labels are values, and we typically capture values including the prefix '%'. However, when labels appear at the start of a basic block, the prefix '%' is not included, so we must capture block label values *without* the prefix '%'. We don't know ahead of time whether an IR value is a label or not. In most cases, they are prefixed by the word "label" (their type), but this isn't the case in phi nodes. We solve this issue by leveraging the two-phase nature of variable generalization: the first pass finds all occurences of a variable and determines whether the '%' prefix can be included or not. The second pass does the actual substitution. This change also unifies the generalization path for assembly with that for IR and analysis, in the hope that any future changes avoid diverging those cases future. I also considered the alternative of trying to detect the phi node case using more regular expression special cases but ultimately decided against that because it seemed more fragile, and perhaps the approach of keeping a tentative prefix that may later be discarded could also be eventually applied to some metadata and attribute cases. Note that an early version of this change was reviewed as https://reviews.llvm.org/D142452, before version numbers were introduced. This is a substantially updated version of that change.
2024-05-18[VectorCombine] Don't transform single shuffles in shuffleToIdentityDavid Green2-4/+8
This will help in later patches where the checks for operands being instructions is removed, and might help not remove unnecessary poison lanes.
2024-05-18[DAG] Use copysign in frem power-2 fold. (#91751)David Green3-18/+117
As a small addition to #91148, this uses copysign to produce the correct sign for zero when converting frem to div/trunc/mul when we do not know that the input is positive (and we care about sign bits). The copysign lets us get the sign of zero correct. In testing, the only case this produced different results than fmod was: frem -inf, 4.0 -> nan vs -nan
2024-05-18[DXIL] Use consistent SmallVector parametersJessica Clarke1-1/+1
Fixes: 060df78cdbbf70d5a6dfff3af1d435a5a811b886
2024-05-18[DWARFLinker] Use an implicit conversion of SmallString to StringRef (NFC)Kazu Hirata1-1/+1
2024-05-18[dsymutil] Use operator==(StringRef, StringRef) (NFC)Kazu Hirata1-1/+1
2024-05-18[VPlan] Remove unused removeLastOperand (NFC).Florian Hahn1-5/+0
The last use of the function has been removed a while ago. Remove the unused function.
2024-05-18[NVPTX] support immediate values in st.param instructions (#91523)Alex MacLean3-64/+2199
Add support for generating `st.param` instructions with direct use of immediates. This eliminates the need for a `mov` instruction prior to the `st.param` resulting in more concise emitted PTX.
2024-05-18[nfc][ctx_profile] Fix printf - related `-Wformat-pedantic`Mircea Trofin1-2/+3
2024-05-18[flang][cuf] Add attr gen dependency to fix #92635Valentin Clement1-0/+1
2024-05-18[mlir] Add operator<< for printing `Block` (#92550)Krzysztof Parzyszek4-7/+8
Turns out it was already in Analysis/CFGLoopInfo, so just move it to IR/AsmPrinter.
2024-05-18[X86][CodeGen] Support flags copy lowering for CCMP/CTEST (#91849)Shengchen Kan4-1/+95
``` %1:gr64 = COPY $eflags OP1 may update eflags $eflags = COPY %1 OP2 may use eflags ``` To use eflags as input at 4th instruction, we need to use SETcc to preserve the eflags before 2, and update the source condition of OP2 according to value in GPR %1. In this patch, we support CCMP/CTEST as OP2.
2024-05-18[GlobalIsel] Combine select to integer min max more (#92570)Thorsten Schütt3-6/+12
2024-05-18[clang][NFC] Further improvements to const-correctnessVlad Serebrennikov6-23/+20
2024-05-18[clang][ThreadSafety] Skip past implicit cast in `translateAttrExpr`Antonio Frighetto2-2/+2
Ignore `ImplicitCastExpr` when building `AttrExp` for capability attribute diagnostics. Fixes: https://github.com/llvm/llvm-project/issues/92118.
2024-05-17[MCAsmParser] Improve .rept/.irp testsFangrui Song4-29/+53
2024-05-18[flang][OpenMP] Try to unify induction var privatization for OMP regions. ↵Kareem Ergawy61-216/+388
(#91116)
2024-05-18[flang][OpenMP] Re-enable tests when building OpenMP as a runtime (#89046)Michael Klemm54-64/+78
2024-05-17[MCAsmParser] .macro/.rept/.irp/.irpc: remove excess \n after expansionFangrui Song4-34/+34
``` .irp foo,1 nop .endr nop ``` expands to an excess EOL between two nop lines. Other loop directives and .macro have the same issue. `Lex()` at "Jump to the macro instantiation and prime the lexer" requires that there is one single \n token in CurTok. Therefore, we cannot consume the trailing \n when parsing the macro(-like) body. (commit c6e787f771d1f9d6a846b2d9b8db6adcd87e8dba (reverted by 1e5f29af81a5f6fda308074f6345b9fba4faa71c)) Instead, skip the potential \n after jumpToLoc at handleMacroExit.
2024-05-18Fix: remove wrongly pushed etime-function.mlir at toplevel (#92634)jiajie zhang1-25/+0
The purpose of this PR is to remove the 'etime-function.mlir' file that I mistakenly committed in https://github.com/llvm/llvm-project/pull/92571. This file is not necessary in source code control, and its presence may cause confusion or misunderstanding.
2024-05-18[Github] Revert accidental changes to dependabot configAiden Grossman1-10/+16
f3524e9aebbfabed0c60d0087b39ce14d8f778da accidentally touched the dependabot config. This patch reverts that change.
2024-05-17Reapply "[ctx_profile] Integration test (#92456)"Mircea Trofin4-16/+126
This reverts commit 881f20e958e80bd30463fc57d2d3e891bcb8a571. Passing -ldl -lpthread explicitly
2024-05-17[flang][cuda] Add data attribute to program globals (#92610)Valentin Clement (バレンタイン クレメン)2-1/+23
2024-05-17Revert "[LoongArch] Use R_LARCH_ALIGN with section symbol (#84741)"Fangrui Song6-47/+15
This reverts commit 01f79899ba349a0200586c8d05f5e22cca2ced31. This unusual special case has been discussed on the binutils mailing list. The approach will be revisited: https://sourceware.org/pipermail/binutils/2024-May/134092.html Pull Request: https://github.com/llvm/llvm-project/pull/92584
2024-05-17[lldb] Namespace SBSourceLanguageName (NFC)Jonas Devlieghere2-2/+2
2024-05-18DebugInfo: Don't emit .debug_names entries for split-dwarf-inlining infoDavid Blaikie2-1/+86
2024-05-17Revert "[ctx_profile] Integration test (#92456)"Aiden Grossman3-116/+0
This reverts commit 487d5af6482ea5f074c12d29d7e376d3fc697706. This was causing failures on some buildbots. https://lab.llvm.org/buildbot/#/builders/247/builds/18559
2024-05-17[flang] Fixed https://lab.llvm.org/buildbot/#/builders/270/builds/14406Slava Zakharin1-0/+1
2024-05-17[Bounds-Safety] Temporarily relax a `counted_by` attribute restriction on ↵Dan Liew4-6/+32
flexible array members In 0ec3b972e58bcbcdc1bebe1696ea37f2931287c3 an additional restriction was added when applying the `counted_by` attribute to flexible array members in structs. The restriction prevented the element type being a struct that itself had a flexible array member. E.g.: ``` struct has_unannotated_VLA { int count; char buffer[]; }; struct buffer_of_structs_with_unnannotated_vla { int count; struct has_unannotated_VLA Arr[] __counted_by(count); }; ``` In this example assuming the size of `Arr` is `sizeof(struct has_unannotated_VLA)*count` (which is what the attribute says) is wrong because it doesn't account for the size of `has_unannotated_VLA::buffer`. This is why this kind of code construct was treated as an error. However, it turns out existing Linux kernel code used the attribute on a flexible array member in this way (https://github.com/llvm/llvm-project/pull/90786#issuecomment-2118416515). To unbreak the build this restriction is downgraded to a warning with the plan to make it an error again once the errornous use of the attribute in the Linux kernel is resolved.
2024-05-17[mlir][polynomial] split attributes into its own tablegen (#92613)Jeremy Kun5-153/+184
Out of tree we have other dialects that use the ring attribute, but we get compilation errors when generating ops while pulling in all the Polynomial tablegen ops (there's no `-dialect` flag in `mlir-tblgen` for op generation like there is for attributes and types). This PR simply moves the attributes into its own file, so it can be included separately, and this also requires moving the dialect declaration into its own file.
2024-05-17[flang] Relax checking of dummy procedures under BIND(C) (#92474)Peter Klausler7-204/+361
As was done recently to allow derived types that are not explicitly BIND(C), but meet the requirements of BIND(C), to be acceptable for use in contexts nominally requiring BIND(C), this patch allows procedures that are not explicitly BIND(C) to be used in contexts that nominally require BIND(C) so long as (1) they meet the requirements of BIND(C), and (2) don't use dummy arguments whose implementations may vary under BIND(C), such as VALUE.
2024-05-17[flang][runtime] Decouple scalar output APIs from descriptors (#92444)Peter Klausler5-216/+264
For testing purposes the implementations of the output APIs like OutputInteger32 have been simply constructing descriptors and executing the operation through the general DescriptorIO template. This patch decouples those APIs from that mechanism so that programs using simple "PRINT *" statements for output can link to a smaller portion of the I/O runtime support library. (This is the only form of I/O accepted in GPU device code by previous CUDA Fortran and Fortran OpenACC compilers.)
2024-05-17[NVPTX] fixup support for over-aligned parameters (#92457)Alex MacLean6-43/+168
This extends the NVPTX support for over-aligned parameters and return values in a few related ways: - Support for `alignstack` attribute, as an alternative to legacy nvvm `!"align"` metadata entries. While we still maintain the legacy support, long term it might be nice to auto-upgrade to `alignstack`. - Check the alignment info when emitting the parameter list to prevent a mismatch between alignment of caller and callee, which would previously cause a fatal error for `ptxas`. - Check the alignment info when emitting loads for parameters, potentially enabling better vectorization.
2024-05-17[test] Use conventional -emit-llvm-onlyFangrui Song1-1/+1
Similar to a6d7828f4c50c1ec7b0b5f61fe59d7a768175dcc
2024-05-17[lldb-dap] Bump the version to 0.2.1Jonas Devlieghere1-1/+1
Bump the version to 0.2.1 to test the publishing workflow and update the extension README and URL.
2024-05-17[flang][cuda] Implicitly load cudadevice module in device/global subprogram ↵Valentin Clement (バレンタイン クレメン)7-5/+166
(#92038) This is a re-worked version of #91668. It adds the `cudadevice` module and set the `device` attributes on its functions/subroutines so there is no need for special case in semantic check. `cudadevice` module is implicitly USE'd in `global`/`device` subprogram.
2024-05-17Fix flaky test: signal_in_mutex_lock.cpp (#92587)Julian Lettner1-12/+20
Fix flaky test: the spawned thread keeps spinning on `sampler_mutex` which may be released before the thread is terminated based on termination ordering. My understanding of C++ semantics are that the program here is invalid: the destructors of global variables are invoked at the time of program termination, and it is the responsibility of the program to ensure that invoking those destructors is safe. rdar://126768628
2024-05-17[libcxx][libcxxabi] Fix build for OpenBSD (#92186)John Ericson3-4/+32
- No indirect syscalls on OpenBSD. Instead there is a `futex` function which issues a direct syscall. - Monotonic clock is available despite the full POSIX suite of timers not being available in its entirety. See https://lists.boost.org/boost-bugs/2015/07/41690.php and https://github.com/boostorg/log/commit/c98b1f459add14d5ce3e9e63e2469064601d7f71 for a description of an analogous problem and fix for Boost.
2024-05-17[clang][NFC] Add `const` qualifier in `Sema::isIncompatibleTypedef`Vlad Serebrennikov2-6/+6
2024-05-17[Bounds-Safety] Fix `pragma-attribute-supported-attributes-list.test`Dan Liew1-1/+0
0ec3b972e58bcbcdc1bebe1696ea37f2931287c3 changed the `counted_by` attribute to be `LateAttrParseExperimentalExt`. This means the attribute is no longer supported by `#pragma clang attribute`. However, the `pragma-attribute-supported-attributes-list.test` wasn't updated to account for that. rdar://125400257
2024-05-17[BOLT][NFC] Rename isUnsupportedBranch to isReversibleBranch (#92447)Nathan Sidwell4-10/+10
`isUnsupportedBranch` is not a very informative name, and doesn't match its corresponding `reverseBranchCondition`, as I noted in PR #92018. Here's a renaming to a more mnemonic name.
2024-05-17[MCAsmParser,test] Test line marker after .endr \nFangrui Song1-0/+2
Regression test for 1e5f29af81a5f6fda308074f6345b9fba4faa71c Reduced from Linux kernel arch/x86/crypto/sha1_avx2_x86_64_asm.S
2024-05-17[BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (#90786)Dan Liew21-148/+1117
Previously the attribute was only allowed on flexible array members. This patch patch changes this to also allow the attribute on pointer fields in structs and also allows late parsing of the attribute in some contexts. For example this previously wasn't allowed: ``` struct BufferTypeDeclAttributePosition { size_t count; char* buffer __counted_by(count); // Now allowed } ``` Note the attribute is prevented on pointee types where the size isn't known at compile time. In particular pointee types that are: * Incomplete (e.g. `void`) and sizeless types * Function types (e.g. the pointee of a function pointer) * Struct types with a flexible array member This patch also introduces late parsing of the attribute when used in the declaration attribute position. For example ``` struct BufferTypeDeclAttributePosition { char* buffer __counted_by(count); // Now allowed size_t count; } ``` is now allowed but **only** when passing `-fexperimental-late-parse-attributes`. The motivation for using late parsing here is to avoid breaking the data layout of structs in existing code that want to use the `counted_by` attribute. This patch is the first use of `LateAttrParseExperimentalExt` in `Attr.td` that was introduced in a previous patch. Note by allowing the attribute on struct member pointers this now allows the possiblity of writing the attribute in the type attribute position. For example: ``` struct BufferTypeAttributePosition { size_t count; char *__counted_by(count) buffer; // Now allowed } ``` However, the attribute in this position is still currently parsed immediately rather than late parsed. So this will not parse currently: ``` struct BufferTypeAttributePosition { char *__counted_by(count) buffer; // Fails to parse size_t count; } ``` The intention is to lift this restriction in future patches. It has not been done in this patch to keep this size of this commit small. There are also several other follow up changes that will need to be addressed in future patches: * Make late parsing working with anonymous structs (see `on_pointer_anon_buf` in `attr-counted-by-late-parsed-struct-ptrs.c`). * Allow `counted_by` on more subjects (e.g. parameters, returns types) when `-fbounds-safety` is enabled. * Make use of the attribute on pointer types in code gen (e.g. for `_builtin_dynamic_object_size` and UBSan's array-bounds checks). This work is heavily based on a patch originally written by Yeoul Na. rdar://125400257 Co-authored-by: Dan Liew <dan@su-root.co.uk>
2024-05-17Revert "[MCAsmParser] .rept/.irp/.irpc: remove excess tail EOL in expansion"Fangrui Song2-19/+26
This reverts commit c6e787f771d1f9d6a846b2d9b8db6adcd87e8dba. parseEOL() would remove \n # after .endr, not recognizing the line marker. ``` // reduced from Linux kernel arch/x86/crypto/sha1_avx2_x86_64_asm.S .rept 1 nop .endr # 512 "a.s" ```
2024-05-17AMDGPU: Handle undef correctly in isKnownIntegral (#92566)Matt Arsenault2-6/+54