summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-06-26[clang][sema] Move the initializer lifetime checking code fromusers/hokein/refactor-lifetime-boundHaojian Wu
SemaInit.cpp to a new place. NFC This is a refactoring change for better code isolation and reuse, a first step to extend it for assignments.
2024-06-21[clang] Add test for CWG2811 "Clarify "use" of main" (#96168)Vlad Serebrennikov
This patch covers [CWG2811](https://cplusplus.github.io/CWG/issues/2811.html) "Clarify "use" of main", basically adding a test for `-Wmain`, focusing on usages of `main` in unevaluated contexts. To my understanding, the diagnostic message is based on the wording, so I updated it based on the new wording. I also replaces "ISO C++ requires" with a phrasing that explicitly says "extension".
2024-06-21[clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (#95399)Vlad Serebrennikov
This patch implements 2024-05-31 resolution of a tentatively ready issue [CWG2877](https://cplusplus.github.io/CWG/issues/2877.html) "Type-only lookup for using-enum-declarator", which supersedes earlier [CWG2621](https://cplusplus.github.io/CWG/issues/2621.html) "Kind of lookup for `using enum` declarations". Now we perform type-only lookup (not to be confused with type-only context) for `elaborated-enum-declarator`. This is the same kind of lookup that elaborated type specifiers and base specifiers undergo. I also found out (and fixed) that one of our existing tests claimed that a dependent type can be used in `elaborated-enum-declarator`, but that's not the case: > The [using-enum-declarator](http://eel.is/c++draft/enum.udecl#nt:using-enum-declarator) shall designate a non-dependent type with a reachable [enum-specifier](http://eel.is/c++draft/dcl.enum#nt:enum-specifier)[.](http://eel.is/c++draft/enum.udecl#1.sentence-2)
2024-06-21[clang] Cover CWG issues about `export template` (#94876)Vlad Serebrennikov
This PR covers the following Core issues: [CWG204](https://cplusplus.github.io/CWG/issues/204.html) "Exported class templates" [CWG323](https://cplusplus.github.io/CWG/issues/323.html) "Where must `export` appear?" [CWG335](https://cplusplus.github.io/CWG/issues/335.html) "Allowing `export` on template members of nontemplate classes" [CWG820](https://cplusplus.github.io/CWG/issues/820.html) "Deprecation of `export`" I believe the list above is entirety of Core issues that are dedicated solely to `export template`. I believe we have two main points of view here, which command what this PR should do: 1. (easy) Removal of `export template` was done as a defect report in CWG820, and the rest are effectively superseded by it, because we apply defect reports retroactively. 2. (harder) Those Core issues are testable individually, so we should test them for the behavior Core wanted at the time. This PR implements the first option, making our C++ DR status page greener. I think I can be persuaded to go with the second option, if reviewers have strong preference for it.
2024-06-21[PassInstrumentation] Use try_emplace() (NFC)Nikita Popov
To avoid a duplicate hash map lookup.
2024-06-21[AArch64][GlobalISel] Add fp128 and i128 fptosi/fptoui handling. (#95528)David Green
Any fp128 need to end up as libcall, as will f32->i128 and f64->i128. f16 are a bit special as the maximum range of the result fits in a i17, so can be shrank to an i64. Vector with i128/fp128 types are scalarized.
2024-06-21[flang][debug] Cleanup tests. (NFC) (#96189)Abid Qadeer
@kiranchandramohan mentioned [here](https://github.com/llvm/llvm-project/pull/91582#discussion_r1606046605) that LLVM IR tests should go in the Integration folder. He also mentioned [here](https://github.com/llvm/llvm-project/pull/91582#discussion_r1606684034) that tests for `add-debug-info` pass should test that pass only. There were some tests which were added before his comments so I have cleaned them in this PR. The following changes were made. 1. Move LLVM IR tests to `Integration` folder. 2. Change tests from f90 to fir and only test changes done by `add-debug-info` pass.
2024-06-21[AArch64] Fix up failing test that should have been caught by precommitSander de Smalen
Not sure why Github precommit tests didn't show this. Do they not build for all targets?
2024-06-21[CodeGenPrepare] Add missing `static` decl on `matchIncrement()`; NFCNoah Goldstein
2024-06-21[RISCV] Add Syntacore SCR3 processor definition (#95953)Anton Sidorenko
Syntacore SCR3 is a microcontroller-class processor core. Overview: https://syntacore.com/products/scr3 This PR introduces two CPUs: * 'syntacore-scr3-rv32' which is rv32imc * 'syntacore-scr3-rv64' which is rv64imac --------- Co-authored-by: Dmitrii Petrov <dmitrii.petrov@syntacore.com>
2024-06-21[GlobalOpt] Don't resolve aliased ifuncs with undefined resolvees. (#96220)Alexandros Lamprineas
Fixes https://github.com/llvm/llvm-project/issues/96197. A global alias should always point to a definition. Ifuncs are definitions, so far so good. However an ifunc may be statically resolved to a function that is declared but not defined in the translation unit. With this patch we perform static resolution if: * the resolvee is defined, else if * none of the ifunc users is a global alias
2024-06-21[AArch64] Fix || Add brackets for || inside of assertDavid Green
Fixes: llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def:185:12: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] assert(!Size.isScalable() || MinSize >= 128 ~~~~~~~~~~~~~~ && "Scalable vector types should have size of at least 128 bits");
2024-06-21[AArch64] Use AArch64ISD::UADDLP over aarch64_neon_uaddlp. NFCDavid Green
2024-06-21[NFC] Fix laod -> load typos. NFCDavid Green
2024-06-21Recommit "[Inliner] Propagate callee argument memory access attributes ↵Noah Goldstein
before inlining" (2nd Try) In the re-commit, just dropping the propagation of `writeonly` as that is the only attribute that can play poorly with call slot optimization (see issue: #95152 for more details). Closes #95888
2024-06-21[clang][test] Enable a commented-out test (#96195)Timm Baeder
This doesn't seem to crash anymore.
2024-06-21[clang][Interp] Fix Descriptor::getElemQualType() for complex/vectorsTimm Bäder
We handle them like arrays but still need to differentiate between array/vector/complex types when dealing with QualTypes.
2024-06-21[mlir][Transforms] Dialect conversion: Remove workaround (#96186)Matthias Springer
This commit removes a `FIXME` in the code base that was in place because of patterns that used the dialect conversion API incorrectly. Those patterns have been fixed and the workaround is no longer needed.
2024-06-21[Clang][AArch64] Expose compatible SVE intrinsics with only +sme (#95787)Sander de Smalen
This allows code with SVE intrinsics to be compiled with +sme,+nosve, assuming the encompassing function is in the correct mode (see #93802)
2024-06-21[mlir][vector] Update tests for collapse 4/n (nfc) (#96214)Andrzej Warzyński
The main goal of this PR (and subsequent PRs), is to add more tests with scalable vectors to: * vector-transfer-collapse-inner-most-dims.mlir There's quite a few cases to consider, hence this is split into multiple PRs. In this PR, `@outer_dyn_drop_inner_most_dim` is replaced with: * `@contiguous_inner_most_dynamic_outer` I am also adding a similar test for scalable vectors. In addition, * `@drop_two_inner_most_dim` and `@drop_two_inner_most_dim_scalable_inner_dim`, are renamed as `@contiguous_inner_most` and `@contiguous_inner_most_scalable_inner_dim`, respectively, to match their counterpart for `xfer_read`. NOTE: This PR is limited to tests for `vector.transfer_write` This is a follow-up for: #94490, #94604, #94906
2024-06-20[Serialization] Use stable hash functionsFangrui Song
clangSerialization currently uses hash_combine/hash_value from Hashing.h, which are not guaranteed to be deterministic. Replace these uses with xxh3_64bits. Pull Request: https://github.com/llvm/llvm-project/pull/96136
2024-06-21[IR] Don't include PassInstrumentation.h in PassManager.h (NFC) (#96219)Nikita Popov
Move PassInstrumentationAnalysis into PassInstrumentation.h and stop including it in PassManager.h (effectively inverting the direction of the dependency). Most places using PassManager are not interested in PassInstrumentation, and we no longer have any uses of it in PassManager.h itself (only in PassManagerImpl.h).
2024-06-21Revert "Intrinsic: introduce minimumnum and maximumnum (#93841)"Nikita Popov
As far as I can tell, this pull request was not approved, and did not go through an RFC on discourse. This reverts commit 89881480030f48f83af668175b70a9798edca2fb. This reverts commit 225d8fc8eb24fb797154c1ef6dcbe5ba033142da.
2024-06-20[Lex] Replace hash_combine with a stable hashFangrui Song
2024-06-20[dsymutil] Move discriminator test to be executed with Arm support only (#96280)David Tellenbach
This fixes a test failure introduced in 9f71a6b.
2024-06-20[Lex] HeaderSearchOptions: Remove unused hash_value overloadsFangrui Song
2024-06-20[DWARFLinker] Preserve DWARF discriminators while linking (#96124)David Tellenbach
DWARF-4 introduced DWARF discriminators but both, the classic and the parallel DWARF linkers discarded them so far. After applying this patch dsymutil, which uses the DWARF linkers, correctly preserves discriminator information.
2024-06-21Replace hard coded opcodes from #93841 with regexes to be more flexible. ↵dyung
(#96277) This change removes the hard coded opcode values and replaces them with regexes so that the test can deal with different opcode numbers being assigned and unbreak a ton of bots.
2024-06-20[ProfileData] Teach addValueData to honor parameter Site (#96233)Kazu Hirata
This patch teaches addValueData to honor Site for verification purposes. It does not affect the profile data in any manner.
2024-06-21[X86]Add support for __outbyte/word/dword and __inbyte/word/dword (#93774)Malay Sanghi
A previous commit implemented _inp/w/d and renaming that to __inbyte/word/dword These intrinsics were declared in the header but never implemented.
2024-06-21[clang][dataflow] Add a callback run on the pre-transfer state. (#96140)martinboehme
At the same time, rename `PostVisitCFG` to the more descriptive `PostAnalysisCallbacks` (which emphasizes the fact that these callbacks are run after the dataflow analysis itself has converged). Before this patch, it was only possible to run a callback on the state _after_ the transfer function had been applied, but for many analyses, it's more natural to to check the state _before_ the transfer function has been applied, because we are usually checking the preconditions for some operation. Some checks are impossible to perform on the "after" state because we can no longer check the precondition; for example, the `++` / `--` operators on raw pointers require the operand to be nonnull, but after the transfer function for the operator has been applied, the original value of the pointer can no longer be accessed. `UncheckedOptionalAccessModelTest` has been modified to run the diagnosis callback on the "before" state. In this particular case, diagnosis can be run unchanged on either the "before" or "after" state, but we want this test to demonstrate that running diagnosis on the "before" state is usually the preferred approach. This change is backwards-compatible; all existing analyses will continue to run the callback on the "after" state.
2024-06-20[compiler-rt] Fix build breakage (#96235)Alexander Shaposhnikov
Add missing flags in cmake. Follow-up to cae6d458a.
2024-06-20[Driver] BuildOffloadingActions: Stabilize iteration orderFangrui Song
Otherwise hip-phases.hip could fail when llvm::hash_value(StringRef) changes.
2024-06-21[TableGen][Docs] Clarify `TokCode` definition. (#96201)Piotr Fusik
"shortest" would be an empty sequence and the rule would never match.
2024-06-21Adding parsing support for omp loop, target loop directives (#93517)Anchu Rajendran S
Change adds parsing support for omp loop, omp target loop, omp target parallel loop and omp target teams loop.
2024-06-21Intrinsic: introduce minimumnum and maximumnum (#93841)YunQiang Su
Currently, on different platform, the behaivor of llvm.minnum is different if one operand is sNaN: When we compare sNaN vs NUM: ARM/AArch64/PowerPC: follow the IEEE754-2008's minNUM: return qNaN. RISC-V/Hexagon follow the IEEE754-2019's minimumNumber: return NUM. X86: Returns NUM but not same with IEEE754-2019's minimumNumber as +0.0 is not always greater than -0.0. MIPS/LoongArch/Generic: return NUM. LIBCALL: returns qNaN. So, let's introduce llvm.minmumnum/llvm.maximumnum, which always follow IEEE754-2019's minimumNumber/maximumNumber. Half-fix: #93033
2024-06-20[ELF] -no-pie: don't optimize addq R_X86_64_REX_GOTPCRELX when !isInt<32>(va)Fangrui Song
When `!isInt<32>(x.va)`, `addq x@GOTPCREL(%rip), %rax` (possibly due to getelementptr of a global variable) should not be optimized to `addq offset, %rax`. We currently have either an assertion failure or an incorrect optimization. Fix it using the relaxOnce framework.
2024-06-21[RISCV] Make M imply Zmmul (#95070)Jianjian Guan
According to the spec, M implies Zmmul.
2024-06-21[C++20] [Modules] Reference all the possible declarations for ADLChuanqi Xu
In no transitive change mode, the unresolved ADL may not be referenced, then it is problematic if the change didn't get propagated correctly. This patch add references to all the possible module files for the unresolved ADL to solve the problem.
2024-06-20[clang-cl][AST] Fix auto NTTP MSVC 1920+ mangling for pointer types (#92477)Max Winkler
https://godbolt.org/z/G1K8Wszn9 for reference. Starting with MSVC 1920+, VS2019, C++17 auto NTTP now adds `M <type>` to the mangled name to avoid name collisions with different deduced types. This PR fixes pointers. Pointers to members will be fixed in an upcoming PR. Here is a small example. The godbolt has more thorough examples. ``` template<auto> struct AutoParmTemplate { AutoParmTemplate() {} }; int i; int main() { // MSVC 1916: ??0?$AutoParmTemplate@$1?i@@3HA@@QEAA@XZ // MSVC 1929: ??0?$AutoParmTemplate@$MPEAH1?i@@3HA@@QEAA@XZ // Clang: ??0?$AutoParmTemplate@$1?i@@3HA@@QEAA@XZ AutoParmTemplate<&i> x; } ```
2024-06-20[PowerPC] use r1 as the frame pointer when there is dynamic allocaChen Zheng
On PPC, when there is dynamic alloca, only r1 points to the backchain.
2024-06-20[PowerPC] fix frameaddress error when there is dynamic alloca call, NFCChen Zheng
2024-06-20[clang-format[NFC] Clean up AnnotatingParser::rParenEndsCast() (#96128)Owen Pan
2024-06-21[SCEV] Avoid unnecessary call to getExitingBlock() in computeExitLimit() ↵Enna1
(#96188) In `computeExitLimit()`, we use `getExitingBlock()` to check if loop has exactly one exiting block. Since `computeExitLimit()` is only used in `computeBackedgeTakenCount()`, and `getExitingBlocks()` is called to get all exiting blocks in `computeBackedgeTakenCount()`, we can simply check if loop has exactly one exiting block by checking if the number of exiting blocks equals 1 in `computeBackedgeTakenCount()` and pass it as an argument to `computeExitLimit()`. This change helps to improve the compile time for files containing large loops.
2024-06-20Revert "[lldb/crashlog] Make interactive mode the new default" (#96263)Med Ismail Bennani
Reverts llvm/llvm-project#94575 since introduces test failure: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6166/
2024-06-21[serialization] No transitive type change (#92511)Chuanqi Xu
Following of https://github.com/llvm/llvm-project/pull/92085. #### motivation The motivation is still cutting of the unnecessary change in the dependency chain. See the above link (recursively) for details. And this will be the last patch of the `no-transitive-*-change` series. If there are any following patches, they might be C++20 Named modules specific to handle special grammars like `ADL` (See the reply in https://discourse.llvm.org/t/rfc-c-20-modules-introduce-thin-bmi-and-decls-hash/74755/53 for example). So they won't affect the whole serialization part as the series patch did. #### example After this patch, finally we are able to cut of unnecessary change of types. For example, ``` //--- m-partA.cppm export module m:partA; //--- m-partA.v1.cppm export module m:partA; namespace NS { class A { public: int getValue() { return 43; } }; } //--- m-partB.cppm export module m:partB; export inline int getB() { return 430; } //--- m.cppm export module m; export import :partA; export import :partB; //--- useBOnly.cppm export module useBOnly; import m; export inline int get() { return getB(); } ``` The BMI of `useBOnly.cppm` is expected to not change if we only add a new class in `m:partA`. This will be pretty useful in practice. #### implementation details The key idea of this patch is similar with the previous patches: extend the 32bits type ID to 64bits so that we can store the module file index in the higher bits. Then the encoding of the type ID is independent on the imported modules. But there are two differences from the previous patches: - TypeID is not completely an index of serialized types. We used the lower 3 bits to store the qualifiers. - TypeID won't take part in any lookup process. So the uses of TypeID is much less than the previous patches. The first difference make we have some more slightly complex bit operations. And the second difference makes the patch much simpler than the previous ones.
2024-06-20Update ModuleSummaryIndexBitcodeReader::makeCallList reserve amount (#95461)Jan Voung
Tighten the reserve() to `Record.size() / 2` instead of `Record.size()` in the HasProfile/HasRelBF cases. For the uncommon old profile format cases we leave it as is, but those should be rare and not worth optimizing. This reduces peak memory during ThinLTO indexing by ~3% in one example. Alternatively, we could make the branching for reserve more complex and try to cover every case.
2024-06-21mmapForContinuousMode: Redo #95702: Align Linux's impl to __APPLE__'s a little.NAKAMURA Takumi
I've made this small cosmetic changes, `s/CountersOffsetInBiasMode/FileOffsetToCounters/`
2024-06-20[lldb/crashlog] Make interactive mode the new default (#94575)Med Ismail Bennani
This patch makes interactive mode as the default when using the crashlog command. It replaces the existing `-i|--interactive` flag with a new `-m|--mode` option, that can either be `interactive` or `batch`. By default, when the option is not explicitely set by the user, the interactive mode is selected, however, lldb will fallback to batch mode if the command interpreter is not interactive or if stdout is not a tty. This also adds some railguards to prevent users from using interactive only options with the batch mode and updates the tests accordingly. rdar://97801509 Differential Revision: https://reviews.llvm.org/D141658 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-20[libc] Control freelist malloc buffer size with a config (#96248)PiJoules
Rather than propgating a compile define, add an explicit cmake flag for controlling the size. The default for baremetal is 100KB and the default for others is 1GB.