- Oct 10, 2023
-
-
Ivan Butygin authored
WhileOp before/after block args types weren't converted, resulting in invalid IR.
-
David Green authored
Similar to D159254, this fixes the order of WriteAdr operands on post/pre-inc loads/stores in the Cortex-A55 scheduling model.
-
Timm Bäder authored
Differential Revision: https://reviews.llvm.org/D155548
-
Timm Bäder authored
ConstantExprs already have a value attached we can just return here. Differential Revision: https://reviews.llvm.org/D155548
-
Alex Voicu authored
This reverts commit 9b98ebb0.
-
Alex Voicu authored
This patch adds the LLVM changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What we do here is add two passes, one mandatory and one optional: 1. HipStdParAcceleratorCodeSelectionPass is mandatory, depends on CallGraphAnalysis, and implements the following transform: - Traverse the call-graph, and check for functions that are roots for accelerator execution (at the moment, these are GPU kernels exclusively, and would originate in the accelerator specific algorithm library the toolchain uses as an implementation detail); - Starting from a root, do a BFS to find all functions that are reachable (called directly or indirectly via a call- chain) and record them; - After having done the above for all roots in the Module, we have the computed the set of reachable functions, which is the union of roots and functions reachable from roots; - All functions that are not in the reachable set are removed; for the special case where the reachable set is empty we completely clear the module; 2. HipStdParAllocationInterpositionPass is optional, is meant as a fallback with restricted functionality for cases where on-demand paging is unavailable on a platform, and implements the following transform: - Iterate all functions in a Module; - If a function's name is in a predefined set of allocation / deallocation that the runtime implementation is allowed and expected to interpose, replace all its uses with the equivalent accelerator aware function, iff the latter is available; - If the accelerator aware equivalent is unavailable we warn, but compilation will go ahead, which means that it is possible to get issues around the accelerator trying to access inaccessible memory at run time; - We rely on direct name matching as opposed to using the new alloc-kind family of attributes and / or the LibCall analysis pass because some of the legacy functions that need replacing would not carry the former or be identified by the latter. Reviewed by: JonChesterfield, yaxunl Differential Revision: https://reviews.llvm.org/D155856 -
Timm Baeder authored
Handle those by just zero-initializing the result.
-
Nikita Popov authored
Pass SimplifyQuery instead of unpacked list of arguments.
-
Vladislav Khmelevsky authored
Add absent start & fini symbols, currently setted by bolt for runtime libraries at DT_INIT and DT_FINI. The proper tests would be added by the https://github.com/llvm/llvm-project/pull/67348 PR.
-
jeanPerier authored
When calling a statement function with a character actual argument with a constant length mismatching the dummy length, HLFIR lowering created an hlfir.declare with the actual argument length for the dummy, causing bugs when lowering the statement function expression. Ensure character dummies are always cast to the dummy type when lowering dummy declarations.
-
Job Noorman authored
This could happen, for example, when instrumenting an AArch64 binary on an x86 host because the instrumentation library is always built for the host. Note that this check will probably need to be refined in the future as merely having the same architecture does not guarantee objects can be linked. For example, on RISC-V, the float ABI of all objects should match.
-
Timm Baeder authored
isLive() is false for null pointers, so we need to special-case this here.
-
David Green authored
Similar to D159254, this fixes the order of WriteAdr operands on post/pre-inc loads/stores in the Cortex-A53 scheduling model.
-
Nikita Popov authored
Accept a SimplifyQuery instead of an unpacked list of arguments.
-
Nikita Popov authored
To allow reusing it between InstructionSimplify and ValueTracking.
-
Nikita Popov authored
When a SCEVCallbackVH is RAUWed, we currently do a def-use walk and remove dependent instructions from the ValueExprMap. However, unlike SCEVs usual invalidation, this does not forget memoized values. The end result is that we might end up removing a SCEVUnknown from the map, while that expression still has users. Due to that, we may later fail to invalide those expressions. In particular, invalidation of loop dispositions only does something if there is an expression for the value, which would not be the case here. Fix this by using the standard forgetValue() API, instead of rolling a custom variant. Fixes https://github.com/llvm/llvm-project/issues/68285.
-
LLVM GN Syncbot authored
-
Timm Bäder authored
This test doesn't do anything in that case. This broke some builders, e.g.: https://lab.llvm.org/buildbot/#/builders/245/builds/15150
-
Viktor Cseh authored
This checker reports cases where an array of polymorphic objects are deleted as their base class. Deleting an array where the array's static type is different from its dynamic type is undefined. Since the checker is similar to DeleteWithNonVirtualDtorChecker, I refactored that checker to support more detection types. This checker corresponds to the SEI Cert rule EXP51-CPP: Do not delete an array through a pointer of the incorrect type. Differential Revision: https://reviews.llvm.org/D158156
-
Viktor Cseh authored
This rename is done in a separate commit to preserve `git blame`, before implementing CXXArrayDeleteChecker and refactoring the file. Differential Revision: https://reviews.llvm.org/D158156
-
Nikita Popov authored
This reverts commit feea5db0. This causes significant compile-time regressions, even if EGPR is not used.
-
Martin Storsjö authored
-
Björn Pettersson authored
GetExprRange did not expect that very large shift counts when narrowing the range based on logical right shifts. So with inputs such as *a >> 123456789012345678901uwb it would hit assertions about trying to convert a too large APInt into uint64_t. This patch fixes that by using the APInt value when determining if we should reduce the range by the shift count or not. -
Martin Storsjö authored
This was added accidentally in 64bc44f5, while mass-adding the -no-preprocess argument to the llvm-rc invocations in the tests.
-
Mikhail Goncharov authored
for real
-
Benjamin Maxwell authored
These will be used in future pass to ensure that loads/stores of masks are legal (as the LLVM backend does not support this for any type smaller than an svbool, which is vector<[16]xi1>). Depends on #68399
-
Mikhail Goncharov authored
-
DianQK authored
When converting to ConstantRange, we should treat undef like a full range. Fixes #68381.
-
Timm Bäder authored
-
David Green authored
Similar to D159254, this fixes the order of WriteAdr operands on post/pre-inc loads/stores in the Cortex-A510 scheduling model. I will add the same for other models too, this will be the most impactful due to it being the default cpu scheduling model. Closes #68518
-
Congcong Cai authored
Fixes:#68542 It‘s meaningless to diagnose further error for invalid function declaration.
-
Thomas Symalla authored
The primary ISA-independent justification for using PC-relative addressing is that it makes code position-independent and therefore allows sharing of .text pages between processes. When not sharing .text pages, we can use absolute relocations instead, which will possibly prevent a bubble introduced by s_getpc_b64. Co-authored-by:Thomas Symalla <thomas.symalla@amd.com>
-
Martin Storsjö authored
This allows tooling to properly show diffs for files in the llvm/test/tools/llvm-rc/Inputs directory. Keep the actual icon/cursor/bitmap files marked as binary.
-
Dougall Johnson authored
A number of useful constants can be encoded with a 64-bit ORR followed by a 64-bit EOR, including all remaining repeated byte patterns, some useful repeated 16-bit patterns, and some irregular masks. This patch prioritizes that encoding over three or four instruction encodings. Encoding with MOV + MOVK or ORR + MOVK is still preferred for fast literal generation and readability respectively. The method devises three candidate values, and checks if both Candidate and (Imm ^ Candidate) are valid logical immediates. If so, Imm is materialized with: ``` ORR Xd, XZR, #(Imm ^ Candidate) EOR Xd, Xd, #(Candidate) ``` The method has been exhaustively tested to ensure it can solve all possible values (excluding 0, ~0, and plain logical immediates, which are handled earlier).
-
Martin Storsjö authored
On MinGW targets, the .ctors section is always used for constructors. When using the .ctors section, the constructors need to be emitted in reverse order to get them execute in the right order. (Constructors with a specific priority are sorted separately by the linker later.) In LLVM, in CodeGen/AsmPrinter/AsmPrinter.cpp, there's code that reverses them before writing them out, executed when using the .ctors section. This logic is done whenever TM.Options.UseInitArray is set to false. Thus, make sure to set UseInitArray to false for this target. This fixes https://github.com/llvm/llvm-project/issues/55938.
-
LiqinWeng authored
I would put this into the implementation of verify for tosa.slice
-
Douglas Yung authored
Replace hard coded numbers from 462d5830 with regex so the test passes on downstream projects that may define additional opcodes.
-
kasuga-fj authored
Fixes #64619 Clang warns diagnostic for non-standard layout types in `offsetof` only if they are in evaluated context. With this patch, you'll also get diagnostic if you use `offsetof` on non-standard layout types in any other contexts
-
Sergei Barannikov authored
1. The generated file contained a lot of duplicate switch cases, e.g.: ``` switch (Syntax) { case AttributeCommonInfo::Syntax::AS_GNU: return llvm::StringSwitch<int>(Name) ... .Case("error", 1) .Case("warning", 1) .Case("error", 1) .Case("warning", 1) ``` 2. Some attributes were listed in wrong places, e.g.: ``` case AttributeCommonInfo::Syntax::AS_CXX11: { if (ScopeName == "") { return llvm::StringSwitch<int>(Name) ... .Case("warn_unused_result", LangOpts.CPlusPlus11 ? 201907 : 0) ``` `warn_unused_result` is a non-standard attribute and should not be available as [[warn_unused_result]]. 3. Some attributes had the wrong version, e.g.: ``` case AttributeCommonInfo::Syntax::AS_CXX11: { } else if (ScopeName == "gnu") { return llvm::StringSwitch<int>(Name) ... .Case("fallthrough", LangOpts.CPlusPlus11 ? 201603 : 0) ``` [[gnu::fallthrough]] is a non-standard spelling and should not have the standard version. Instead, __has_cpp_attribute should return 1 for it. There is another issue with attributes that share spellings, e.g.: ``` .Case("interrupt", true && (T.getArch() == llvm::Triple::arm || ...) ? 1 : 0) .Case("interrupt", true && (T.getArch() == llvm::Triple::avr) ? 1 : 0) ... .Case("interrupt", true && (T.getArch() == llvm::Triple::riscv32 || ...) ? 1 : 0) ``` As can be seen, __has_attribute(interrupt) would only return true for ARM targets. This patch does not address this issue. Differential Revision: https://reviews.llvm.org/D159393 -
Fangrui Song authored
The -fsanitize=alignment implementation follows the model that we allow forming unaligned pointers but disallow accessing unaligned pointers. See [RFC: Enforcing pointer type alignment in Clang](https://lists.llvm.org/pipermail/llvm-dev/2016-January/094012.html) for detail. memcpy is a memory access and we require an `int *` argument to be aligned. Similar to https://reviews.llvm.org/D9673 , emit -fsanitize=alignment check for arguments of builtin memcpy and memmove functions to catch misaligned load like: ``` // Check the alignment of a but ignore the alignment of b void unaligned_load(int *a, void *b) { memcpy(a, b, sizeof(*a)); } ``` For a reference parameter, we emit a -fsanitize=alignment check as well, which can be optimized out by InstCombinePass. We rely on the call site `TCK_ReferenceBinding` check instead. ``` // The alignment check of a will be optimized out. void unaligned_load(int &a, void *b) { memcpy(&a, b, sizeof(a)); } ``` The diagnostic message looks like ``` runtime error: store to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int *' ``` We could use a better message for memcpy, but we don't do it for now as it would require a new check name like misaligned-pointer-use, which is probably not necessary. *RFC: Enforcing pointer type alignment in Clang* is not well documented, but this patch does not intend to change the that. Technically builtin memset functions can be checked for -fsanitize=alignment as well, but it does not seem too useful.
-