- Mar 01, 2023
-
-
Peiming Liu authored
While dense tensors support random accesses, it is critical to visit them in a row-major order for better cache locality. However, we previously consider dense inputs and outputs together when computing constraints for building iteration graph, it could lead us to less efficient iteration graphs. This patch adds a new `SortMask::kIncludeDenseInput` to treat dense inputs/outputs separately when building iteration graph, thus increasing the chance for use to construct a better iteration graph. A more fine-grained approach is to treat each input separately. Note, related to: https://github.com/llvm/llvm-project/issues/51651 Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D144932
-
Med Ismail Bennani authored
Signed-off-by:Med Ismail Bennani <medismail.bennani@gmail.com>
-
Siva Chandra Reddy authored
This is in preparation for the transition to a solution to make libc tests hermetic with respect to their use of errno. The implementation of strdup has been switched over to libc_errno as an example of what the code looks like in the new way. See #61037 for more information. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D144928
-
Alexey Bataev authored
If use_device_ptr/use_device_addr clauses are used on target data directive and no device was specified during the compilation, only host part should be emitted. But it still required to emit captured decls for partially mapped data fields. Differential Revision: https://reviews.llvm.org/D144993
-
Fangrui Song authored
Otherwise clang may invoke ld. If ld is a shell script using `~`, the command will fail since `HOME` is changed.
-
Fangrui Song authored
Follow-up to D144914. -mcpu=help seems fine as a Clang extension not in GCC, because llc supports -mcpu=help. -mcpu=? is a bad choice as ? may be expanded by the shell.
-
Anshil Gandhi authored
Reviewed By: sameerds Differential Revision: https://reviews.llvm.org/D144162
-
Mehdi Amini authored
This is UB, but we shouldn't crash the compiler either. Fixes #61056 Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D144978
-
Med Ismail Bennani authored
In order to run a {break,watch}point command, lldb can resolve to the script interpreter to run an arbitrary piece of code or call into a user-provided function. To do so, we will generate a wrapping function, where we first copy lldb's internal dictionary keys into the interpreter's global dictionary, copied inline the user code before resetting the global dictionary to its previous state. However, {break,watch}point commands can optionally return a value that would tell lldb whether we should stop or not. This feature was only implemented for breakpoint commands and since we inlined the user code directly into the wrapping function, introducing an early return, that caused lldb to let the interpreter global dictionary tinted with the internal dictionary keys. This patch fixes that issue while also adding the stopping behaviour to watchpoint commands. To do so, this patch refactors the {break,watch}point command creation method, to let the lldb wrapper function generator know if the user code is a function call or a arbitrary expression. Then the wrapper generator, if the user input was a function call, the wrapper function will call the user function and save the return value into a variable. If the user input was an arbitrary expression, the wrapper will inline it into a nested function, call the nested function and save the return value into the same variable. After resetting the interpreter global dictionary to its previous state, the generated wrapper function will return the varible containing the return value. rdar://105461140 Differential Revision: https://reviews.llvm.org/D144688 Signed-off-by:Med Ismail Bennani <medismail.bennani@gmail.com>
-
Valery N Dmitriev authored
Removed unnecessary warning workaround. Differential Revision: https://reviews.llvm.org/D144992
-
Sanjay Patel authored
(C - X) + Y --> (Y - X) + C Moving the constant operand to an 'add' gives more flexibility to subsequent reassociation patterns, and it may be better for codegen on targets that don't have subtract-from-immediate instructions.
-
Sanjay Patel authored
Even within this file, the usual spelling is 'Opcode', so make it consistent.
-
Sanjay Patel authored
This is too conservative as noted in the TODO comment.
-
Craig Topper authored
It appears that ICK_Zero_Queue_Conversion was inserted into the ICK enum without updating this table. Easy to do since the table size was set to ICK_Num_Conversion_Kinds. I've used ICR_Exact_Match to match what was previously done for ICK_Zero_Event_Conversion that last time someone noticed this had happened. To prevent this from happening again, I've removed the explicit size and used a static_assert to check the size against ICK_Num_Conversion_Kinds. Differential Revision: https://reviews.llvm.org/D144990
-
Mark de Wever authored
This fixes the Clang modular CI, but breaks other CIs. This reverts commit 2ae39902.
-
Michael Jones authored
Differential Revision: https://reviews.llvm.org/D144991
-
Yitzhak Mandelbaum authored
When building the set of referenced fields for the `DataflowAnalysisContext`, include fields referenced only in default member initializers. These initializers are visited in the CFGs of constructors and so the fields must be included when analysing constructor bodies. Differential Revision: https://reviews.llvm.org/D144987
-
Michael Jones authored
The internal implementation of the string to float function previously used pointer arguments for returning several values. Additionally it set errno in several unexpected places. Now all of that goes through return structs. For readability I also moved the function away from raw pointer arithmetic towards proper indexing. I also added support for rounding modes. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D144597
-
Michael Maitland authored
Clang currently uses `-mcpu=?` and `-mtune=?`. The `?` causes errors on some shells such as zsh since it is a special character. In order for it to work on shells such as zsh, the option must be passed in quotes or escaped. This patch adds `-mcpu=help` and `-mtune=help` as another alias for `--print-supported-cpus`. In llc, `-mcpu=help` is an alias to print supported cpus. Differential Revision: https://reviews.llvm.org/D144914
-
Mark de Wever authored
This commits breaks the libc++ modular build in the precommit CI. This reverts commit 74565c3a.
-
Nikolas Klauser authored
Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D143333
-
V Donaldson authored
A block construct is an execution control construct that supports declaration scopes contained within a parent subprogram scope or another block scope. (blocks may be nested.) This is implemented by applying basic scope processing to the block level. Name uniquing/mangling is extended to support this. The term "block" is heavily overloaded in Fortran standards. Prior name uniquing used tag `B` for common block objects. Existing tag choices were modified to free up `B` for block construct entities, and `C` for common blocks, and resolve additional issues with other tags. The "old tag -> new tag" changes can be summarized as: -> B -- block construct -> new B -> C -- common block C -> YI -- intrinsic type descriptor; not currently generated CT -> Y -- nonintrinsic type descriptor; not currently generated G -> N -- namelist group L -> -- block data; not needed -> deleted Existing name uniquing components consist of a tag followed by a name from user source code, such as a module, subprogram, or variable name. Block constructs are different in that they may be anonymous. (Like other constructs, a block may have a `block-construct-name` that can be used in exit statements, but this name is optional.) So blocks are given a numeric compiler-generated preorder index starting with `B1`, `B2`, and so on, on a per-procedure basis. Name uniquing is also modified to include component names for all containing procedures rather than for just the immediate host. This fixes an existing name clash bug with same-named entities in same-named host subprograms contained in different-named containing subprograms, and variations of the bug involving modules and submodules. F18 clause 9.7.3.1 (Deallocation of allocatable variables) paragraph 1 has a requirement that an allocated, unsaved allocatable local variable must be deallocated on procedure exit. The following paragraph 2 states: When a BLOCK construct terminates, any unsaved allocated allocatable local variable of the construct is deallocated. Similarly, F18 clause 7.5.6.3 (When finalization occurs) paragraph 3 has a requirement that a nonpointer, nonallocatable object must be finalized on procedure exit. The following paragraph 4 states: A nonpointer nonallocatable local variable of a BLOCK construct is finalized immediately before it would become undefined due to termination of the BLOCK construct. These deallocation and finalization requirements, along with stack restoration requirements, require knowledge of block exits. In addition to normal block termination at an end-block-stmt, a block may be terminated by executing a branching statement that targets a statement outside of the block. This includes Single-target branch statements: - goto - exit - cycle - return Bounded multiple-target branch statements: - arithmetic goto - IO statement with END, EOR, or ERR specifiers Unbounded multiple-target branch statements: - call with alternate return specs - computed goto - assigned goto Lowering code is extended to determine if one of these branches exits one or more relevant blocks or other constructs, and adds a mechanism to insert any necessary deallocation, finalization, or stack restoration code at the source of the branch. For a single-target branch it suffices to generate the exit code just prior to taking the indicated branch. Each target of a multiple-target branch must be analyzed individually. Where necessary, the code must first branch to an intermediate basic block that contains exit code, followed by a branch to the original target statement. This patch implements an `activeConstructStack` construct exit mechanism that queries a new `activeConstruct` PFT bit to insert stack restoration code at block exits. It ties in to existing code in ConvertVariable.cpp routine `instantiateLocal` which has code for finalization, making block exit finalization on par with subprogram exit finalization. Deallocation is as yet unimplemented for subprograms or blocks. This may result in memory leaks for affected objects at either the subprogram or block level. Deallocation cases can be addressed uniformly for both scopes in a future patch, presumably with code insertion in routine `instantiateLocal`. The exit code mechanism is not limited to block construct exits. It is also available for use with other constructs. In particular, it is used to replace custom deallocation code for a select case construct character selector expression where applicable. This functionality is also added to select type and associate constructs. It is available for use with other constructs, such as select rank and image control constructs, if that turns out to be necessary. Overlapping nonfunctional changes include eliminating "FIR" from some routine names and eliminating obsolete spaces in comments. -
Yaxun (Sam) Liu authored
Currently SimplifyCFG hoists/sink common instructions in then/else basic blocks when certain options are enabled, which is the case for default clang optimization pipelines for -O3. It tries to hoist/sink convergent function calls in divergent control flow, which causes incorrect ISA generated for GPU, e.g. https://github.com/ROCm-Developer-Tools/HIP/issues/3172 This patch fixes that by conservatively disable hoisting/sinking common convergent function calls in then/else blocks. Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D144756
-
Arthur Eubanks authored
-
Mark de Wever authored
3782. Should <math.h> declare ::lerp? Libc++ doesn't declare ::lerp, adds tests to validate the requirement. Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D142817
-
Philip Reames authored
Using listremove makes it easier to confirm that the code matches the comments. The only in tree users of these lists are not order sensative.
-
Arthur O'Dwyer authored
compile.fail.cpp tests are an anti-feature since they are too easy to break when evolving code. This patch moves various allocator_mismatch tests to .verify.cpp and normalizes the error messages from various containers. Differential Revision: https://reviews.llvm.org/D144913
-
Mark de Wever authored
This was discussed in https://llvm.org/PR61006. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D144894
-
Sacha Ballantyne authored
Previously the mask would be loaded as the appropriate integer type and cast to I1 to pass to fir.if, however this truncates the integer and so would cast 6 to 0. By loading values as logicals and casting to I1 this problem is avoided. Reviewed By: Leporacanthicus Differential Revision: https://reviews.llvm.org/D144974
-
Alex Brachet authored
Differential Revision: https://reviews.llvm.org/D144900
-
Philip Reames authored
Factoring out a shared multiclass imply makes it easier to see that all of these do the same thing, just on different lists. It also makes it easier to see differences - such as we don't define read related pieces for FWRed. Differential Revision: https://reviews.llvm.org/D144899
-
Manupa Karunaratne authored
This commit adds support for atomic fmax/smax/umin support for AMDGPU dialect and the dependent dialects to allow such a lowering. Reviewed By: krzysz00 Differential Revision: https://reviews.llvm.org/D144097
-
Chia-hung Duan authored
Fixed the bug in merging BatchGroups back to the FreeList. Added DCHECKs to ensure the order of BatchGroups This reverts commit 387452ec. Reviewed By: cferris Differential Revision: https://reviews.llvm.org/D144920
-
Nikita Popov authored
Try to fix flang-aarch64-sharedlibs build. 7344f8a8 introduced a use of LLVMCreatePassBuilderOptions(), which is part of the Passes library, while previously only InstCombine was linked.
-
ibricchi authored
Move plugin source and cmake files into separate directory. Typically cmake targets in LLVM have a single target per directory. This change brings this unittest more inline with that structure. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D140588
-
bixia1 authored
[mlir][sparse] Add runtime support for reading a COO tensor and writing the data to the given indices and values buffers. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D143862
-
Corentin Jabot authored
This allows `static_assert(false)` to not be ill-formed in template definitions. This change is applied as a DR in all C++ modes. Of notes, a couple of tests were relying of the eager nature of static_assert * test/SemaTemplate/instantiation-dependence.cpp * test/SemaTemplate/instantiate-var-template.cpp I don't know if the changes to `static_assert` still allow that sort of tests to be expressed. Reviewed By: #clang-language-wg, erichkeane, aaron.ballman Differential Revision: https://reviews.llvm.org/D144285
-
- Feb 28, 2023
-
-
Nikita Popov authored
Invoke InstCombine via the new pass manager, instead of the legacy pass manager.
-
Alexey Bataev authored
When gathering the counter for the reused scalars, need to use reduced value, not the original reduced value. Same values counter is gathered for reduced values, not original ones.
-
Peter Steinfeld authored
When we allocate a variable using a MOLD argument, the function that applies the type of the MOLD argument first checks to see if the variable is already allocated by looking at its descriptor. But in the case of allocating a scalar, the descriptor was not yet been created and the associated memory is uninitialized. This change fixes that. Differential Revision: https://reviews.llvm.org/D144761
-