- Sep 03, 2022
-
-
Lei Zhang authored
Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D133168
-
Lei Zhang authored
Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D133167
-
Alex Brachet authored
-
Lei Zhang authored
Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D133054
-
Lei Zhang authored
Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D133041
-
Lei Zhang authored
Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D133234
-
Valentin Clement authored
-
Cole authored
removes LLVM_PREFER_STATIC_ZSTD in favor of using a LLVM_USE_STATIC_ZSTD Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D133222
-
Vitaly Buka authored
-
Chris Bieneman authored
In HLSL buffer types support array subscripting syntax for loads and stores. This change fleshes out the subscript operators to become array accesses on the underlying handle pointer. This will allow LLVM optimization passes to optimize resource accesses the same way any other memory access would be optimized. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D131268
-
LLVM GN Syncbot authored
-
Nikolas Klauser authored
This doesn't affect code-gen Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D132951
-
Nikolas Klauser authored
Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D132790
-
Fangrui Song authored
-
Nikolas Klauser authored
For some reason `operator""s(const char8_t*, size_t)` was marked `noexcept`. Remove it and add regression tests. Reviewed By: ldionne, huixie90, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D132340
-
Fangrui Song authored
-
Nikolas Klauser authored
[libc++] Make the naming of private member variables consistent and enforce it through readability-identifier-naming Reviewed By: ldionne, #libc Spies: aheejin, sstefan1, libcxx-commits Differential Revision: https://reviews.llvm.org/D129386
-
Nikolas Klauser authored
Adding `[[nodiscard]]` to functions is a conforming extension and done extensively in the MSVC STL. Reviewed By: ldionne, EricWF, #libc Spies: #libc_vendors, cjdb, mgrang, jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D128267
-
Jeff Niu authored
Every dialect was dependent on `mlir-headers`, which was causing the build of any single MLIR dialect to pull in a bunch of extra dependencies that aren't needed. Now, MLIR dialects will need to explicitly depend on `MLIR*IncGen` targets to pull in any needed headers. This does not impact the actual `mlir-header` target. Consider the "simple" Arithmetic dialect. Before: ``` % ninja MLIRArithmeticDialect [151/812] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/JSONBackend.cpp.o ``` After: ``` % ninja MLIRArithmeticDialect [207/374] Building CXX object tools/mlir/lib/TableGen/CMakeFiles/MLIRTableGen.dir/GenInfo.cpp.o ``` (Both clean builds) Reviewed By: rriddle, jpienaar Differential Revision: https://reviews.llvm.org/D133132
-
Jeff Niu authored
-
Alex Brachet authored
This function cannot have any instrumentation because it's assembly must match exactly what the debugger is expecting. Previously it was just a list of what sanitizers we expect libc would be sanitized with but this is untenable.
-
Chris Bieneman authored
This change refactors the MuiltiplexExternalSemaSource to take ownership of the underlying sources. As a result it makes a larger cleanup of external source ownership in Sema and the ChainedIncludesSource. Reviewed By: aaron.ballman, aprantl Differential Revision: https://reviews.llvm.org/D133158
-
Fangrui Song authored
-
Valentin Clement authored
This document aims to give insights at the representation of parameterized derived-type (PDTs) in FIR and how PDTs are lowered to FIR and interact with the runtime. Reviewed By: jeanPerier, klausler Differential Revision: https://reviews.llvm.org/D133096
-
Valentin Clement authored
Lowering was truncating 128 bits integer to 64 bits. This patch makes use of APInt to lower 128 bits integer correctly. ``` program bug print *, 170141183460469231731687303715884105727_16 end ! Before patch: 18446744073709551615 ! With patch: 170141183460469231731687303715884105727 ``` Reviewed By: vdonaldson Differential Revision: https://reviews.llvm.org/D133206
-
Valentin Clement authored
Runtime functions expect clean unallocated state for descriptor. This patch adds a call to the runtime function to initialize the temporary derived-type created. Reviewed By: vdonaldson Differential Revision: https://reviews.llvm.org/D133189
-
Chris Bieneman authored
Someday we would like to support HLSL on a wider range of targets, but today targeting anything other than `dxil` is likly to cause lots of headaches. This adds an error and tests to validate that the expected target is `dxil-?-shadermodel`. We will continue to do a best effort to ensure the code we write makes it easy to support other targets (like SPIR-V), but this error will prevent users from hitting frustrating errors for unsupported cases. Reviewed By: jcranmer-intel, Anastasia Differential Revision: https://reviews.llvm.org/D132056
-
Peiming Liu authored
Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D133219
-
Peiming Liu authored
Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D133175
-
Sameer Sahasrabuddhe authored
Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D132931
-
Jeff Niu authored
`ArrayOfAttr` can be used to easily create an attribute that just contains an array of something. The elements can be other attributes, in which case the custom parsers and printers are invoked directly for nice syntax, or any C++ type that supports parsing and printing, either though custom `printer` and `parser` methods or `FieldParser`. An array of integers: ``` def ArrayOfInts : ArrayOfAttr<Test_Dialect, "ArrayOfInts", "array_of_ints", "int32_t">; ``` When embedded in an op's assembly format, it will look like ``` foo.ints value = [1, 2, 3] ``` An array of enums, when embedded in an op's assembly format, will look like: ``` foo.enums value = [first, second, last] ``` Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D133131 -
Yuanfang Chen authored
If a callee function is not interposable, skip debug location check for its callsites. Doing this is instrumentation-friendly otherwise under some conditions this check triggers for some un-inlinable call sites. Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D133060
-
Arthur Eubanks authored
The current code is basically just emulating what the analysis manager does. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D132581
-
Fangrui Song authored
-
Jordan Rupprecht authored
This test, specifically `TwoSignalCallbacks`, can be a little bit flaky, failing in around 5/2000 runs. POSIX says: > If the value of pid causes sig to be generated for the sending process, and if sig is not blocked for the calling thread and if no other thread has sig unblocked or is waiting in a sigwait() function for sig, either sig or at least one pending unblocked signal shall be delivered to the sending thread before kill() returns. The problem is that in test setup, we create a new thread with `std::async` and that is occasionally not cleaned up. This leaves that thread available to eat the signal we're polling for. The need for this to be async does not apply anymore, so we can just make it synchronous. This makes the test passes in 10000 runs. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D133181
-
Fangrui Song authored
-
Christopher Bate authored
This change adds a set of utilities to replace the result of a `tensor.collapse_shape -> tensor.extract_slice` chain with the equivalent result formed by aggregating slices of the `tensor.collapse_shape` source. In general, it is not possible to commute `extract_slice` and `collapse_shape` if linearized dimensions are sliced. The i-th dimension of the `tensor.collapse_shape` result is a "linearized sliced dimension" if: 1) Reassociation indices of tensor.collapse_shape in the i'th position is greater than size 1 (multiple dimensions of the input are collapsed) 2) The i-th dimension is sliced by `tensor.extract_slice`. We can work around this by stitching together the result of `tensor.extract_slice` by iterating over any linearized sliced dimensions. This is equivalent to "tiling" the linearized-and-sliced dimensions of the `tensor.collapse_shape` operation in order to manifest the result tile (the result of the `tensor.extract_slice`). The user of the utilities must provide the mechanism to create the tiling (e.g. a loop). In the tests, it is demonstrated how to apply the utilities using either `scf.for` or `scf.foreach_thread`. The below example illustrates the pattern using `scf.for`: ``` %0 = linalg.generic ... -> tensor<3x7x11x10xf32> %1 = tensor.collapse_shape %0 [[0, 1, 2], [3]] : ... to tensor<341x10xf32> %2 = tensor.extract_slice %1 [13, 0] [10, 10] [2, 1] : .... tensor<10x10xf32> ``` We can construct %2 by generating the following IR: ``` %dest = linalg.init_tensor() : tensor<10x10xf32> %2 = scf.for %iv = %c0 to %c10 step %c1 iter_args(%arg0) -> tensor<10x10xf32> { // Step 1: Map this output idx (%iv) to a multi-index for the input (%3): %linear_index = affine.apply affine_map<(d0)[]->(d0*2 + 11)>(%iv) %3:3 = arith.delinearize_index %iv into (3, 7, 11) // Step 2: Extract the slice from the input %4 = tensor.extract_slice %0 [%3#0, %3#1, %3#2, 0] [1, 1, 1, 10] [1, 1, 1, 1] : tensor<3x7x11x10xf32> to tensor<1x1x1x10xf32> %5 = tensor.collapse_shape %4 [[0, 1, 2], [3]] : tensor<1x1x1x10xf32> into tensor<1x10xf32> // Step 3: Insert the slice into the destination %6 = tensor.insert_slice %5 into %arg0 [%iv, 0] [1, 10] [1, 1] : tensor<1x10xf32> into tensor<10x10xf32> scf.yield %6 : tensor<10x10xf32> } ``` The pattern was discussed in the RFC here: https://discourse.llvm.org/t/rfc-tensor-extracting-slices-from-tensor-collapse-shape/64034 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D129699 -
Mingming Liu authored
1) Tablegen patterns exist to use 'xtn' and 'uzp1' for trunc [1]. Cost table entries are updated based on the actual number of {xtn, uzp1} instructions generated. 2) Without this, an IR instruction like trunc <8 x i16> %v to <8 x i8> is considered free and might be sinked to other basic blocks. As a result, the sinked 'trunc' is in a different basic block with its (usually not-free) vector operand and misses the chance to be combined during instruction selection. (examples in [2]) 3) It's a lot of effort to teach CodeGenPrepare.cpp to sink the operand of trunc without introducing regressions, since the instruction to compute the operand of trunc could be faster (e.g., throughput) than the instruction corresponding to "trunc (bin-vector-op". For instance in [3], sinking %1 (as trunc operand) into bb.1 and bb.2 means to replace 2 xtn with 2 shrn (shrn has a throughput of 1 and only utilize v1 pipeline), which is not necessarily good, especially since ushr result needs to be preserved for store operation in bb.0. Meanwhile, it's too optimistic (for CodeGenPrepare pass) to assume machine-cse will always be able to de-dup shrn from various basic blocks into one shrn. [1] For {v8i16->v8i8, v4i32->v4i16, v2i64->v2i32}, https://github.com/llvm/llvm-project/blob/813ae2871d71f32cce46768e63185cd64651f6e9/llvm/lib/Target/AArch64/AArch64InstrInfo.td#L4472. For concat (trunc, trunc) -> uzip1, https://github.com/llvm/llvm-project/blob/813ae2871d71f32cce46768e63185cd64651f6e9/llvm/lib/Target/AArch64/AArch64InstrInfo.td#L5428-L5437 [2] examples - trunc(umin(X, 255)) -> UQXTRN v8i8 (and other {u,s}x{min,max} pattern for v8i16 operands) from https://github.com/llvm/llvm-project/blob/813ae2871d71f32cce46768e63185cd64651f6e9/llvm/lib/Target/AArch64/AArch64InstrInfo.td#L4515-L4528 - trunc (AArch64vlshr v8i16, imm) -> SHRNv8i8 (same missed for SHRNv2i32) from https://github.com/llvm/llvm-project/blob/813ae2871d71f32cce46768e63185cd64651f6e9/llvm/lib/Target/AArch64/AArch64InstrInfo.td#L6743-L6748 [3] --- ; instruction latency / throughput / pipeline on `neoverse-n1` bb.0: %1 = lshr <8 x i16> %10, <i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4> ; ushr, latency 2, throughput 1, pipeline V1 %2 = trunc <8 x i16> %1 to <8 x i8> ; xtn, latency 2, throughput 2, pipeline V %3 = store <8 x i8> %1, ptr %addr br cond i1 cond, label bb.1, label bb.2 bb.1: %4 = trunc <8 x i16> %1 to <8 x i8> ; xtn bb.2: %5 = trunc <8 x i16> %1 to <8 x i8> ; xtn --- Differential Revision: https://reviews.llvm.org/D132784 -
Daniil Fukalov authored
Each dead def of the same virtual register is required to be split into multiple virtual registers with separate live intervals to avoid MachineVerifier error. Partially fixes https://github.com/llvm/llvm-project/issues/56050 and https://github.com/llvm/llvm-project/issues/56051 Reviewed By: qcolombet Differential Revision: https://reviews.llvm.org/D130477
-
Fangrui Song authored
Similar to 123ce97f for dllimport: dllexport expresses a non-hidden visibility intention. We can consider it explicit and therefore it should override the global visibility setting (see AST/Decl.cpp "NamedDecl Implementation"). Adding the special case to CodeGenModule::setGlobalVisibility is somewhat weird, but allows we to add the code in one place instead of many in AST/Decl.cpp. Differential Revision: https://reviews.llvm.org/D133180
-