- Apr 16, 2022
-
-
Johannes Doerfert authored
The original code relied on the fact that we needed a bitcast instruction (for non constant base objects). With opaque pointers there might not be a bitcast. Always check if reordering is required instead. Fixes: https://github.com/llvm/llvm-project/issues/54896 Differential Revision: https://reviews.llvm.org/D123694
-
William S. Moses authored
-
Aaron Ballman authored
Given the declaration: typedef void func_t(unsigned); __attribute__((noreturn)) func_t func; we would incorrectly determine that `func` had no prototype because the `noreturn` attribute would convert the underlying type directly into a FunctionProtoType, but the declarator for `func` itself was not one for a function with a prototype. This adds an additional check for when the declarator is a type representation for a function with a prototype.
-
Zequan Wu authored
-
Mogball authored
Changes the algorithm of LICM to support graph regions (no guarantee of topologically sorted order). Also fixes an issue where ops with recursive side effects and regions would not be hoisted if any nested ops used operands that were defined within the nested region. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D122465
-
Fangrui Song authored
Legacy PM for optimization pipeline was deprecated in 13.0.0 and Clang dropped legacy PM support in D123609. This change removes legacy PM passes for PGO so that downstream projects won't be able to use it. It seems appropriate to start removing such "add-on" features like instrumentations, before we remove more stuff after 15.x is branched. I have checked many LLVM users and only ldc[1] uses the legacy PGO pass. [1]: https://github.com/ldc-developers/ldc/issues/3961 Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D123834
-
William S. Moses authored
Operation clone is currently faulty. Suppose you have a block like as follows: ``` (%x0 : i32) { %x1 = f(%x0) return %x1 } ``` The test case we have is that we want to "unroll" this, in which we want to change this to compute `f(f(x0))` instead of just `f(x0)`. We do so by making a copy of the body at the end of the block and set the uses of the argument in the copy operations with the value returned from the original block. This is implemented as follows: 1) map to the block arguments to the returned value (`map[x0] = x1`). 2) clone the body Now for this small example, this works as intended and we get the following. ``` (%x0 : i32) { %x1 = f(%x0) %x2 = f(%x1) return %x2 } ``` This is because the current logic to clone `x1 = f(x0)` first looks up the arguments in the map (which finds `x0` maps to `x1` from the initialization), and then sets the map of the result to the cloned result (`map[x1] = x2`). However, this fails if `x0` is not an argument to the op, but instead used inside the region, like below. ``` (%x0 : i32) { %x1 = f() { yield %x0 } return %x1 } ``` This is because cloning an op currently first looks up the args (none), sets the map of the result (`map[%x1] = %x2`), and then clones the regions. This results in the following, which is clearly illegal: ``` (%x0 : i32) { %x1 = f() { yield %x0 } %x2 = f() { yield %x2 } return %x2 } ``` Diving deeper, this is partially due to the ordering (how this PR fixes it), as well as how region cloning works. Namely it will first clone with the mapping, and then it will remap all operands. Since the ordering above now has a map of `x0 -> x1` and `x1 -> x2`, we end up with the incorrect behavior here. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D122531 -
Peter Klausler authored
When a procedure pointer or procedure dummy argument has a defined interface, the rank of the pointer (or dummy) is the rank of the interface. Also tweak code discovered in shape analysis when investigating this problam so that it returns a vector of emptied extents rather than std::nullopt when the extents are not scope-invariant, so that the rank can at least be known. Differential Revision: https://reviews.llvm.org/D123727
-
jfurtek authored
This diff moves `EnumAttr` tablegen definitions (specifically, `IntEnumAttr` and `BitEnumAttr`-related classes) from `OpBase.td` to `EnumAttr.td`. No functionality is changed. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D123551
-
- Apr 15, 2022
-
-
Alex Zinenko authored
LLVM IR is moving towards adoption of opaque pointer types. These require extra information to be passed when constructing some operations, in particular GEP and Alloca. Adapt the builders of said operations and modify the translation code to handle both opaque and non-opaque pointers. This incidentally adds the translation for Alloca alignment and fixes the translation of struct-related GEP indices that must be constant. Reviewed By: wsmoses Differential Revision: https://reviews.llvm.org/D123792
-
Aaron Ballman authored
When emitting a "conflicting types" warning for a function declaration, it's more clear to diagnose the previous declaration specifically as being a builtin if it one.
-
Shilei Tian authored
-
Fraser Cormack authored
Rename them to be more closely related to their non-VP counterparts. Reviewed By: jacquesguan, ym1813382441 Differential Revision: https://reviews.llvm.org/D123847
-
Daniil Kovalev authored
While working on D122986, noticed that indentation size varies even within one file. Fixed that - now indentation is 2 spaces everywhere. This indentation Differential Revision: https://reviews.llvm.org/D123859
-
Corentin Jabot authored
Implement P2036R3. Captured variables by copy (explicitely or not), are deduced correctly at the point we know whether the lambda is mutable, and ill-formed before that. Up until now, the entire lambda declaration up to the start of the body would be parsed in the parent scope, such that capture would not be available to look up. The scoping is changed to have an outer lambda scope, followed by the lambda prototype and body. The lambda scope is necessary because there may be a template scope between the start of the lambda (to which we want to attach the captured variable) and the prototype scope. We also need to introduce a declaration context to attach the captured variable to (and several parts of clang assume captures are handled from the call operator context), before we know the type of the call operator. The order of operations is as follow: * Parse the init capture in the lambda's parent scope * Introduce a lambda scope * Create the lambda class and call operator * Add the init captures to the call operator context and the lambda scope. But the variables are not capured yet (because we don't know their type). Instead, explicit captures are stored in a temporary map that conserves the order of capture (for the purpose of having a stable order in the ast dumps). * A flag is set on LambdaScopeInfo to indicate that we have not yet injected the captures. * The parameters are parsed (in the parent context, as lambda mangling recurses in the parent context, we couldn't mangle a lambda that is attached to the context of a lambda whose type is not yet known). * The lambda qualifiers are parsed, at this point We can switch (for the second time) inside the lambda context, unset the flag indicating that we have not parsed the lambda qualifiers, record the lambda is mutable and capture the explicit variables. * We can parse the rest of the lambda type, transform the lambda and call operator's types and also transform the call operator to a template function decl where necessary. At this point, both captures and parameters can be injected in the body's scope. When trying to capture an implicit variable, if we are before the qualifiers of a lambda, we need to remember that the variables are still in the parent's context (rather than in the call operator's). Reviewed By: aaron.ballman, #clang-language-wg, ChuanqiXu Differential Revision: https://reviews.llvm.org/D119136
-
Roman Lebedev authored
-
Jan Svoboda authored
-
Jan Svoboda authored
-
Jun Zhang authored
Clang should no longer incorrectly diagnose a variable declaration inside of a lambda expression that shares the name of a variable in a containing if/while/for/switch init statement as a redeclaration. After this patch, clang is supposed to accept code below: void foo() { for (int x = [] { int x = 0; return x; }(); ;) ; } Fixes https://github.com/llvm/llvm-project/issues/54913 Differential Revision: https://reviews.llvm.org/D123840 -
Dmitri Gribenko authored
-
Amir Ayupov authored
Handle the case where LLVM_REVISION is undefined (due to LLVM_APPEND_VC_REV=OFF or otherwise) by setting "<unknown>" value as before D123549. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D123852
-
Jan Svoboda authored
This patch changes the return type of `PreprocessorLexer::getFileEntry()` so that its clients may stop using the deprecated APIs of `FileEntry`. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123772
-
Jan Svoboda authored
This patch removes use of the deprecated `{File,Directory}Entry::getName()` from `FileManager` unit tests by using `{File,Directory}EntryRef` instead. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123770 -
Jan Svoboda authored
This patch removes use of the deprecated `DirectoryEntry::getName()` from `collectIncludePCH` by using `{File,Directory}EntryRef` instead. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123769 -
Jan Svoboda authored
This patch removes use of the deprecated `DirectoryEntry::getName()` from clangCodeGen by using `{File,Directory}EntryRef` instead. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123768 -
Jan Svoboda authored
This patch removes use of the deprecated `DirectoryEntry::getName()` from `Parser` by using `{File,Directory}EntryRef` instead. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123767 -
Aaron Ballman authored
This catches places where a function without a prototype is accidentally used, potentially passing an incorrect number of arguments, and is a follow-up to the work done in https://reviews.llvm.org/D122895 and described in the RFC (https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c). The diagnostic is grouped under the new -Wdeprecated-non-prototypes warning group and is enabled by default. The diagnostic is disabled if the function being called was implicitly declared (the user already gets an on-by-default warning about the creation of the implicit function declaration, so no need to warn them twice on the same line). Additionally, the diagnostic is disabled if the declaration of the function without a prototype was in a location where the user explicitly disabled deprecation warnings for functions without prototypes (this allows the provider of the API a way to disable the diagnostic at call sites because the lack of prototype is intentional).
-
Lei Zhang authored
Similar to the existing pattern for reodering cast(transpose), this makes transpose following transpose and increases the chance of embedding the transposition inside contraction op. Actually cast ops are just special instances of elementwise ops. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D123596
-
Momchil Velikov authored
When untagging the stack, the compiler may emit a sequence like: ``` .LBB0_1: st2g sp, [sp], #32 sub x8, x8, #32 cbnz x8, .LBB0_1 stg sp, [sp], #16 ``` These stack adjustments cannot be described by CFI instructions. This patch disables merging of SP update with untagging, i.e. makes the compiler use an additional scratch register (there should be plenty available at this point as we are in the epilogue) and generate: ``` mov x9, sp mov x8, #256 stg x9, [x9], #16 .LBB0_1: sub x8, x8, #32 st2g x9, [x9], #32 cbnz x8, .LBB0_1 add sp, sp, #272 ``` Merging is disabled only when we need to generate asynchronous unwind tables. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D114548 -
Roman Lebedev authored
-
Roman Lebedev authored
[UpdateTestChecks] Prevent rapid onset insanity when forced to write LoopVectorize-driven costmodel tests Subj, or on other words, we have a lot of tests that are driven by the LoopVectorizer's debug output, but we don't have any meaningful way to autogenerate checklines in them, which means that an insurmountable amount of manual work is required when modifying the appropriate cost models. That is not sustainable, so this presents a solution. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D121133
-
LLVM GN Syncbot authored
-
Nikolas Klauser authored
Reviewed By: Mordante, var-const, #libc Spies: sstefan1, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D122982
-
zhongyunde authored
Similar to D122281, we should firstly exclude all scalable vector extending stores and then selectively enable those which we directly support. Also merge integer and float scalable vector into scalable_vector_valuetypes. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D123449
-
Nico Weber authored
-
Clement Courbet authored
Before that change, constant-size `bcmp` would miss an opportunity to generate a more efficient equality pattern and would generate a -1/0-1 pattern instead. Differential Revision: https://reviews.llvm.org/D123849
-
Clement Courbet authored
-
Brad Smith authored
IAS has been enabled on WebAssembly since commit 0a55d3f5.
-
Daniil Kovalev authored
This patch makes possible generating NVPTX assembly check lines with update_llc_test_checks.py utility. Differential Revision: https://reviews.llvm.org/D122986
-