- Mar 26, 2022
-
-
Iain Sandoe authored
This is support for the user-facing options to create importable header units from headers in the user or system search paths (or to be given an absolute path). This means that an incomplete header path will be passed by the driver and the lookup carried out using the search paths present when the front end is run. To support this, we introduce file fypes for c++-{user,system,header-unit}-header. These terms are the same as the ones used by GCC, to minimise the differences for tooling (and users). The preprocessor checks for headers before issuing a warning for "#pragma once" in a header build. We ensure that the importable header units are recognised as headers in order to avoid such warnings. Differential Revision: https://reviews.llvm.org/D121096 -
Shengchen Kan authored
Also, some code in constructor of `RecognizableInstrBase` is formatted.
-
Shengchen Kan authored
[X86][tablgen] Move fields Name, Is64Bit, Is32Bit, Operands from RecognizableInstrBase to RecognizableInstr, NFCI These four fields are not used by any user of `RecognizableInstrBase`, so we can move them to `RecognizableInstr` to avoid unnecessary construction.
-
Fangrui Song authored
-
Fangrui Song authored
-
Fangrui Song authored
The default argument true is error-prone: I think many would think the default is false.
-
Fangrui Song authored
See `D119309` for the guideline (-target, -no-canonical-prefixes, unneeded -o with -###).
-
Ben Shi authored
Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D115618
-
Fangrui Song authored
-
Shengchen Kan authored
-
Joseph Huber authored
-
Shilei Tian authored
As we mentioned in the code comments for function `ResourcePoolTy::release`, at some point there could be two identical resources on the two sides of `Next` mark. It is usually not an issue, unless the following case: 1. Some resources are not returned. 2. We need to iterate the pool and free the element. That will cause double free, which is the case for event pool. Since we don't release events hold by the data map, it can happen that the `Next` mark is not reset, and we have two identical items in the pool. When the pool is destroyed, we will call `cuEventDestroy` twice on the same event. In the best case, we can only observe CUDA errors. In the worst case, it can cause internal failures in CUDART and further crash. This patch fixes the issue by tracking all resources that have been given using an `unordered_set`. We don't remove it when a resource is returned. When the pool is destroyed, we merge the pool (a `vector`) and the set. In this way, we can make sure that the set contains all resources allocated from the device. We just need to iterate the set and free the resource accordingly. For now, only event pool is set to use it. Stream pool is not because we can make sure all streams are returned when the plugin is destroyed. Someone might be wondering, why don't we release all events hold in the data map. That is because, plugins are determined to be destroyed *before* `libomptarget`. If we can somehow make the plugin outlast `libomptarget`, life will be much easier. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D122014
-
Joseph Huber authored
This patch adds the necessary AMDGPU calling convention to the ctor / dtor kernels. These are fundamentally device kenels called by the host on image load. Without this calling convention information the AMDGPU plugin is unable to identify them. Depends on D122504 Fixes #54091 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D122515
-
Joseph Huber authored
The default construction of constructor functions by LLVM tends to make them have internal linkage. When we call a ctor / dtor function in the target region we are actually creating a kernel that is called at registration. Because the ctor is a kernel we need to make sure it's externally visible so we can actually call it. This prevented AMDGPU from correctly using constructors while NVPTX could use them simply because it ignored internal visibility. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D122504
-
Shengchen Kan authored
Address comments in D122477 b/c `getMnemonic` is common to X86 and may be used in more than one place.
-
Maksim Panchenko authored
All LLVM backends use MCDisassembler as a base class for their instruction decoders. Use "const MCDisassembler *" for the decoder instead of "const void *". Remove unnecessary static casts. Reviewed By: skan Differential Revision: https://reviews.llvm.org/D122245
-
Peter Klausler authored
STATUS='NEW' and 'REPLACE' require FILE= to be present. STATUS='SCRATCH' may not appear with FILE=. These errors are caught at compilation time when constant character strings are used in an OPEN statement, but the runtime needs to enforce them as well to catch errors in OPEN statements with character variables and expressions. Differential Revision: https://reviews.llvm.org/D122509
-
Uday Bondhugula authored
Enhance affine.load folding hook to fold loads on global splat constant memrefs. Differential Revision: https://reviews.llvm.org/D122292
-
Fred Riss authored
With the shared cache getting split into multiple files, the current way we created ObjectFileMachO objects for shared cache dylib images will break. This patch conditionally adopts new SPIs which will do the right thing in the new world of multi-file caches.
-
Gulfem Savrun Yeniceri authored
This patch adds comments about c7f91e22, and follows LLVM style guideline about nested if statements.
-
David Blaikie authored
Some functions can end up non-externally visible despite not being declared "static" or in an unnamed namespace in C++ - such as by having parameters that are of non-external types. Such functions aren't mistakenly intended to be defining some function that needs a declaration. They could be maybe more legible (except for the operator new example) with an explicit static, but that's a stylistic thing outside what should be addressed by a warning. This reapplies 275c5622 - once we figure out what to do about the change in behavior for -Wnon-c-typedef-for-linkage (this reverts the revert commit 85ee1d3c) Differential Revision: https://reviews.llvm.org/D121328
-
David Blaikie authored
We could only do this in limited ways (since we emit the TUs first, we can't use ref_addr (& we can't use that in Split DWARF either) - so we had to synthesize declarations into the TUs) and they were ambiguous in some cases (if the CU type had internal linkage, parsing the TU would require knowing which CU was referencing the TU to know which type the declaration was for, which seems not-ideal). So to avoid all that, let's just not reference types defined in the CU from TUs - instead moving the TU type into the CU (recursively). This does increase debug info size (by pulling more things out of type units, into the compile unit) - about 2% of uncompressed dwp file size for clang -O0 -g -gsplit-dwarf. (5% .debug_info.dwo section size increase in the .dwp)
-
Haojian Wu authored
-
Haojian Wu authored
-
Peter Klausler authored
The interfaces to C_ASSOCIATED()'s specific procedures must be PURE so that they are accepted for use in specification expressions. Differential Revision: https://reviews.llvm.org/D122438
-
Med Ismail Bennani authored
With Scripted Processes, in order to create scripted threads, the blueprint provides a dictionary that have each thread index as the key with the respective thread instance as the pair value. In Python, this is fine because a dictionary key can be of any type including integer types: ``` >>> {1: "one", 2: "two", 10: "ten"} {1: 'one', 2: 'two', 10: 'ten'} ``` However, when the python dictionary gets bridged to C++ we convert it to a `StructuredData::Dictionary` that uses a `std::map<ConstString, ObjectSP>` for storage. Because `std::map` is an ordered container and ours uses the `ConstString` type for keys, the thread indices gets converted to strings which makes the dictionary sorted alphabetically, instead of numerically. If the ScriptedProcess has 10 threads or more, it causes thread “10” (and higher) to be after thread “1”, but before thread “2”. In order to solve this, this sorts the thread info dictionary keys numerically, before iterating over them to create ScriptedThreads. rdar://90327854 Differential Revision: https://reviews.llvm.org/D122429 Signed-off-by:Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
This patch changes `StructuredData::Dictionary::GetKeys` return type from an `StructuredData::ObjectSP` to a `StructuredData::ArraySP`. The function already stored the keys in an array but implicitely upcasted it to an `ObjectSP`, which required the user to convert it again to a Array object to access each element. Since we know the keys should be held by an iterable container, it makes more sense to return the allocated ArraySP as-is. Differential Revision: https://reviews.llvm.org/D122426 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
Previously, the ScriptedThread used the thread index as the thread id. This patch parses the crashlog json to extract the actual thread "id" value, and passes this information to the Crashlog ScriptedProcess blueprint, to create a higher fidelity ScriptedThreaad. It also updates the blueprint to show the thread name and thread queue. Finally, this patch updates the interactive crashlog test to reflect these changes. rdar://90327854 Differential Revision: https://reviews.llvm.org/D122422 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Fangrui Song authored
The rule was added in 2014 to support -stdlib=libc++ and -lc++ without specifying -L, when D.Dir is not a well-known system library directory like /usr/lib /usr/lib64. This rule turns out to get in the way with (-m32 for 64-bit clang) or (-m64 for 32-bit clang) for Gentoo : https://github.com/llvm/llvm-project/issues/54515 Nowadays LLVM_ENABLE_RUNTIMES is the only recommended way building libc++ and LLVM_ENABLE_PROJECTS=libc++ is deprecated. LLVM_ENABLE_RUNTIMES builds libc++ in D.Dir+"/../lib/${triple}/". The rule is unneeded. Also reverts D108286. Gentoo uses a modified LLVM_ENABLE_RUNTIMES that installs libc++.so in well-known paths like /usr/lib64 and /usr/lib which are already covered by nearby search paths. Implication: if a downstream package needs something like -lLLVM-15git and uses libLLVM-15git.so not in a well-known path, it needs to supply -L D.Dir+"/../lib" explicitly (e.g. via LLVMConfig.cmake), instead of relying on the previous default search path. Reviewed By: mgorny Differential Revision: https://reviews.llvm.org/D122444
-
Johannes Doerfert authored
This reverts commit b9fd8f34 as it accidentally contained a unit test change that is not finished (and unrelated).
-
Florian Hahn authored
Make the test more robust to slightly different metadata numbering by using a pattern instead of hard coding the ids.
-
Johannes Doerfert authored
-
Johannes Doerfert authored
-
William S. Moses authored
This patch adds a helper method to determine if a nonvirtual base has an entry in the LLVM struct. Such a base may not have an entry if the base does not have any fields/bases itself that would change the size of the struct. This utility method is useful for other frontends (Polygeist) that use Clang as an API to generate code. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D122502
-
Paul Robinson authored
While -g[no-]simple-template-names is a driver option, the fancier -gsimple-template-names={simple,mangled} option is cc1-only, so code to handle it in the driver is dead. Differential Revision: https://reviews.llvm.org/D122503 -
Peter Klausler authored
Adds flang/include/flang/Common/visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit(). Modifies most use sites in the front-end and runtime to use common::visit(). The C++ standard mandates that std::visit() have O(1) execution time, which forces implementations to build dispatch tables. This new common::visit() is O(log2 N) in the number of alternatives in a variant<>, but that N tends to be small and so this change produces a fairly significant improvement in compiler build memory requirements, a 5-10% improvement in compiler build time, and a small improvement in compiler execution time. Building with -DFLANG_USE_STD_VISIT causes common::visit() to be an alias for std::visit(). Calls to common::visit() with multiple variant arguments are referred to std::visit(), pending further work. Differential Revision: https://reviews.llvm.org/D122441
-
Hongtao Yu authored
There is a case when a function has pseudo probe intrinsics but the module it resides does not have the probe desc. This could happen when the current module is not built with `-fpseudo-probe-for-profiling` while a function in it calls some other function from a probed module. In thinLTO mode, the callee function could be imported and inlined into the current function. While this is undefined behavior, I'm fixing the asm printer to not ICE and warn user about this. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D121737
-
Emilio Cota authored
-
Adrian Prantl authored
-
Martin Storsjö authored
This is the correct intended condition; the problematic case where we don't want to try to build the plugin is "WIN32 AND LLVM_LINK_LLVM_DYLIB" and thus the negation is "NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB". Differential Revision: https://reviews.llvm.org/D121687
-