- Feb 08, 2023
-
-
Ziqing Luo authored
Use clang fix-its to transform declarations of local variables, which are used for buffer access , to be of std::span type. We placed a few limitations to keep the solution simple: - it only transforms local variable declarations (no parameter declaration); - it only considers single level pointers, i.e., pointers of type T * regardless of whether T is again a pointer; - it only transforms to std::span types (no std::array, or std::span::iterator, or ...); - it can only transform a VarDecl that belongs to a DeclStmt whose has a single child. One of the purposes of keeping this patch simple enough is to first evaluate if fix-it is an appropriate approach to do the transformation. This commit was reverted by 622be09c for a compilation warning and now it is fixed. Reviewed by: NoQ, jkorous Differential revision: https://reviews.llvm.org/D139737 -
Mariusz Borsa authored
The fix only affects Darwin, but to write the test I had to modify the MemoryMappingLayout class which is used by all OSes, to allow for mocking of image header (this change should be NFC). Hence no [Darwin] in the subject so I can get more eyes on it. While looking for a memory gap to put the shadow area into, the sanitizer code scans through the loaded images, and for each image it scans through its loader command to determine the occupied memory ranges. While doing so, if the 'segment load' (kLCSegment) loader comand is encountered, the command scanning function returns success (true), but does not decrement the command list iterator counter. The result is that the function is called again and again, with the iterator counter now being too high. The command scanner keeps updating the loader command pointer, by using the command size field. If the loop counter is too high, the command pointer lands into unintended area ( beyond +sizeof(mac_header64)+header->sizeofcmds ), and result depends on the random content found there. The random content interpreted as loader command might contain a large integer value in the cmdsize field - this value is added to the current loader command pointer, which might now point to an inaccessible memory address. It can occasionally result in a crash if it happens to run beyond the mapped memory segment. Note that when the area after the loader command list contains zeros or small integers only, the loop will end normally and the problem will go unnoticed. So it happened until now since having a some big value after the header area, falling into command size field is a pretty rare situation. The fix makes sure that the iterator counter gets updated when the segment load (kLCSegment) loader command is found too, and in the same code location so the updates will always go together. Undo the changes in the sanitizer_procmaps_mac.cpp to see the test failing. rdar://101161047 rdar://102819707 Differential Revision: https://reviews.llvm.org/D142164
-
Amir Ayupov authored
Provide a way to install usable BOLT-optimized Clang (clang + resource headers) using `ninja clang-bolt install-distribution` with BOLT.cmake cache file or `ninja stage2-clang-bolt stage2-install-distribution` with BOLT-PGO.cmake cache file. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D140565
-
Quinn Dawkins authored
The signedness is carried by `!gpu.mma_matrix` types to most closely match the Cooperative Matrix specification which determines signedness with the type (and sometimes the operation). See: https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NV/SPV_NV_cooperative_matrix.html To handle the lowering from vector to gpu, ops such as arith.extsi are pattern matched next to `vector.transfer_read` and `vector.contract` to determine the signedness of the matrix type. Enables s8 and u8 WMMA types in NVVM for the GPUToNVVM conversion. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D143223
-
Ziqing Luo authored
This reverts commit a29e6761.
-
Stella Stamenova authored
Some Ubuntu 20.04 images come with PyYAML 5.3.1 pre-installed through distutils. This makes pip very angry. See https://github.com/yaml/pyyaml/issues/349. Since older versions of PyYAML should work for mlir, relax the version requirement to ease developer setup. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D143523
-
Artem Belevich authored
This produces better SASS than right-shift + truncate and is fairly common for CUDA code that operates on __half2 values represented as opaque integer. Differential Revision: https://reviews.llvm.org/D143448
-
Jason Molenda authored
Add a check for a null destination buffer in SBProcess::ReadMemory, and return an error if that happens. If a Python SB API script tries to allocate a huge amount of memory, the malloc done by the intermediate layers will fail and will hand a null pointer to ReadMemory. lldb will eventually crash trying to write in to that buffer. Also add a test that tries to allocate an impossibly large amount of memory, and hopefully should result in a failed malloc and hitting this error codepath. Differential Revision: https://reviews.llvm.org/D143012 rdar://104846609
-
Florian Hahn authored
Also add an assert using the underlying instruction to catch any potential violations.
-
Fangrui Song authored
-
Jonathon Penix authored
If the only user of the Alloca argument provided to getPromotableAlloca() is the same as the Call argument, StoreValue is never set and results in an assertion failure that isa<> was used on a nullptr when passed into getCandidateConstant(). This was originally seen when trying to build SPEC 2006 416.gamess using flang with lto enabled. Differential Revision: https://reviews.llvm.org/D143457
-
Florian Hahn authored
The test contained a unused load that appears unrelated to the test (store of vector of i1). Remove it to avoid test changes in follow-up change which will lead to dead loads being removed.
-
Adrian Prantl authored
since headers were moved into the lib/ directory.
-
Ziqing Luo authored
Use clang fix-its to transform declarations of local variables, which are used for buffer access , to be of std::span type. We placed a few limitations to keep the solution simple: - it only transforms local variable declarations (no parameter declaration); - it only considers single level pointers, i.e., pointers of type T * regardless of whether T is again a pointer; - it only transforms to std::span types (no std::array, or std::span::iterator, or ...); - it can only transform a VarDecl that belongs to a DeclStmt whose has a single child. One of the purposes of keeping this patch simple enough is to first evaluate if fix-it is an appropriate approach to do the transformation. Reviewed by: NoQ, jkorous Differential revision: https://reviews.llvm.org/D139737
-
Samuel authored
There are a few more uses of CallGraph that should be replaced with LazyCallGraph Also delete legacy version of RPOFunctionAttrs since it is deprecated and LazyCallGraph is not available under the legacy pass manager. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D143358
-
yavtuk authored
We need to search referenced section based on relocations symbol section to properly match end section symbols. For example on some binaries we can observe that init_array_end/fini_array_end might be "placed" in to the gap and since no section could be found for address the relocation would be skipped resulting in wrong ADRP imm after emitting new text resulting in binary sigsegv. Credits for the test to Vladislav Khmelevskii aka yota9.
-
Fangrui Song authored
-
Fangrui Song authored
-
Bill Wendling authored
The interfaces for designators (i.e. C99 designated initializers) was done in two slightly different ways. This was rather wasteful as the differences could be combined into one. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D140584
-
Guillaume Chatelet authored
-
Arthur Eubanks authored
These are part of the optimization pipeline, of which the legacy pass manager version is deprecated. Namely * Internalize * StripSymbols * StripNonDebugSymbols * StripDeadDebugInfo * StripDeadPrototypes * VectorCombine * WarnMissedTransformations Fixed previously failing ocaml tests (one of them seems to already be failing?)
-
Guillaume Chatelet authored
-
Guillaume Chatelet authored
-
Vladislav Dzhidzhoev authored
Clamp the max number of elements of s8/s16 vectors when legalizing G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR, in order to support some wide vectors. Fixes https://github.com/llvm/llvm-project/issues/58156. Differential Revision: https://reviews.llvm.org/D143517
-
Joshua Batista authored
Add codegen for llvm log2 / log10 elementwise builtin The log2/log10 elementwise builtin is necessary for HLSL codegen. Tests were added to make sure that the expected errors are encountered when these functions are given inputs of incompatible types. The new builtins are restricted to floating point types only. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D143207
-
Amir Ayupov authored
-
Diego Caballero authored
Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D143449
-
Fazlay Rabbi authored
Deprecate and diagnose uses of the 'destroy' clauses without an argument in 'omp depobj' directives. Differential Revision: https://reviews.llvm.org/D143021
-
Diego Caballero authored
1-D multi-reductions follow a different lowering path (they are converted to 2-D multi-reductions) so masked variants need to be supported explicitly. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D143453
-
Jan Sjodin authored
This is the first patch of several that will enable generating code for AMD GPUs. It adds the AMDGPU target so it can be used with the --target and -mcpu options. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D143102
-
Siva Chandra Reddy authored
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
-
Dustin Howett authored
Serialization of tokens is required when PCH is used with late parsed templates, including annotation tokens used for pragmas. This patch implements the serialization for annot_pragma_pack. Fixes https://github.com/llvm/llvm-project/issues/60543 Differential Revision: https://reviews.llvm.org/D143410
-
Philip Reames authored
-
Ashay Rane authored
If a test executes quickly or if the timing resolution is too coarse, the running time associated with a test could be zero. This happens often for the //llvm/utils/lit/tests/reorder.py test on Windows, which causes the test to fail non-deterministically. This patch modifies the existing check, so that instead of skipping zeros, lit now skips if the timing is None (presumably due to an error in measurement). Recurring executions of the reorder.py test on Windows seem to indicate that the test no longer exhibits occasional failure. Reviewed By: stella.stamenova Differential Revision: https://reviews.llvm.org/D143504
-
David Green authored
This adjusts the performUADDVCombine to recurse further into adds from reductions, which can help produce more UADDLP when the order of lanes is unimportant. It also prevents some regressions from subsequent patches.
-
Philip Reames authored
Doing so makes it easier to do printf style debugging in idiomatic manner. I followed the code structure of Value with only the definition of dump being #ifdef out in non-debug builds. Not sure if this is the "right" option; we don't seem to have any single consistent scheme on how dump is handled. Note: This is a follow up to D143454 which did the same for EVT. Differential Revision: https://reviews.llvm.org/D143511
-
Nick Desaulniers authored
If this successor list is not correct, then branch-folding may incorrectly think that the indirect target is dead and remove it. This results in a dangling reference to the removed block as an operand to the INLINEASM_BR, which later will get AsmPrinted into code that doesn't assemble. This was made more obvious by, but is not a regression of https://reviews.llvm.org/D130316. Fixes: https://github.com/llvm/llvm-project/issues/60346 Reviewed By: efriedma, void Differential Revision: https://reviews.llvm.org/D142924
-
Nick Desaulniers authored
Link: https://github.com/llvm/llvm-project/issues/60346 Reviewed By: efriedma, void Differential Revision: https://reviews.llvm.org/D142923
-
Paul Walker authored
Just a rerun of update_cc_test_checks.py to capture some changes to variable names after their reliance on instcombine was removed.
-
Simon Pilgrim authored
[X86] combineX86ShufflesRecursively - peek through insert_subvector(undef, x, 0) vector widening nodes If the node is inert then just peek through it and canonicalize the shuffle mask to ensure any referenced upper elements are set to undef.
-