- Oct 02, 2023
-
-
Martin Storsjö authored
This reverts one part of commit 9f4dfcb7, with a modified comment added about the code. Ideally, this would only be reinstated temporarily - but given the situation in vcpkg, it looks likely that they would keep passing the duplicate options for quite some time. The conflicting CRT choice usually are benign but only would cause warnings about one option overriding the other, if passing e.g. "/MDd /MT". However when vcpkg currently sets these options in CMAKE_*_FLAGS_DEBUG, it passes the redundant option /D_DEBUG; thus the compiler finally ends up with e.g. "/D_DEBUG /MDd /MT", which has the effect of defining _DEBUG while using a release mode CRT, which allegedly breaks the build. There's a PR up for removing this redundant /D_DEBUG option in vcpkg in https://github.com/microsoft/vcpkg/pull/34123. With that in place, this change wouldn't be strictly needed.
-
Matt Arsenault authored
Permit an implicit-def of a virtual register when rematerializing if it defines a super register of a subregister def. The rematerialization pre-legality check should really have been checking the implicit operands, but that should be fixed separately. https://reviews.llvm.org/D156331
-
Uday Bondhugula authored
Add missing punctuation on a LIT driver message.
-
David Sherwood authored
When performing a masked load of an unpacked SVE vector type, i.e. nxv8i8, followed by a zero- or sign-extend to an illegal wide type such as nxv8i32 we typically end up with a combination of an extending masked load and pair(s) of uunpklo/hi or sunpklo/hi instructions. For example, see test @masked_sload_8i8_8i32 in file CodeGen/AArch64/sve-masked-ldst-sext.ll where %aval = call <vscale x 8 x i8> @llvm.masked.load.nxv8i8(... %aext = sext <vscale x 8 x i8> %aval to <vscale x 8 x i32> gets lowered to ld1sb { z1.h }, ... sunpklo z0.s, z1.h sunpkhi z1.s, z1.h Currently the cost for the 'sext' operation in the example above is 1, whereas this patch changes it to 2 to reflect the pair of instructions required. Similarly, when doing a masked load of a nxv8i8 and extending to nxv8i64 the cost is changed to 6 to reflect the 6 unpacks required. -
Matt Arsenault authored
None of the existing MIR tests seem to be directly targeting this situation.
-
Nikita Popov authored
Use the constant folding API instead.
-
Nikita Popov authored
Let the IRBuilder handle the constant folding instead.
-
Matt Arsenault authored
Not sure how to produce a test that demonstrates the problem today. The coalescer would have to introduce a verifier caught SSA violation, like multiple defs of a virtual register. I'm not sure what would do that now, but an upcoming patch will. https://reviews.llvm.org/D156271
-
David Spickett authored
Revert "[Flang] [FlangRT] Introduce FlangRT project as solution to Flang's runtime LLVM integration" This reverts commit 6403287e. This is failing on all but 1 of Linaro's flang builders. CMake Error at /home/tcwg-buildbot/worker/clang-aarch64-full-2stage/llvm/flang-rt/unittests/CMakeLists.txt:37 (message): Target llvm_gtest not found.
-
Matthias Springer authored
Values that are the result of buffer allocation ops are guaranteed to *not* be the same allocation as block arguments of containing blocks. This fact can be used to allow for more aggressive simplification of `bufferization.dealloc` ops.
-
Henrik G. Olsson authored
The addition of the type kind to the profile ID of IntegerLiterals results in e.g. size_t and unsigned long literals mismatch even on platforms where they are canonically the same type. This patch checks the Canonical field to determine whether to canonicalize the type first. rdar://116063468
-
Timm Bäder authored
-
jeanPerier authored
Follow up up of https://github.com/llvm/llvm-project/pull/67693 - Zero initialize uninitialized components of saved derived type entity with a default initial value. - Zero initialize uninitialized storage of common blocks with a member with an initial value. - Zero initialized uninitialized saved equivalence This removes all the cases where fir.global are created with an initial value that results in an undef in LLVM for part of the global, leading in surprising LLVM optimizations at -O2 for Fortran folks that expects there saved variables to be zero initialized if there is no explicit or default initial value.
-
Owen Pan authored
Fixed #66923.
-
Owen Pan authored
Don't remove the outermost parentheses surrounding a return statement expression when inside a function/lambda that has the decltype(auto) return type. Fixed #67892.
-
David Green authored
-
Timm Bäder authored
-
Kai Sasaki authored
In the process of vectorization of the affine loop, the 0 vector size causes the crash with building the invalid AffineForOp. We can catch the case beforehand propagating to the assertion. See: https://github.com/llvm/llvm-project/issues/64262
-
Philip Reames authored
This change adds two related DAG combines which together will take a left-reduce scalar add tree of an explode_vector, and will incrementally form a vector reduction of the vector prefix. If the entire vector is reduced, the result will be a reduction over the entire vector. Profitability wise, this relies on vredsum being cheaper than a pair of extracts and scalar add. Given vredsum is linear in LMUL, and the vslidedown required for the extract is *also* linear in LMUL, this is clearly true at higher index values. At N=2, it's a bit questionable, but I think the vredsum form is probably a better canonical form anyways. Note that this only matches left reduces. This happens to be the motivating example I have (from spec2017 x264). This approach could be generalized to handle right reduces without much effort, and could be generalized to handle any reduce whose tree starts with adjacent elements if desired. The approach fails for a reduce such as (A+C)+(B+D) because we can't find a root to start the reduce with without scanning the entire associative add expression. We could maybe explore using masked reduces for the root node, but that seems of questionable profitability. (As in, worth questioning - I haven't explored in any detail.) This is covering up a deficiency in SLP. If SLP encounters the scalar form of reduce_or(A) + reduce_sum(a) where a is some common vectorizeable tree, SLP will sometimes fail to revisit one of the reductions after vectorizing the other. Fixing this in SLP is hard, and there's no good reason not to handle the easy cases in the backend. Another option here would be to do this in VectorCombine or generic DAG. I chose not to as the profitability of the non-legal typed prefix cases is very target dependent. I think this makes sense as a starting point, even if we move it elsewhere later. This is currently restructed only to add reduces, but obviously makes sense for any associative reduction operator. Once this is approved, I plan to extend it in this manner. I'm simply staging work in case we decide to go in another direction.
-
Mehdi Amini authored
-
Kazu Hirata authored
Without this patch, we pass Endian as one of the parameters to the constructor of DWARFDataExtractor. The problem is that Endian is of: enum endianness {big, little, native}; whereas the constructor is expecting "bool IsLittleEndian". That is, we are relying on an implicit conversion to convert big and little to false and true, respectively. When we migrate llvm::support::endianness to std::endian in future, we can no longer rely on an implicit conversion because std::endian is declared with "enum class". Even if we could, the conversion would not be guaranteed to work because, for example, libcxx defines: enum class endian { little = 0xDEAD, big = 0xFACE, : where big and little are not boolean values. This patch fixes the problem by properly converting Endian to a boolean value. -
Kazu Hirata authored
Without this patch, we pass G.getEndianness() as one of the parameters to DWARFContext::create. The problem is that G.getEndianness() is of: enum endianness {big, little, native}; whereas DWARFContext::create is expecting "bool isLittleEndian". That is, we are relying on an implicit conversion to convert big and little to false and true, respectively. When we migrate llvm::support::endianness to std::endian in future, we can no longer rely on an implicit conversion because std::endian is declared with "enum class". Even if we could, the conversion would not be guaranteed to work because, for example, libcxx defines: enum class endian { little = 0xDEAD, big = 0xFACE, : where big and little are not boolean values. This patch fixes the problem by properly converting G.getEndianness() to a boolean value. -
Zhenyan Zhu authored
This patch updates AffineParallelOp::verify() to check each result type matches its corresponding reduction op (i.e, the result type must be a `FloatType` if the reduction attribute is `addf`) affine.parallel will crash on --lower-affine if the corresponding result type cannot match the reduction attribute. ``` %128 = affine.parallel (%arg2, %arg3) = (0, 0) to (8, 7) reduce ("maxf") -> (memref<8x7xf32>) { %alloc_33 = memref.alloc() : memref<8x7xf32> affine.yield %alloc_33 : memref<8x7xf32> } ``` This will crash and report a type conversion issue when we run `mlir-opt --lower-affine` ``` Assertion failed: (isa<To>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file Casting.h, line 572. PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: mlir-opt --lower-affine temp.mlir #0 0x0000000102a18f18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspacebin/mlir-opt+0x1002f8f18) #1 0x0000000102a171b4 llvm::sys::RunSignalHandlers() (/workspacebin/mlir-opt+0x1002f71b4) #2 0x0000000102a195c4 SignalHandler(int) (/workspacebin/mlir-opt+0x1002f95c4) #3 0x00000001be7894c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4) #4 0x00000001be771ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0) #5 0x00000001be6ac340 (/usr/lib/system/libsystem_c.dylib+0x180264340) #6 0x00000001be6ab754 (/usr/lib/system/libsystem_c.dylib+0x180263754) #7 0x0000000106864790 mlir::arith::getIdentityValueAttr(mlir::arith::AtomicRMWKind, mlir::Type, mlir::OpBuilder&, mlir::Location) (.cold.4) (/workspacebin/mlir-opt+0x104144790) #8 0x0000000102ba66ac mlir::arith::getIdentityValueAttr(mlir::arith::AtomicRMWKind, mlir::Type, mlir::OpBuilder&, mlir::Location) (/workspacebin/mlir-opt+0x1004866ac) #9 0x0000000102ba6910 mlir::arith::getIdentityValue(mlir::arith::AtomicRMWKind, mlir::Type, mlir::OpBuilder&, mlir::Location) (/workspacebin/mlir-opt+0x100486910) ... ``` Fixes #64068 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D157985 -
Martin Storsjö authored
Prior to 591c4b64, the mingw specific linker options -mthreads, -mconsole, -mwindows and -mdll would be tolerated also at compile time, but generating a warning about being unused. After that commit, they were marked as target specific, which means that it's an error if they're unused (which would consider them used for the wrong target). These specific options are only relevant when linking, but we want to tolerate them at compile time too, like before. This was fixed for -mthreads in a79995ca, while the other options didn't seem to be commonly used during compilation. After the 17.x release, we've got more reports about this actually being an issue, in #64464. Therefore, apply the same fix for them; marking them as tolerated for mingw targets during compilation, even if they're unused. Also add a testcase for -mthreads which was already handled. Thus, this fixes #64464.
-
Kazu Hirata authored
Without this patch, we pass Endian as one of the parameters to the constructor of DataExtractor. The problem is that Endian is of: enum endianness {big, little, native}; whereas the constructor is expecting "bool IsLittleEndian". That is, we are relying on an implicit conversion to convert big and little to false and true, respectively. When we migrate llvm::support::endianness to std::endian in future, we can no longer rely on an implicit conversion because std::endian is declared with "enum class". Even if we could, the conversion would not be guaranteed to work because, for example, libcxx defines: enum class endian { little = 0xDEAD, big = 0xFACE, : where big and little are not boolean values. This patch fixes the problem by properly converting Endian to a boolean value. -
Matthias Springer authored
Check that the number of retained operands and updated conditions match.
-
Timm Bäder authored
This broke build bots.
-
- Oct 01, 2023
-
-
Simon Pilgrim authored
-
elhewaty authored
[DAG] Extend the computeOverflowForSignedSub/computeOverflowForUnsignedSub implementations with ConstantRange (#67890) - Add tests for computeOverflowFor*Sub functions - extend the computeOverflowForSignedSub/computeOverflowForUnsignedSub implementations with ConstantRange (#37109)
-
Simon Pilgrim authored
We could maybe extend this by allowing the lowest subop to have multiple uses and extract the lowest subvector result of the concatenated op, but let's just get the fix in first. Fixes #67333
-
Ben Boeckel authored
When custom install names and rpaths setups are used they may not work in the build tree as-is (namely when using absolute paths for install names in order to avoid rpath juggling in downstream projects). Add a flag for opting out of this behaviour. See: https://reviews.llvm.org/D42463
-
Alex Bradbury authored
Without this, various CodeGen tests fail because a RISCV::FCVT_D_W[_IN32X] machine node is created without the rounding mode operand. The relevant PR was committed as bf94ba39
-
Alex Bradbury authored
[RISCV][MC] Fix all remaining fcvt instructions that didn't accept rounding mode but should have (#67889) This is a follow-up to #67555, performing the same fix for the other instructions that had this issue: * fcvt.d.w * fcvt.d.wu * fcvt.s.h * fcvt.d.h As before, we stick to the 'rne' default because this gives maximum compatibility with older LLVM and GNU tools when disassembling. I've also double checked disassembling fp-default-rounding-mode.s with GNU objdump to re-confirm it uses frm=0b000 for these instructions.
-
Matt Arsenault authored
This avoids some redundant spills of subranges, and avoids a compile failure. This greatly reduces the numbers of spills in a loop. The main range is not informative when multiple instructions are needed to fully define a register. A common scenario is a lowered reg_sequence where every subregister is sequentially defined, but each def changes the main range's value number. If we look at specific lanes at the use index, we can see the value is actually the same. In this testcase, there are a large number of materialized 64-bit constant defs which are hoisted outside of the loop by MachineLICM. These are feeding REG_SEQUENCES, which is not considered rematerializable inside the loop. After coalescing, the split constant defs produce main ranges with an apparent phi def. There's no phi def if you look at each individual subrange, and only half of the register is really redefined to a constant. Fixes: SWDEV-380865 https://reviews.llvm.org/D147079
-
Matt Arsenault authored
SplitKit creates questionably formed bundles of copies when it needs to copy a subset of live lanes and can't do it with a single subregister index. These are merely marked as part of a bundle, and don't start with a BUNDLE instruction. Queries for the slot index would give the first copy in the bundle, and we need to inspect the operands of all the other bundled copies. Also fix and simplify detection of read lane subsets. This causes some RISCV test regressions, but these look like accidentally beneficial splits. I don't see a subrange based reason to perform these splits. Avoids some really ugly regressions in a future patch. https://reviews.llvm.org/D146859
-
Christian Sigg authored
https://reviews.llvm.org/D152789 added an `exit` op before each `unreachable`. This means we never get to the `trap` instruction. This change limits the insertion of `exit` instructions to the cases where `unreachable` is not lowered to `trap`. Trap itself is changed to be emitted as `trap; exit;` to convey to `ptxas` that it exits the CFG.
-
Timm Bäder authored
-
Tom Stellard authored
This will make it possible to add visibility attributes to these variables. This also fixes some type mismatches between the declaration and the definition. Reviewed By: bogner, huangjd Differential Revision: https://reviews.llvm.org/D156599
-
Jie Fu authored
C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Object\MachOUniversalWriter.cpp(352) : error C2220: the following warning is treated as an error C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Object\MachOUniversalWriter.cpp(352) : warning C4715: 'llvm::object::writeUniversalBinaryToStream': not all control paths return a value
-
River Riddle authored
Followup to #67628 that relaxes the symbol regex a bit to cover more lldb_private symbols.
-