aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-06-20[C11] Claim conformance to WG14 N3159Aaron Ballman1-1/+2
This was a roll-up of defect reports that we already test elsewhere, so no additional test coverage is needed. DR345: tested by clang/test/C/drs/dr3xx.c DR344: tested by clang/test/C/drs/dr3xx.c DR343: tested by clang/test/C/drs/dr3xx.c DR341: tested by clang/test/C/drs/dr3xx.c DR340: tested by clang/test/C/drs/dr3xx.c DR338: tested by clang/test/C/drs/dr338.c DR336: N/A for the compiler DR330: N/A for the compiler DR329: N/A for the compiler DR328: tested by clang/test/C/drs/dr3xx.c DR327: editorial DR326: N/A for the compiler DR315: tested by clang/test/C/drs/dr3xx.c
2024-06-20[DebugInfo][TailCallElim] Drop the debug location of AccRecInstrNew (#95742)Shan Huang2-0/+111
Fix #95731 .
2024-06-20[C11] Remove N1350 and N1394 from the list of documents on the C status pageAaron Ballman1-10/+0
These papers added Annex K, which is a library component that Clang doesn't need to do anything to support.
2024-06-20[SCEV] Handle nusw/nuw gep flags for addrecsNikita Popov2-9/+153
Set the nw flag is gep has any nowrap flags. Transfer the nuw flag. Also set nuw for the nusw + nneg combination.
2024-06-20Fix Android build failure in InferIntRangeCommon (#96154)Thomas Preud'homme1-16/+18
As of today, Android's libcxx is missing C++17's std::function's CTAD added in e1eabcdfad89f67ae575b0c86aa4a72d277378b4. This leads to InferIntRangeCommon.cpp to fail to compile. This commit makes the template parameter of std::function in that function explicit, therefore avoiding CTAD. While LLVM/MLIR's requirement is C++17, the rest of the code builds fine so hopefully this is acceptable.
2024-06-20[Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed ↵Mital Ashok2-1/+70
(#95846) 3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f changed it so that not all potentially-evaluated `typeid`s were marked as potentially-throwing, but I forgot to check the subexpression if the null check of the `typeid` didn't potentially-throw. This adds that check.
2024-06-20[AMDGPU] Precommit a test for llvm.amdgcn.pops.exiting.wave.idJay Foad1-0/+32
2024-06-20[clang-doc] Add --asset option to clang-doc (#94717)PeterChou12-19/+83
Adds a new option --asset which allows users to specify the asset folder for the html output of clang-doc.
2024-06-20[flang] implement assumed-rank in ENTRY (#96111)jeanPerier2-5/+28
With `createUnallocatedBox` utility change from #96106 , the TODO for assumed-rank in entry can simply be lifted and test is added. The key is that a unallocated assumed-rank descriptor is created with rank zero in the entry where an assumed-rank dummy from some other entry do not appear as a dummy (the symbol must still be mapped to some valid value because the symbol could be used in code that would be unreachable at runtime, but that the compiler must still generate).
2024-06-20[X86][CodeGen] Not emit mr_ND if rr_ND is commutableShengchen Kan6-52/+66
This gives us more chance to compress instruction in X86CompressEVEX.cpp b/c mr_ND is not a candidate of instructions to be compressed while rm_ND is.
2024-06-20[mlir][gpu] Remove old GPU serialization passes (#94998)Fabian Mora9-731/+1
This patch removes the last vestiges of the old gpu serialization pipeline. To compile GPU code use target attributes instead. See [Compilation overview | 'gpu' Dialect - MLIR docs](https://mlir.llvm.org/docs/Dialects/GPU/#compilation-overview) for additional information on the target attributes compilation pipeline that replaced the old serialization pipeline.
2024-06-20[flang] lower assumed-ranks captured in internal procedures (#96106)jeanPerier4-10/+155
Note: the added test fails because it needs the `associateMutableBox` change from https://github.com/llvm/llvm-project/pull/96082. I will rebase this PR once the other is merged.
2024-06-20[SCEV] Transfer gep nusw and nuw flagsNikita Popov2-11/+97
nusw implies nsw offset and nuw base+offset arithmetic if offset is non-negative. nuw implies nuw offset and base+offset arithmetic. As usual, we can only transfer is poison implies UB.
2024-06-20[VPlan] Model middle block via VPIRBasicBlock. (#95816)Florian Hahn53-169/+218
Use VPIRBasicBlock to wrap the middle block and implement patching up branches in predecessors in VPIRBasicBlock::execute. The IR middle block is only created after skeleton creation. Initially a regular VPBasicBlock is created, which will later be replaced by a VPIRBasicBlock once the middle IR basic block has been created. Note that this slightly changes the order of instructions created in the middle block; code generated by recipe execution in the middle block will now be inserted before the terminator (and in between the compare to used by the terminator). The original order will be restored in https://github.com/llvm/llvm-project/pull/92651. PR: https://github.com/llvm/llvm-project/pull/95816
2024-06-20Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802)Mariya Podchishchaeva95-107/+3324
This commit implements the entirety of the now-accepted [N3017 -Preprocessor Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and its sister C++ paper [p1967](https://wg21.link/p1967). It implements everything in the specification, and includes an implementation that drastically improves the time it takes to embed data in specific scenarios (the initialization of character type arrays). The mechanisms used to do this are used under the "as-if" rule, and in general when the system cannot detect it is initializing an array object in a variable declaration, will generate EmbedExpr AST node which will be expanded by AST consumers (CodeGen or constant expression evaluators) or expand embed directive as a comma expression. This reverts commit https://github.com/llvm/llvm-project/commit/682d461d5a231cee54d65910e6341769419a67d7. --------- Co-authored-by: The Phantom Derpstorm <phdofthehouse@gmail.com> Co-authored-by: Aaron Ballman <aaron@aaronballman.com> Co-authored-by: cor3ntin <corentinjabot@gmail.com> Co-authored-by: H. Vetinari <h.vetinari@gmx.com>
2024-06-20[ADT] DenseMapInfo<unsigned long>::getHashValue - avoid MSVC out of bounds ↵Simon Pilgrim1-2/+2
shift warning (#96173) Fixes MSVC warning after #95734 - despite it taking the `sizeof(Val) == 4` path, it still warns that the 32-bit unsigned long shift by 32 is out of bounds.
2024-06-20[SLP] NFC. Reduce redundant assignment. (#96149)Han-Kuan Chen1-4/+2
2024-06-20[offload][cmake] always define pythonize_bool macro (#96028)Wu Yingcong1-7/+7
I use the following cmake config to build offload and openmp ``` cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_RUNTIMES="offload" -DLLVM_LIT_ARGS="-vv -a" -DLLVM_ENABLE_ASSERTIONS=ON ../llvm ``` and got the following error: ``` CMake Error at /tmp/build-llvm/llvm/offload/CMakeLists.txt:321 (pythonize_bool): Unknown CMake command "pythonize_bool". ``` After some search I find out that the "correct" way to build this is putting openmp and offload to the ENABLE_RUNTIMES like ``` cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="openmp;offload" -DLLVM_LIT_ARGS="-vv -a" -DLLVM_ENABLE_ASSERTIONS=ON ../llvm ``` . But since we don't forbid to config them using openmp as PROJECT and offload as RUNTIME, then we probably support it. The fix is to always define the pythonize_bool macro. For cmake, it is okay to redefine a macro, it does not cause a warning or else.
2024-06-20[clang] Change style of superseded issues on C++ DR status page (#96051)Vlad Serebrennikov2-51/+70
This patch changes how superseded issues inherit the color of the issues that superseded them. Now they reduce the opacity of the color from 1.0 to 0.65, to make them distinguishable. This was requested during the review of #94876. That's how it's going to look: ![a1rYVHQ](https://github.com/llvm/llvm-project/assets/12883766/00e624c0-accb-4440-9f9b-4089a157aab2)
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-20Fix bazel build past e2296d8295516e9991cd6ca99ba193fbd232b6da (#96166)Danial Klimkin1-0/+1
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[MLIR][Vector] Generalize DropUnitDimFromElementwiseOps to non leading / ↵Hugo Trachino2-26/+65
trailing dimensions. (#92934) Generalizes `DropUnitDimFromElementwiseOps` to support inner unit dimensions. This change stems from improving lowering of contractionOps for Arm SME. Where we end up with inner unit dimensions on MulOp, BroadcastOp and TransposeOp, preventing the generation of outerproducts. discussed [here](https://discourse.llvm.org/t/on-improving-arm-sme-lowering-resilience-in-mlir/78543/17?u=nujaa). --------- Co-authored-by: Benjamin Maxwell <macdue@dueutil.tech>
2024-06-20[flang][OpenMP] support more reduction types for procedure designators (#96057)Tom Eccles4-68/+444
This re-uses reduction declarations from intrinsic operators to add support for reductions of allocatables, pointers, and arrays with procedure designators (e.g. min/max). I have split this into two commits to make it easier to review. The first one makes the functional change. The second cleans things up now that we can share much more code between intrinsic operators and procedure designators.
2024-06-20[MC] Eliminate two symbol-related hash maps (#95464)aengelke15-101/+147
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 Tozer12-3138/+396
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[mlir][ArmSME] Lower extract from 2D scalable create_mask to psel (#96066)Benjamin Maxwell6-10/+168
Example: ```mlir %mask = vector.create_mask %a, %b : vector<[4]x[8]xi1> %slice = vector.extract %mask[%index] : vector<[8]xi1> from vector<[4]x[8]xi1> ``` Becomes: ```mlir %mask_rows = vector.create_mask %a : vector<[4]xi1> %mask_cols = vector.create_mask %b : vector<[8]xi1> %slice = arm_sve.psel %mask_cols, %mask_rows[%index] : vector<[8]xi1>, vector<[4]xi1> ``` Note: While psel is under ArmSVE it requires SME (or SVE 2.1), so this is currently the most logical place for this lowering.
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[LLD] [MinGW] Interpret an empty -entry option as no entry point (#96055)Martin Storsjö2-1/+5
This fixes https://github.com/llvm/llvm-project/issues/93309, and seems to match how GNU ld handles this case.
2024-06-20[clang] Fix `static_cast` to array of unknown bound (#96041)Mariya Podchishchaeva3-0/+37
Per P1975R0 an expression like static_cast<U[]>(...) defines the type of the expression as U[1]. Fixes https://github.com/llvm/llvm-project/issues/62863
2024-06-20mmapForContinuousMode: Align Linux's impl to __APPLE__'s more. NFC. (#95702)NAKAMURA Takumi1-4/+26
2024-06-20[nsan] Fix style issueFangrui Song12-869/+841
The initial check-in of compiler-rt/lib/nsan #94322 has a lot of style issues. Fix them before the history becomes more useful. Pull Request: https://github.com/llvm/llvm-project/pull/96142
2024-06-20Update ExternalPreprocessorSource.h (#96144)Danial Klimkin1-0/+3
Add missing includes.
2024-06-20Fix bazel build past abd95342f0b94e140b36ac954b8f8c29b1393861 (#96143)Danial Klimkin1-0/+27
2024-06-20[mlir][vector] Disable Gather1DToConditionalLoads for scalable vectors (#96049)Cullen Rhodes2-0/+13
Pattern scalarizes vector.gather operations and is incorrect for scalable vectors.
2024-06-20[flang] lower assumed-rank TARGET to intent(in) POINTER (#96082)jeanPerier3-4/+26
The only special thing to do is to use fir.rebox_assumed_rank when reboxing the target to properly set the POINTER attribute inside the descriptor.
2024-06-20[flang] enable copy-in/out of assumed-rank arrays (#96080)jeanPerier2-2/+37
Just remove the TODO and add a test. There is nothing special to do to deal with assumed-rank copy-in/out after the previous copy-in/out API change in https://github.com/llvm/llvm-project/pull/95822.