aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-12-12[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.testsanitizer-allow-fork_threaded-test-on-msan-tsanVitaly Buka2-5/+6
Created using spr 1.3.4 [skip ci]
2023-12-12[𝘀𝗽𝗿] changes introduced through rebaseVitaly Buka1-1/+1
Created using spr 1.3.4 [skip ci]
2023-12-12[gn] port 27259f17e9d2Nico Weber1-0/+1
2023-12-12[RISCV] Reduce the size of the index used for RVV intrinsics. NFC (#74906)Craig Topper1-5/+5
Rather than using size_t, use uint32_t. We don't have more than 4 billion intrinsics.
2023-12-12[𝘀𝗽𝗿] changes introduced through rebaseVitaly Buka1-3/+7
Created using spr 1.3.4 [skip ci]
2023-12-12[𝘀𝗽𝗿] changes introduced through rebaseVitaly Buka1-1/+1
Created using spr 1.3.4 [skip ci]
2023-12-12[𝘀𝗽𝗿] changes introduced through rebaseVitaly Buka85-1043/+1320
Created using spr 1.3.4 [skip ci]
2023-12-12[lldb] Make only one function that needs to be implemented when searching ↵Greg Clayton52-907/+1135
for types (#74786) This patch revives the effort to get this Phabricator patch into upstream: https://reviews.llvm.org/D137900 This patch was accepted before in Phabricator but I found some -gsimple-template-names issues that are fixed in this patch. A fixed up version of the description from the original patch starts now. This patch started off trying to fix Module::FindFirstType() as it sometimes didn't work. The issue was the SymbolFile plug-ins didn't do any filtering of the matching types they produced, and they only looked up types using the type basename. This means if you have two types with the same basename, your type lookup can fail when only looking up a single type. We would ask the Module::FindFirstType to lookup "Foo::Bar" and it would ask the symbol file to find only 1 type matching the basename "Bar", and then we would filter out any matches that didn't match "Foo::Bar". So if the SymbolFile found "Foo::Bar" first, then it would work, but if it found "Baz::Bar" first, it would return only that type and it would be filtered out. Discovering this issue lead me to think of the patch Alex Langford did a few months ago that was done for finding functions, where he allowed SymbolFile objects to make sure something fully matched before parsing the debug information into an AST type and other LLDB types. So this patch aimed to allow type lookups to also be much more efficient. As LLDB has been developed over the years, we added more ways to to type lookups. These functions have lots of arguments. This patch aims to make one API that needs to be implemented that serves all previous lookups: - Find a single type - Find all types - Find types in a namespace This patch introduces a `TypeQuery` class that contains all of the state needed to perform the lookup which is powerful enough to perform all of the type searches that used to be in our API. It contain a vector of CompilerContext objects that can fully or partially specify the lookup that needs to take place. If you just want to lookup all types with a matching basename, regardless of the containing context, you can specify just a single CompilerContext entry that has a name and a CompilerContextKind mask of CompilerContextKind::AnyType. Or you can fully specify the exact context to use when doing lookups like: CompilerContextKind::Namespace "std" CompilerContextKind::Class "foo" CompilerContextKind::Typedef "size_type" This change expands on the clang modules code that already used a vector<CompilerContext> items, but it modifies it to work with expression type lookups which have contexts, or user lookups where users query for types. The clang modules type lookup is still an option that can be enabled on the `TypeQuery` objects. This mirrors the most recent addition of type lookups that took a vector<CompilerContext> that allowed lookups to happen for the expression parser in certain places. Prior to this we had the following APIs in Module: ``` void Module::FindTypes(ConstString type_name, bool exact_match, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeList &types); void Module::FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap &types); void Module::FindTypesInNamespace(ConstString type_name, const CompilerDeclContext &parent_decl_ctx, size_t max_matches, TypeList &type_list); ``` The new Module API is much simpler. It gets rid of all three above functions and replaces them with: ``` void FindTypes(const TypeQuery &query, TypeResults &results); ``` The `TypeQuery` class contains all of the needed settings: - The vector<CompilerContext> that allow efficient lookups in the symbol file classes since they can look at basename matches only realize fully matching types. Before this any basename that matched was fully realized only to be removed later by code outside of the SymbolFile layer which could cause many types to be realized when they didn't need to. - If the lookup is exact or not. If not exact, then the compiler context must match the bottom most items that match the compiler context, otherwise it must match exactly - If the compiler context match is for clang modules or not. Clang modules matches include a Module compiler context kind that allows types to be matched only from certain modules and these matches are not needed when d oing user type lookups. - An optional list of languages to use to limit the search to only certain languages The `TypeResults` object contains all state required to do the lookup and store the results: - The max number of matches - The set of SymbolFile objects that have already been searched - The matching type list for any matches that are found The benefits of this approach are: - Simpler API, and only one API to implement in SymbolFile classes - Replaces the FindTypesInNamespace that used a CompilerDeclContext as a way to limit the search, but this only worked if the TypeSystem matched the current symbol file's type system, so you couldn't use it to lookup a type in another module - Fixes a serious bug in our FindFirstType functions where if we were searching for "foo::bar", and we found a "baz::bar" first, the basename would match and we would only fetch 1 type using the basename, only to drop it from the matching list and returning no results
2023-12-13[CodeGen] Port `CFGuard` to new pass manager (#75146)paperchalice7-39/+89
Port `CFGuard` to new pass manager, add a pass parameter to choose guard mechanism.
2023-12-12Revert "[X86] Set SHF_X86_64_LARGE for globals with explicit well-known ↵Arthur Eubanks2-10/+10
large section name (#74381)" This reverts commit 323451ab88866c42c87971cbc670771bd0d48692. Code with these section names in the wild doesn't compile because support for large globals in the small code model is not complete yet.
2023-12-12[𝘀𝗽𝗿] changes to main this commit is based onVitaly Buka2-0/+102
Created using spr 1.3.4 [skip ci]
2023-12-12[mlir][sparse] refactor utilities into transform/utils dir (#75250)Aart Bik21-85/+76
Separates actual transformation files from supporting utility files in the transforms directory. Includes a bazel overlay fix for the build (as well as a bit of cleanup of that file to be less verbose and more flexible).
2023-12-12Add missing dep on MLIRToLLVMIRTranslationRegistration to mlir-opt. (#75111)Stella Laurenzo2-0/+8
I was not able to fully triage why this just started failing on one of our bots as it seems that the use was added 4 months ago. I would assume that it was accidentally coming in transitively in some way as the dep was definitely missing. For context, this started failing in [our byo_llvm](https://github.com/openxla/iree/blob/main/build_tools/llvm/byo_llvm.sh) build on a stock build of MLIR on top of an existing LLVM. We were getting: ``` ld.lld: error: undefined symbol: mlir::registerSPIRVDialectTranslation(mlir::DialectRegistry&) >>> referenced by mlir-opt.cpp >>> tools/mlir-opt/CMakeFiles/mlir-opt.dir/mlir-opt.cpp.o:(main) ```
2023-12-12[asan] Switch initialization to "double-checked locking"Vitaly Buka1-24/+25
This allows to remove `asan_init_is_running` which likely had a data race. Simplifies https://github.com/llvm/llvm-project/pull/74086 and reduces a difference between platforms. Reviewers: zacklj89, eugenis, dvyukov Reviewed By: zacklj89, dvyukov Pull Request: https://github.com/llvm/llvm-project/pull/74387
2023-12-12[RISCV] Add missing break to last case in switch. NFCCraig Topper1-0/+1
2023-12-12[libc] Add bind function (#74014)michaelrj-google16-15/+233
This patch adds the bind function to go with the socket function. It also cleans up a lot of socket related data structures.
2023-12-12[bazel] Port 4b3446771f745bb5169354ad9027c0a1c9fca394Fangrui Song2-0/+20
2023-12-12[lld][WebAssembly] Don't set importUndefined when -shared is used. NFC (#75241)Sam Clegg1-1/+0
`importUndefined` is only used a couple of places and both of those already handle `isPIC` separately.
2023-12-12[libc++][module] Fixes std::string UDL. (#75000)Mark de Wever3-58/+33
The fix changes the way the validation script determines the qualified name of a declaration. Inline namespaces without a reserved name are now always part of the name. The Clang code only does this when the names are ambigious. This method is often used for the operator""foo for UDLs. Adjusted the newly flagged issue and removed a work-around in the test code that is no longer required. Fixes https://github.com/llvm/llvm-project/issues/72427
2023-12-12[MLIR] Flatten fused locations when merging constants. (#75218)Benjamin Chetioui2-5/+45
[PR 74670](https://github.com/llvm/llvm-project/pull/74670) added support for merging locations at constant folding time. We have discovered that in some cases, the number of locations grows so big as to cause a compilation process to OOM. In that case, many of the locations end up appearing several times in nested fused locations. We add here a helper that always flattens fused locations in order to eliminate duplicates in the case of nested fused locations.
2023-12-12[OpenMP][NFC] Move mapping related code into OpenMP/Mapping.cpp (#75239)Johannes Doerfert7-610/+642
DeviceTy provides an abstraction for "middle-level" operations that can be done with a offload device. Mapping was tied into it but is not strictly necessary. Other languages do not track mapping, and even OpenMP can be used completely without mapping. This simply moves the relevant code into the OpenMP/Mapping.cpp as part of a new class MappingInfoTy. Each device still has one, but it does not clutter the device.cpp anymore.
2023-12-12[SystemZ][z/OS] Fix build errors on z/OS in the Unix .inc files (#74758)Abhina Sree3-1/+45
This patch resolves the following errors on z/OS: error: no member named 'wait4' in the global namespace error: no member named 'ru_maxrss' in 'rusage' error: use of undeclared identifier 'strsignal' error: Cannot get usage times on this platform error: Cannot get malloc info on this platform
2023-12-12[X86][FastISel] Bail out on large objects when materializing a GlobalValueArthur Eubanks2-0/+19
To avoid crashes with explicitly large objects. I will clean up fast-isel with large objects/medium code model soon.
2023-12-12[mlir][sparse] cleanup of CodegenEnv reduction API (#75243)Aart Bik3-26/+36
2023-12-12Add `std::basic_string` test cases (#74830)Tacet22-0/+113
Extend `std::basic_string` tests to cover more buffer situations and length in general, particularly non-SSO cases after SSO test cases (changing buffers). This commit is a side effect of working on tests for ASan annotations. Related PR: https://github.com/llvm/llvm-project/pull/72677
2023-12-12[libc] fix issues around stack protector (#74567)Schrodinger ZHU Yifan5-20/+33
If a function is declared with stack-protector, the compiler may try to load the TLS. However, inside certain runtime functions, TLS may not be available. This patch disables stack protectors for such routines to fix the problem. Closes #74487.
2023-12-12[AMDGPU] Precommit test for LDS DMA waitcounts. NFC. (#75240)Stanislav Mekhanoshin1-0/+78
2023-12-12Add a test for evicting unreachable modules from the global module cache ↵jimingham4-0/+185
(#74894) When you debug a binary and the change & rebuild and then rerun in lldb w/o quitting lldb, the Modules in the Global Module Cache for the old binary & .o files if used are now "unreachable". Nothing in lldb is holding them alive, and they've already been unlinked. lldb will properly discard them if there's not another Target referencing them. However, this only works in simple cases at present. If you have several Targets that reference the same modules, it's pretty easy to end up stranding Modules that are no longer reachable, and if you use a sequence of SBDebuggers unreachable modules can also get stranded. If you run a long-lived lldb process and are iteratively developing on a large code base, lldb's memory gets filled with useless Modules. This patch adds a test for the mode that currently works: (lldb) target create foo (lldb) run <rebuild foo outside lldb> (lldb) run In that case, we do delete the unreachable Modules. The next step will be to add tests for the cases where we fail to do this, then see how to safely/efficiently evict unreachable modules in those cases as well.
2023-12-12[NFC][InstrProf] Rename internal `InstrProfiling` to `InstrLowerer` (#75139)Mircea Trofin1-38/+38
Captures its responsibility a bit better.
2023-12-12[mlir][sparse]Make isBlockSparsity more robust (#75113)Yinying Li2-2/+57
1. A single dimension can either be blocked (with floordiv and mod pair) or non-blocked. Mixing them would be invalid. 2. Block size should be non-zero value.
2023-12-12[X86] avx512-vbroadcast.ll - fix orphan check prefixesSimon Pilgrim1-2/+2
The AVX512F/AVX512BW checks had been removed despite still being used
2023-12-12[bazel,unittest] Export llvm_orc_registerJITLoaderGDBWrapperFangrui Song1-0/+7
2023-12-12[mlir][mesh] Add endomorphism simplification for all-reduce (#73150)Boian Petkantchin11-0/+659
Does transformations like all_reduce(x) + all_reduce(y) -> all_reduce(x + y) max(all_reduce(x), all_reduce(y)) -> all_reduce(max(x, y)) when the all_reduce element-wise op is max. Added general rewrite pattern HomomorphismSimplification and EndomorphismSimplification that encapsulate the general algorithm. Made specialization for all-reduce with respect to addf, addi, minsi, maxsi, minimumf and maximumf in the Arithmetic dialect.
2023-12-12[mlir][vector] Allow vector distribution with multiple written elements (#75122)Jakub Kuderski4-17/+123
Add a configuration option to allow vector distribution with multiple elements written by a single lane. This is so that we can perform vector multi-reduction with multiple results per workgroup.
2023-12-12[ELF] Don't create copy relocation/canonical PLT entry for a defined symbol ↵Fangrui Song4-7/+7
(#75095) Copy relocations and canonical PLT entries are for symbols defined in a DSO. Currently we create them even for a `Defined`, possibly leading to an output that won't work at run-time (e.g. R_X86_64_JUMP_SLOT referencing a null symbol). ``` % cat a.s .globl _start, main .type main, @function _start: main: ret .rodata .quad main % clang -fuse-ld=lld -pie -nostdlib a.s % readelf -Wr a.out Relocation section '.rela.plt' at offset 0x290 contains 1 entry: Offset Info Type Symbol's Value Symbol's Name + Addend 00000000000033b8 0000000000000007 R_X86_64_JUMP_SLOT 12b0 ``` Report an error instead for the default `-z text` mode. GNU ld reports an error in `-z text` mode as well.
2023-12-12[libc++][chrono] Fixes year_month year wrapping. (#74938)Mark de Wever15-161/+329
Adding months to a year_month should wrap the year when the month becomes greater than twelve or less than one. This fixes the issue for year_month. Other classes with a year and month do not have this issue. This has been verified and tests are added to avoid possible regressions. Also fixes some variable copy-paste errors in the tests. Fixes https://github.com/llvm/llvm-project/issues/73162
2023-12-12[DebugInfo] Fix duplicate DIFile when main file is preprocessed (#75022)Fangrui Song2-4/+10
When the main file is preprocessed and we change `MainFileName` to the original source file name (e.g. `a.i => a.c`), the source manager does not contain `a.c`, but we incorrectly associate the DIFile(a.c) with md5(a.i). This causes CGDebugInfo::emitFunctionStart to create a duplicate DIFile and leads to a spurious "inconsistent use of MD5 checksums" warning. ``` % cat a.c void f() {} % clang -c -g a.c # no warning % clang -E a.c -o a.i && clang -g -S a.i && clang -g -c a.s a.s:9:2: warning: inconsistent use of MD5 checksums .file 1 "a.c" ^ % grep DIFile a.ll !1 = !DIFile(filename: "a.c", directory: "/tmp/c", checksumkind: CSK_MD5, checksum: "c5b2e246df7d5f53e176b097a0641c3d") !11 = !DIFile(filename: "a.c", directory: "/tmp/c") % grep 'file.*a.c' a.s .file "a.c" .file 0 "/tmp/c" "a.c" md5 0x2d14ea70fee15102033eb8d899914cce .file 1 "a.c" ``` Fix #56378 by disassociating md5(a.i) with a.c.
2023-12-12[libc++][doc] Updates module information. (#75003)Mark de Wever1-17/+22
Adds the std.compat module and add support for CMake 3.28.
2023-12-12[coroutines] Use DILocation from new storage for hoisted dbg.declare (#75104)Wei Wang2-15/+20
Make the hoisted dbg.declare inherent the DILocation scope from the new storage. After hoisting, the dbg.declare is moved into the block that defines the new storage. This could create an inconsistency in the debug location scope hierarchy where the scope of hoisted dbg.declare (i.e. DILexicalBlock) is enclosed with the scope of the block (i.e. DISubprogram). This confuses LiveDebugValues pass to think that the hoisted dbg.declare is killed in that block and does not generate DBG_VALUE in other blocks. Debugger won't be able to track its value anymore.
2023-12-12[AMDGPU] CodeGen for GFX12 64-bit scalar add/sub (#75070)Jay Foad7-112/+1833
2023-12-12[ORC][MachO] For convenience, make MachOPlatform ref available to subclasses.Lang Hames1-2/+2
This saves SimpleMachOHeaderMU subclasses from having to hold their own reference.
2023-12-12[gn build] Port 6a6646749900LLVM GN Syncbot1-0/+1
2023-12-12[analyzer] Fix broken testcase (#75216)DonatNagyE1-1/+1
When merging commit c873f77e87a9ebd02f94d6b9d46e84d43e1ceb38 I didn't manually rebase it onto the tip of the main branch, so I didn't notice that the testcase that's added by it needs to be tweaked to account for the effects of commit 2f29ded4f98e8e1fa26725c618a08082a09b405a (which was also merged by me a few days ago).
2023-12-12[RegAllocFast] NFC cleanups (#74860)Nick Desaulniers1-35/+30
- use more range for - avoid capturing lambda - prefer Register type to unsigned - remove braces around single statement if
2023-12-12[clang][Sema] Always clear UndefinedButUsed (#73955)Jonas Hahnfeld1-2/+1
Before, it was only cleared if there were undefined entities. This is important for Clang's incremental parsing as used by `clang-repl` that might receive multiple calls to `Sema.ActOnEndOfTranslationUnit`.
2023-12-12[Transforms] Fix a warningKazu Hirata1-0/+1
This patch fixes: llvm/lib/Transforms/Scalar/SROA.cpp:4855:9: error: unused variable 'NewAssign' [-Werror,-Wunused-variable]
2023-12-12[readtapi] Cleanup printing command line options (#75106)Cyndy Ishida3-13/+26
Also, add a version option.
2023-12-12[flang] Fix compilation error due to variable no being used (#75210)Pete Steinfeld1-1/+0
My builds were failing because the variable 'dim' was not used. This produced a warning, and my builds have warnings set as errors.
2023-12-12[C API] Add getters and setters for fast-math flags on relevant instructions ↵Benji Smith6-0/+350
(#75123) These flags are usable on floating point arithmetic, as well as call, select, and phi instructions whose resulting type is floating point, or a vector of, or an array of, a valid type. Whether or not the flags are valid for a given instruction can be checked with the new LLVMCanValueUseFastMathFlags function. These are exposed using a new LLVMFastMathFlags type, which is an alias for unsigned. An anonymous enum defines the bit values for it. Tests are added in echo.ll for select/phil/call, and the floating point types in the new float_ops.ll bindings test. Select and the floating point arithmetic instructions were not implemented in llvm-c-test/echo.cpp, so they were added as well.
2023-12-12[libc++][CI] Tests the no RTTI configuration. (#65518)Mark de Wever5-1/+21
There are a few drive-by fixes: - Since the combination RTTI disabled and exceptions enabled do not work, this combination is prohibited. - A small NFC in any fixing clang-tidy. The code in the Buildkite configuration is prepared for using the std module. There are more fixes needed for that configuration which will be done in a separate commit.