- Apr 16, 2024
-
-
Matthias Springer authored
This commit fixes the following error when stopping the sparse compiler pipeline after bufferization (e.g., with `test-analysis-only`): ``` LLVM ERROR: Building op `vector.print` but it isn't known in this MLIRContext: the dialect may not be loaded or this operation hasn't been added by the dialect. See also https://mlir.llvm.org/getting_started/Faq/#registered-loaded-dependent-whats-up-with-dialects-management ```
-
Pengcheng Wang authored
This PR includes: * vadd.vv/vand.vv/vor.vv/vxor.vv * vmseq.vv/vmsne.vv * vmin.vv/vminu.vv/vmax.vv/vmaxu.vv * vmul.vv/vmulh.vv/vmulhu.vv * vwadd.vv/vwaddu.vv * vwmul.vv/vwmulu * vwmacc.vv/vwmaccu.vv * vadc.vvm There is no test change, I may add it later. Fixes part of #64422 Reviewers: michaelmaitland, preames, lukel97, topperc, asb Reviewed By: topperc, lukel97 Pull Request: https://github.com/llvm/llvm-project/pull/88379
-
Aiden Grossman authored
This patch changes the preprocessor directives surrounding getCurrentTID, particularly moving it out of the block that is only defined when not building for Android. The getCurrentTID function is called in places that only require Linux definitions, so this function should have the same preprocessor scoping around it to prevent link time failures.
-
Chuanqi Xu authored
Close https://github.com/llvm/llvm-project/issues/87609 We tried to profile the body of the lambda expressions in https://reviews.llvm.org/D153957. But as the original comments show, it is indeed dangerous. After we tried to skip calculating the ODR hash values recently, we have fall into this trap twice. So in this patch, I choose to not profile the body of the lambda expression. The signature of the lambda is still profiled.
-
Pengcheng Wang authored
We rename `TuneNoStripWSuffix` to `TunePreferWInst`. If all the users of an instruction just use the low 32 bits, we can convert it to its W variant. A quick test on Coremark (`-O3 -march=rv64gc`): | | W instructions | code size(.text) | |--------|----------------|------------------| | before | 302 | 12257 | | after | 343 | 12265 | | | +13.58% | +0.065% | Reviewers: asb, dtcxzyw, preames, lukel97, michaelmaitland, topperc Reviewed By: topperc, dtcxzyw Pull Request: https://github.com/llvm/llvm-project/pull/87237
-
Martin Storsjö authored
When then linker creates runtime pseudo relocations, it places them in a list with the assumption that the runtime will fix these relocations later, when the image gets loaded. If the relevant runtime function doesn't seem to be present in the linked image, error out. Normally when linking the mingw-w64 runtime libraries, this function always is available. However, if linking without including the mingw-w64 CRT startup files, and the image needs runtime pseudo relocations, make it clear that this won't work as expected at runtime. With ld.bfd, this situation is a hard error too; ld.bfd adds an undefined reference to this symbol if runtime pseudo relocations are needed. A later alternative would be to actually try to pull in the symbol (if seen in a static library, but not included yet). This would allow decoupling the function from the main mingw-w64 CRT startup code (making it optional, only running if the linker actually produced runtime pseudo relocations). Doing that would require restructuring the lld code (gathering pseudo relocations earlier, then loading the relocator function, then pulling in more object files to satisfy the dependencies of the relocator) though. Also, ld.bfd doesn't currently successfully pull in more object files to satisfy the dependency on _pei386_runtime_relocator, so with that in mind, there's not much extra value in making LLD do it currently either; we can't make such a change in mingw-w64's CRT until both linkers handle it. This fixes one issue brought up in https://github.com/llvm/llvm-project/issues/84424.
-
Kazu Hirata authored
Now readNext defaults to unaligned accesses. This patch drops unaligned to improve readability.
-
Daniil Kovalev authored
If `LLVM_TARGETS_TO_BUILD` does not contain `X86` and we try to run an x86 binary in lldb, we get a `nullptr` dereference in `LLVMDisasmInstruction(...)`. We try to call `getDisAsm()` method on a `LLVMDisasmContext *DC` which is null. The pointer is passed from `x86AssemblyInspectionEngine::instruction_length(...)` and is originally `m_disasm_context` member of `x86AssemblyInspectionEngine`. This should be filled by `LLVMCreateDisasm(...)` in the class constructor, but not having X86 target enabled in llvm makes `TargetRegistry::lookupTarget(...)` call return `nullptr`, which results in `m_disasm_context` initialized with `nullptr` as well. This patch adds if statements against `m_disasm_context` in `x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(...)` and `x86AssemblyInspectionEngine::FindFirstNonPrologueInstruction(...)` so subsequent calls to `x86AssemblyInspectionEngine::instruction_length(...)` do not cause a null pointer dereference.
-
martinboehme authored
The newly added test causes an assertion failure in `PropagateResultObject()` without the fix added here.
-
darkbuck authored
Reviewers: rupprecht, aartbik, cyndyishida, Pierre-vh, aemerson, ftynse, hanhanW, banach-space, jayfoad, nicolasvasilache, daniel-grumberg, arsenm, PeimingLiu, JDevlieghere, matthias-springer Reviewed By: arsenm, Pierre-vh Pull Request: https://github.com/llvm/llvm-project/pull/87424
-
Michal Terepeta authored
This adds `RISCVScheduleXSf.td` with `SchedWrite` definitions for all VCIX instructions and uses it in `RISCVSchedSiFive7.td` to set default latencies for these instructions, helping with issue https://github.com/llvm/llvm-project/issues/83391. Of course these default latencies cannot be accurate (since each coprocessor will have different latencies), but this seems to be enough to avoid some of the problematic behavior described in the bug. In any case, this seems to be enough to help with #83391 in our internal testing. A subsequent discussion is how to structure the code such that it's easier for downstream consumers of this to use `SiFive7` scheduling model with accurate VCIX latencies. But we can probably have a separate issue to discuss that.
-
Craig Topper authored
[RISCV] Change how MMO is rebuilt in lowerFixedLengthVectorLoadToRVV/lowerFixedLengthVectorStoreToRVV (#88811) Copy the pointer info, flags, alignment, AAInfo, and ranges, but let getLoad rebuild the MMO using the scalable type used for the the new load/store. This makes sure the LLT minimum size matches the ContainerVT minimum size. This is important since vscale_range may have been used to determine that the fixed vector was the exact size of a scalable vector. Fixes #88799
-
Craig Topper authored
The instruction names should be c.mop.1 instead of cmop.1.
-
Chuanqi Xu authored
Recommit https://github.com/llvm/llvm-project/commit/1ecbab56dcbb78268c8d19af34a50591f90b12a0 Close https://github.com/llvm/llvm-project/issues/80949 The new thing in this commit is to allow to import the function body from instantiations if it is marked with always-inline. See the discussion in https://github.com/llvm/llvm-project/issues/86893 for details.
-
Vlad Mishel authored
This PR addresses issue #88168. It implements an optimization for the case of ``` define i1 @fcmp_fadd_zero_ugt(float %x, float %y) { %add = fadd float %x, 0.000000e+00 %cmp = fcmp ugt float %add, %y ret i1 %cmp } ``` `=>` ``` define i1 @fcmp_fadd_zero_ugt(float %x, float %y) { %cmp = fcmp ugt float %x, %y ret i1 %cmp } ``` and all other types of `fcmp` instructions (`uge`, `ogt`, etc). Proofs: `fadd x, 0.0` https://alive2.llvm.org/ce/z/7FzNnM `fsub x, 0.0` https://alive2.llvm.org/ce/z/puUxLK -
Craig Topper authored
I'm not sure what this was supposed do. Maybe it was for the disassembler, but that should be managed through DecoderNamespace. So let's remove it and simplify the code.
-
Craig Topper authored
This is currently being implied in RISCVISAInfo.cpp. Make it explicit. I'm planning to move all extension information to RISCVFeatures.td and have tablegen create the tables for RISCVISAInfo.cpp. This requires making the creation of RISCVTargetParserDef.inc in tablegen independent of RISCVISAInfo.cpp. So we need an accurate extension list for CPUs in tablegen.
-
Chelsea Cassanova authored
Previously the MallocNanoZone envvar would be set to 0 on Darwin for the LLDB shell tests, but this should guarded behind ASan being enabled as opposed to simply running the test suite behind Darwin. This required that the LLVM_USE_SANITIZER option be added as an attribute to the lit config for shell tests.
-
Valentin Clement (バレンタイン クレメン) authored
Allocatable with cuda device attribute have special semantic for the allocate statement. In flang the allocate statement is lowered to a sequence of runtime call initializing the descriptor and then allocating the descriptor data. This new operation will replace the last runtime call and abstract all the device memory allocation needed. The lowering patch will follow.
-
Arthur Eubanks authored
This reverts commit b4cf63d2. Breaks indirect-branch-tracking-eh2.ll.
-
Usama Hameed authored
This patch tests LLDB integration with libsanitizers for ASan. rdar://111856681
-
Arthur Eubanks authored
These should be already handled by other code. Removing the kernel code model rules right above it cause bss_pagealigned.ll to fail by using a movabsq to get the address of a global, haven't figured out where that code is yet.
-
Kazu Hirata authored
Without this patch, you would typically use readNext as: readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr) which is quite mouthful. Since most serialization/deserialization operations are unaligned accesses, this patch makes the alignment template parameter default to unaligned, allowing us to say: readNext<uint32_t, llvm::endianness::little>(Ptr) I'm including a few examples of migration in this patch. I'll do the rest in a separate patch. Note that writeNext already has the same trick for the alignment template parameter.
-
Qizhi Hu authored
Fix https://github.com/llvm/llvm-project/issues/84020 Skip checking implicit object parameter in the context of `RequiresExprBodyDecl`. Co-authored-by:
huqizhi <836744285@qq.com>
-
Nikita Popov authored
When inserting truncs during IV widening, mark the trunc as either nuw or nsw depending on whether zext or sext widening was used. For non-negative IVs both nuw and nsw apply.
-
Craig Topper authored
For experimental.cttz.elts, we can use a vfirst instruction, but we need to correct the result if input vector can be 0. cttz.elts returns the vector length while vfirst returns -1.
-
Benji Smith authored
These previously were added in the C++ API in 778cf543, but without updating the enum in the C API or mapping functions. Corresponding tests for all current atomicrmw bin ops have been added as well.
-
Shih-Po Hung authored
Use the Val type to estimate the instruction cost for ICmp.
-
Fangrui Song authored
The parameter of `findDebugNamesOffsets` has been renamed to `EndOfHeaderOffset` in #88064 to make it clear it is a section offset instead of an offset relative to the current name index. Rename the call site variable as well.
-
Matthias Braun authored
Increase alignment of `llvm.threadlocal.address` if the pointed to global has higher alignment.
-
Allen authored
When build with option -msve-vector-bits=512, the return vaule of Subtarget->getMinSVEVectorSizeInBits() is 512; While the MinElts is still 4 for <vscale x 4 x double> in getNumInterleavedAccesses, so it creates invalid llvm.aarch64.sve.ld2.sret.nxv4f64, which need be splited. Unlikely, the related custom spilting is not supported now. Fix https://github.com/llvm/llvm-project/issues/88247
-
Fangrui Song authored
https://reviews.llvm.org/D54188 marked "alias" targets as used in C to fix -Wunused false positives. This patch extends the approach to handle mangled names to support global scope names in C++ and the `overloadable` attribute in C. In addition, we mark ifunc targets as used to fix #63957. While our approach has false negatives for namespace scope names, the majority of alias/ifunc C++ uses (global scope with no overloads) are handled. Note: The following function with internal linkage but C language linkage type is mangled in Clang but not in GCC. This inconsistency makes alias/ifunc difficult to use in C++ with portability (#88593). ``` extern "C" { static void f0() {} // GCC: void g0() __attribute__((alias("_ZL2f0v"))); // Clang: void g0() __attribute__((alias("f0"))); } ``` Pull Request: https://github.com/llvm/llvm-project/pull/87130
-
Nico Weber authored
-
Alina Sbirlea authored
Revert "[DAG] Fold extract_subvector(insert_subvector(x,y,c1),c2) --> extract_subvector(y,c2-c1) (#87925)" This reverts commit 8c0f52e9. Reverting to green, reproducer attached in the PR/revision comments.
-
Philip Reames authored
This expansion is directly inspired by the analogous code in the x86 backend for LEA. shXadd and (this sub-case of) LEA are largely equivalent. This is an alternative to https://github.com/llvm/llvm-project/pull/87105. This expansion is also supported via the decomposeMulByConstant callback, but restricted because of interactions with other combines since that code runs before legalization. As discussed in the other review, my original plan had been to support post legalization expansion through the same interface, but that ended up being more complicated than seems justified. Instead, lets go ahead and do the general expansion post-legalize. Other targets use the combine approach, and matching that structure makes it easier for us to adapt ideas from other targets to RISCV.
-
Nikita Popov authored
Remove the fold working on abs in SPF representation now that we canonicalize SPF to intrinsics. This is not strictly NFC because the SPF fold might fire for non-canonical IR due to multi-use, but given the lack of test coverage, I assume this is not important.
-
Wu Yingcong authored
The callee should preserve rbx according to the calling convention, but it is not in the test case `ExecutionEngine/JITLink/x86-64/ELF_vtune.s`. Not preserving the rbx register may result in some random error to the caller function. This patch adds the missing command to preserve the rbx.
-
Adrian Prantl authored
-
Nico Weber authored
-
Fr4nk1in authored
Links to `llvm.mlir.global` and `llvm.mlir.addressof` in the ["Globals" section of LLVM dialect documentation](https://mlir.llvm.org/docs/Dialects/LLVM/#globals) are broken.
-