aboutsummaryrefslogtreecommitdiff
path: root/llvm
AgeCommit message (Collapse)AuthorFilesLines
2024-06-20[AMDGPU] Preserve chain when selecting llvm.amdgcn.pops.exiting.wave.id (#96167)Jay Foad2-1/+41
Without this SelectionDAG could fail assertions when using the intrinsic in a non-entry BB.
2024-06-20[MC] Fix compilationAlexis Engelke1-1/+1
2024-06-20[CodeGen] Use temp symbol for MBBs (#95031)Alexis Engelke6-20/+32
Internal label names never occur in the symbol table, so when using an object streamer, there's no point in constructing these names and then adding them to hash tables -- they are never visible in the output. It's not possible to reuse createTempSymbol, because on BPF has a different prefix for globals and basic blocks right now.
2024-06-20[NewPM] Move PassManager::run() into Impl.h (NFC)Nikita Popov2-45/+49
We use explicit template instantiation for these classes, so there is no need to have the definition in the header. The places that instantiate the method will include the PassManagerImpl.h file.
2024-06-20[ValueTracking] Support gep nuw in isKnownNonZero()Nikita Popov2-2/+60
gep nuw can be null if and only if both the base pointer and offset are null. Unlike the inbounds case this does not depend on whether the null pointer is valid. Proofs: https://alive2.llvm.org/ce/z/PLoqK5
2024-06-20[AArch64] Remove -debug flag from mlicm-csr-mask.mirpvanhout1-1/+1
2024-06-20[LV] Remove loads from null from pr73894.ll test.Florian Hahn1-9/+7
Load from null is UB, load from pointer arg instead.
2024-06-20[MC] Eliminate two symbol-related hash maps (#95464)aengelke14-100/+144
Previously, a symbol insertion requires (at least) three hash table operations: - Lookup/create entry in Symbols (main symbol table) - Lookup NextUniqueID to deduplicate identical temporary labels - Add entry to UsedNames, which is also used to serve as storage for the symbol name in the MCSymbol. All three lookups are done with the same name, so combining these into a single table reduces the number of lookups to one. Thus, a pointer to a symbol table entry can be passed to createSymbol to avoid a duplicate lookup of the same name. The new symbol table entry value is placed in a separate header to avoid including MCContext in MCSymbol or vice versa.
2024-06-20[X86] Fix indention in X86InstrArithmetic.td, NFCIShengchen Kan1-199/+187
2024-06-20[LLVM] Add InsertPosition union-type to remove overloads of ↵Stephen Tozer7-3129/+391
Instruction-creation (#94226) This patch simplifies instruction creation by replacing all overloads of instruction constructors/Create methods that are identical other than the Instruction *InsertBefore/BasicBlock *InsertAtEnd/BasicBlock::iterator InsertBefore argument with a single version that takes an InsertPosition argument. The InsertPosition class can be implicitly constructed from any of the above, internally converting them to the appropriate BasicBlock::iterator value which can then be used to insert the instruction (or to not insert it if an invalid iterator is passed). The upshot of this is that code will be deduplicated, and all callsites will switch to calling the new unified version without any changes needed to make the compiler happy. There is at least one exception to this; the construction of InsertPosition is a user-defined conversion, so any caller that was already relying on a different user-defined conversion won't work. In all of LLVM and Clang this happens exactly once: at clang/lib/CodeGen/CGExpr.cpp:123 we try to construct an alloca with an AssertingVH<Instruction> argument, which must now be cast to an Instruction* by using `&*`. If this is more common elsewhere, it could be fixed by adding an appropriate constructor to InsertPosition.
2024-06-20[AMDGPU] Add ALL prefix to all RUN lines for better diagnosticsJay Foad1-6/+6
2024-06-20[ARM] CMSE security mitigation on function arguments and returned values ↵Lucas Duarte Prates4-15/+953
(#89944) The ABI mandates two things related to function calls: - Function arguments must be sign- or zero-extended to the register size by the caller. - Return values must be sign- or zero-extended to the register size by the callee. As consequence, callees can assume that function arguments have been extended and so can callers with regards to return values. Here lies the problem: Nonsecure code might deliberately ignore this mandate with the intent of attempting an exploit. It might try to pass values that lie outside the expected type's value range in order to trigger undefined behaviour, e.g. out of bounds access. With the mitigation implemented, Secure code always performs extension of values passed by Nonsecure code. This addresses the vulnerability described in CVE-2024-0151. Patches by Victor Campos. --------- Co-authored-by: Victor Campos <victor.campos@arm.com>
2024-06-20[AMDGPU] Add a RUN line to test the OSABI-PAL-ERR prefixJay Foad1-0/+1
2024-06-20[AMDGPU] Fix GFX90A/GFX940 check prefix typosJay Foad2-2/+2
2024-06-20[AMDGPU] Tweak comment to fix warning from filecheck_lint.pyJay Foad1-2/+2
2024-06-20[AMDGPU] Fix typo "GXF" in check prefixJay Foad1-17/+17
2024-06-20[MachineLICM] Work-around Incomplete RegUnits (#95926)Pierre van Houtryve3-10/+85
Reverts the behavior introduced by 770393b while keeping the refactored code. Fixes a miscompile on AArch64, at the cost of a small regression on AMDGPU. #96146 opened to investigate the issue
2024-06-20[MC] Remove SectionKind from MCSection (#96067)aengelke27-328/+224
There are only three actual uses of the section kind in MCSection: isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and store other info in the actual section variants where required. ELF and COFF flags also encode all relevant information, so for these two section variants, remove the SectionKind parameter entirely. This allows to remove the string switch (which is unnecessary and inaccurate) from createELFSectionImpl. This was introduced in [D133456](https://reviews.llvm.org/D133456), but apparently, it was never hit for non-writable sections anyway and the resulting kind was never used.
2024-06-20[IR] Remove support for shl constant expressions (#96037)Nikita Popov18-141/+25
Remove support for shl constant expressions, as part of: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179
2024-06-20[LLVM] Extend setModuleFlag interface. (#86031)Daniel Kiss3-0/+27
Add same interfaces variants to the `Module::setModuleFlag` as the `Module::addModuleFlag` has.
2024-06-20Reland "[CVP] Check whether the default case is reachable (#79993)" (#96089)Yingwei Zheng3-5/+339
This patch reverts https://github.com/llvm/llvm-project/pull/81585 as https://github.com/llvm/llvm-project/pull/78582 has been landed. Now clang works well with reproducer https://github.com/llvm/llvm-project/pull/79993#issuecomment-1936822679.
2024-06-20[NFC] Fix header level in LangRefQiu Chaofan1-1/+1
2024-06-20[RISCV] Lower llvm.clear_cache to __riscv_flush_icache for glibc targets ↵Roger Ferrer Ibáñez4-0/+80
(#93481) This change is a preliminary step to support trampolines on RISC-V. Trampolines are used by flang to implement obtaining the address of an internal program (i.e., a nested function in Fortran parlance). In this change we lower `llvm.clear_cache` intrinsic on glibc targets to `__riscv_flush_icache` which is what GCC is currently doing for Linux targets.
2024-06-20[PowerPC] Make verifier happy after peephole on MMA COPYs (#94321)Kai Luo2-7/+39
2024-06-20[ADT] Update hash function of uint64_t for DenseMap (#95734)Chuanqi Xu1-2/+5
(Background: See the comment: https://github.com/llvm/llvm-project/pull/92083#issuecomment-2168121729) It looks like the hash function for 64bits integers are not very good: ``` static unsigned getHashValue(const unsigned long long& Val) { return (unsigned)(Val * 37ULL); } ``` Since the result is truncated to 32 bits. It looks like the higher 32 bits won't contribute to the result. So that `0x1'00000001` will have the the same results to `0x2'00000001`, `0x3'00000001`, ... Then we may meet a lot collisions in such cases. I feel it should generally good to include higher 32 bits for hashing functions. Not sure who's the appropriate reviewer, adding some people by impressions.
2024-06-19[JITLink] Use MapVector to stabilize iteration orderFangrui Song1-2/+3
Otherwise LinkGraph::dump output could change (llvm/test/ExecutionEngine/JITLink/x86-64/COFF_pdata_strip.s) when llvm::hash_value(StringRef) changes.
2024-06-19[JITLink] Ensure Edges order is deterministicFangrui Song1-1/+2
2024-06-19[TableGen,GlobalISel] Use MapVector to stabilize iteration orderFangrui Song1-1/+1
Otherwise llvm/test/TableGen/GlobalISelCombinerEmitter/type-inference.td could fail when llvm::hash_value(StringRef) changes. Fix #66377
2024-06-19[Attributor] Stabilize llvm.assume outputFangrui Song3-19/+24
Don't rely on the iteration order of DenseSet<StringRef>, which is not guaranteed to be deterministic.
2024-06-19[LowerTypeTests] Use MapVector to stabilize iteration orderFangrui Song2-6/+6
Otherwise llvm/test/LTO/X86/cfi_jt_aliases.ll could fail when DenseMapInfo<StringRef> changes.
2024-06-19[llvm-cov] let text mode divider honor --show-branch-summary, ↵Wentao Zhang1-6/+23
--show-region-summary etc (#96016)
2024-06-19[PowerPC] Remove extraneous ArrayRef (NFC) (#96092)Kazu Hirata1-6/+6
ArrayRef can be implicitly constructed from a C array while inferring its size.
2024-06-19[Support] Add llvm::xxh3_128bits (#95863)Brendan Duke3-35/+623
Add a 128-bit xxhash function, following the existing `llvm::xxh3_64bits` and `llvm::xxHash` implementations. Previously, 48e93f57f1ee914ca29aa31bf2ccd916565a3610 added support for `llvm::xxh3_64bits`, which closely follows the upstream implementation at https://github.com/Cyan4973/xxHash, with simplifications from Devin Hussey's xxhash-clean. However, it is desirable to have a larger 128-bit hash key for use cases such as filesystem checksums where chance of collision needs to be negligible. So to that end this also ports over the 128-bit xxh3_128bits as `llvm::xxh3_128bits`. Testing: - Add a test based on xsum_sanity_check.c in upstream xxhash.
2024-06-19[VPlan] Introduce isHeaderMask helper (NFCI).Florian Hahn4-4/+65
Split off from https://github.com/llvm/llvm-project/pull/92555 and slightly generalized to more precisely check for a header mask. Use it to replace manual checks in collectHeaderMasks.
2024-06-19[DirectX] Add trig intrinsics and link them with DXIL backend (#95968)Farzon Lotfi15-0/+427
This change is part of this proposal: https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294 This is part 1 of 4 PRs. It sets the ground work for adding the intrinsics. Add DXIL Lower for `acos`, `asin`, `atan`, `cosh`, `sinh`, and `tanh` https://github.com/llvm/llvm-project/issues/70079 https://github.com/llvm/llvm-project/issues/70080 https://github.com/llvm/llvm-project/issues/70081 https://github.com/llvm/llvm-project/issues/70083 https://github.com/llvm/llvm-project/issues/70084 https://github.com/llvm/llvm-project/issues/95966
2024-06-19[ADT] Fix incorrect const parent ptr type in ilist (#96059)Stephen Tozer8-49/+68
Fixes issue reported in: https://github.com/llvm/llvm-project/pull/94224 The recent commit above added an ilist_parent<ParentTy> option, which added a parent pointer to the ilist_node_base type for the list. The const methods for returning that parent pointer however were incorrectly implemented, returning `const ParentPtrTy`, which is equivalent to `ParentTy * const` rather than `const ParentTy *`. This patch fixes this by passing around `ParentTy` in ilist's internal logic rather than `ParentPtrTy`, removing the ability to have a `void*` parent pointer but cleanly fixing this error.
2024-06-19[DirectX][DXIL] Update DXIL Op TableGen Specification (#95807)S. Bharadwaj Yadavalli1-92/+219
Add a mechanism to specify constraints to the design document. These facilitate specification of DXIL Op attributes that are predicated by Shader Model version.
2024-06-19[RLEV] Add coverage for expansion of umin EVL idiomPhilip Reames1-1/+104
2024-06-19[DenseMap] Update combineHashValueFangrui Song1-11/+13
`combineHashValue` is a custom bit mixer from 2008 (5fc8ab6d187aefbf1d2cbd36e191e675b14db8f6) used for std::pair and std::tuple. It has a long dependency chain and slow. Replace it with a simply multiply-xorshift style hash using a constant from splitmix64[1]. abseil-cpp and carbon also use this style, but with uint128 to probably get a lower avalanche bias. We don't use uint128 for MSVC portability. Measured time to compute [0,1000000000) values on an i7-11850H: * old: 1.163s * new: 0.427s [1]: https://jonkagstrom.com/tuning-bit-mixers/index.html Pull Request: https://github.com/llvm/llvm-project/pull/95970
2024-06-19[GlobalMerge] Use MapVector to stabilize iteration orderFangrui Song2-11/+12
DenseMap iteration order is not guaranteed to be deterministic. Without the change, llvm/test/Transforms/GlobalMerge/basic.ll could fail when `combineHashValue` changes (#95970).
2024-06-19[gn/mac] Fix isysroot flag when building compiler-rtNico Weber1-1/+1
If the GN arg `sysroot` was set to a root-relative path like e.g. `"//sysroot"`, we weren't rebasing it correctly, leading to warnings from clang about it ignoring a non-existent sysroot. Similar to 6073f87d7f160.
2024-06-19[InstCombine] Swap out range metadata to range attribute for ↵Andreas Jonson2-19/+56
arm_mve_pred_v2i (#94847)
2024-06-19[LV] Consider insts feeding interleave group pointers free.Florian Hahn3-26/+34
For interleave groups, we only generate a pointer for the start of the interleave group (the instruction at the insert position). The other addresses for other members are alreayd considered free, but so are their operands, if they are only used in address computations for other interleave group members.
2024-06-19[SCEV] Use context sensitive reasoning in howFarToZero (#94525)Philip Reames3-32/+39
This change builds on 0a357ad which supported non-constant strides in howFarToZero, but used only context insensitive reasoning. This change does two things: 1) Directly use context sensitive queries to prove facts established before the loop. Note that we technically only need facts known at the latch, but using facts known on entry is a conservative approximation which will cover most everything. 2) For the non-zero check, we can usually prove non-zero from the finite assumption implied by mustprogress. This eliminates the need to do the context sensitive query in the common case.
2024-06-19[PowerPC] Regenerate p8altivec-shuffles-pred.ll with update_llc_test_checks ↵Simon Pilgrim1-9/+10
script
2024-06-19[X86] Regenerate vector-truncate-combine.ll to check entire code sequenceSimon Pilgrim1-5/+9
2024-06-19[SCEVExpander] Recognize urem idiom during expansion (#96005)Philip Reames4-9/+16
If we have a urem expression, emitting it as a urem is significantly better that letting the fully expansion kick in. We have the risk of a udiv or mul which could have previously been shared, but loosing that seems like a reasonable tradeoff for being able to round trip a urem w/o modification.
2024-06-19[AVR] Let ArrayRef infer the array size (NFC) (#96076)Kazu Hirata1-4/+4
2024-06-19AMDGPU/gfx12: Minor documentation update (#96079)Nicolai Hähnle1-7/+7
2024-06-19[NFC][SPARC] Fix typos and style mismatchesKoakuma3-7/+7
Fix style errors accidentally introduced in PRs #87259 and #94245. Reviewers: rorth, jrtc27, brad0, s-barannikov Reviewed By: s-barannikov Pull Request: https://github.com/llvm/llvm-project/pull/96019