- Feb 08, 2023
-
-
Kai Luo authored
Remove spill-reload like copy chains. For example ``` r0 = COPY r1 r1 = COPY r2 r2 = COPY r3 r3 = COPY r4 <def-use r4> r4 = COPY r3 r3 = COPY r2 r2 = COPY r1 r1 = COPY r0 ``` will be folded into ``` r0 = COPY r1 r1 = COPY r4 <def-use r4> r4 = COPY r1 r1 = COPY r0 ``` Reviewed By: qcolombet Differential Revision: https://reviews.llvm.org/D122118
-
Joseph Huber authored
Summary: Offloading is not supported on 32-bit applications. We already disable this for 32-bit cross-compiling but we also need to disable it for 32-bit native machines as well.
-
Kai Sasaki authored
ElideSingleElementReduction causes assertion failure when we give 0-D vector. It's possible to fold the case by using vector.extractelement op instead. It's originally reported in https://github.com/llvm/llvm-project/issues/60193. Reviewed By: dcaballe Differential Revision: https://reviews.llvm.org/D143242
-
William Huang authored
This reverts commit 48f163b8.
-
William Huang authored
D139603 (add option to llvm-profdata to reduce output profile size) contains test cases that are not cross-platform. Moving those tests to unit test and making sure the feature is callable from llvm library Reviewed By: snehasish Differential Revision: https://reviews.llvm.org/D141446
-
River Riddle authored
Check if rhs is the dialect to be ordered first, ensuring that we don't inadvertantly order something before it by falling back to pure number comparison. This only shows up depending on the implementation of stable_sort. This was hit in a build of MSVC that was checking for strict ordering.
-
zhongyunde authored
Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D143459
-
Weining Lu authored
Similar to D138503 for RISC-V which fix the flang-OldUnit test failure: ``` .../llvm-project/flang/unittests/Evaluate/real.cpp:504: FAIL: FlagsToBits(prod.flags) == 0x18, not 0x10 0 0x800001 * 0xbf7ffffe ``` With this patch applied, `check-flang` all pass. Reviewed By: vzakhari Differential Revision: https://reviews.llvm.org/D143132
-
Weining Lu authored
Add LoongArch64 linux target specifics to Target.cpp which is similar to RISCV-64 in D136547. For LoongArch, a complex floating-point number, or a structure containing just one complex floating-point number, is passed as though it were a structure containing two floating-point reals. Reviewed By: vzakhari Differential Revision: https://reviews.llvm.org/D143131
-
Monk Chiang authored
The Reduction instruction destination register LMUL is 1. But the source register(vs2) has different LMUL(MF8 to M8). It's beneficial to know how many registers are working on reduction instructions. This patch creates separate SchedWrite for each relevant LMUL that from VS2. Reviewed By: michaelmaitland Differential Revision: https://reviews.llvm.org/D141565
-
Fangrui Song authored
Fix an issue about module linking with LTO. When compiling with PIE, the small data limitation needs to be consistent with that in PIC, otherwise there will be linking errors due to conflicting values. bar.c ``` int bar() { return 1; } ``` foo.c ``` int foo() { return 1; } ``` ``` clang --target=riscv64-unknown-linux-gnu -flto -c foo.c -o foo.o -fPIE clang --target=riscv64-unknown-linux-gnu -flto -c bar.c -o bar.o -fPIC clang --target=riscv64-unknown-linux-gnu -flto foo.o bar.o -flto -nostdlib -v -fuse-ld=lld ``` ``` ld.lld: error: linking module flags 'SmallDataLimit': IDs have conflicting values in 'bar.o' and 'ld-temp.o' clang-15: error: linker command failed with exit code 1 (use -v to see invocation) ``` Use Min instead of Error for conflicting SmallDataLimit. Authored by: @joshua-arch1 Signed-off-by:xiaojing.zhang <xiaojing.zhang@xcalibyte.com> Signed-off-by:
jianxin.lai <jianxin.lai@xcalibyte.com> Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D131230
-
Ziqing Luo authored
This reverts commit aef05b5d. It causes a buildbot failure: https://lab.llvm.org/buildbot/#/builders/216/builds/16879/steps/6/logs/stdio
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D143447
-
Dinar Temirbulatov authored
Add support to allow removing a dead store for scalable types. Avoid to remove scalable type store in favor of fixed type store, since scalable type size is unknown at the compile time. Differential Revision: https://reviews.llvm.org/D142100
-
Ziqing Luo authored
Add a pair of clang pragmas: - `#pragma clang unsafe_buffer_usage begin` and - `#pragma clang unsafe_buffer_usage end`, which specify the start and end of an (unsafe buffer checking) opt-out region, respectively. Behaviors of opt-out regions conform to the following rules: - No nested nor overlapped opt-out regions are allowed. One cannot start an opt-out region with `... unsafe_buffer_usage begin` but never close it with `... unsafe_buffer_usage end`. Mis-use of the pragmas will be warned. - Warnings raised from unsafe buffer operations inside such an opt-out region will always be suppressed. This behavior CANNOT be changed by `clang diagnostic` pragmas or command-line flags. - Warnings raised from unsafe operations outside of such opt-out regions may be reported on declarations inside opt-out regions. These warnings are NOT suppressed. - An un-suppressed unsafe operation warning may be attached with notes. These notes are NOT suppressed as well regardless of whether they are in opt-out regions. The implementation maintains a separate sequence of location pairs representing opt-out regions in `Preprocessor`. The `UnsafeBufferUsage` analyzer reads the region sequence to check if an unsafe operation is in an opt-out region. If it is, discard the warning raised from the operation immediately. Reviewed by: NoQ Differential revision: https://reviews.llvm.org/D140179
-
Louis Dionne authored
-
LLVM GN Syncbot authored
-
Ziqing Luo authored
Two fix-its conflict if they have overlapping source ranges. We shall not emit conflicting fix-its. This patch checks conflicts in fix-its generated for one variable (including variable declaration fix-its and variable usage fix-its). If there is any, we do NOT emit any fix-it for that variable. Reviewed by: NoQ Differential revision: https://reviews.llvm.org/D141338
-
Jason Molenda authored
I'm still getting linux CI bot failures for this test. It's not critical, and it depends on a failure mode that is true on Darwin but I was always gambling that it might fail in the same way on other systems.
-
Jason Molenda authored
I hardcoded nearly a UINT64_MAX number in this test case, and python is not able to convert it to a long on some platforms. Use sys.maxsize instead; this also would have failed if the testsuite was run on a 32-bit system.
-
Justin Bogner authored
Adds an emacs mode for .mir files. For the most part this just consists of keyword rules for various MIR constructs and then appending the llvm-mode keywords to that. This doesn't currently attempt to do anything to be aware of the YAML structure or differentiate between machine IR and embedded LLVM IR.
-
Mehdi Amini authored
This is only useful when building the project in a "standalone" way: that is by invoking cmake pointing at mlir/ to build against an already built LLVM. Fixes #60574
-
Peiming Liu authored
Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D143532
-
Fangrui Song authored
-
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.
-