- Apr 26, 2023
-
-
Neumann Hon authored
Differential Revision: https://reviews.llvm.org/D148821
-
Craig Topper authored
If the -0.0 has multiple uses we won't fold the reduction.
-
Florian Hahn authored
Add handling for `mul nsw` for signed systems based on the logic for `mul nuw` for unsigned.
-
Florian Hahn authored
Split up larger test functions into 2 versions, one with the checks in the then and one with the checks in the else block. The original versions of the function caused timeouts even with larger thresholds. The new versions verify very quickly.
-
Julian Lettner authored
The kernel and kext environments do not provide the `__cxa_atexit()` function, so we can't use it for lowering global module destructors. Unfortunately, just querying for "compiling for kernel/kext?" in the LTO pipeline isn't possible (kernel/kext identifier isn't part of the triple yet) so we need to pass down a CodeGen flag. rdar://93536111 Differential Revision: https://reviews.llvm.org/D148967
-
Philip Reames authored
This is a follow on to D147117 and D147355. In both cases, we were adding special cases to compute zext(BTC+1) instead of zext(BTC)+1 when the BTC+1 computation was known not to overflow. Differential Revision: https://reviews.llvm.org/D148661
-
Florian Hahn authored
-
Joseph Huber authored
Summary: This causes problems when included. Fix this to hopefully get the bots working again.
-
Joseph Huber authored
Summary: The previous GPU `libc` patch added support for `atoi`. However, it didn't also enable generating the errno header. This caused including it to use the system's header which invariably will cause compiler problems.
-
Martin Storsjö authored
Previously, an .exe suffix was only added for MSVC configurations. In practice, an .exe suffix is added implicitly by MinGW toolchains if the output is a suffixless file name. However this can cause lots of subtle build system confusion, when it's not generating the file it expected. Differential Revision: https://reviews.llvm.org/D149029
-
Craig Topper authored
The argument is the AVL itself, not some operation that has an AVL. Thus "is" instead of "has" is a better name.
-
Jorge Gorbe Moya authored
-
Joseph Huber authored
The 'errno' value is most likely not useful on the GPU and it prevents us from providing certain functions on the GPU that depend on it, like `atoi`. This patch makes the necessary changes to support `errno` by simple replacing it with a consumer class. Supporting `errno` on the GPU is possible in some aspects. The first approach would be to use a buffer of shared memory that has enough space for all threads. Another option would be to change code generation to support `thread_local` using `address_space(5)` memory allocated at kernel launch. The former could look like the following, which could be implemented in a later patch: ``` template <typename T> using SharedBuffer = T[gpu::MAX_THREADS] [[clang::address_space(3)]]; template <typename T> struct ErrnoSetter { constexpr ErrnoSetter(SharedBuffer<T> &storage) : storage(storage) {} SharedBuffer<T> &storage; void operator=(const T &val) { storage[gpu::get_thread_id()] = val; } }; static SharedBuffer<int> thread_local_buffer [[clang::loader_uninitialized]]; ErrnoSetter<int> __llvmlibc_internal_errno(thread_local_buffer); ``` Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D149107 -
Markus Mützel authored
When building the Fortran runtime on MinGW, `clock_gettime` is currently used. That function is provided by the `pthread` library on that platform. That means that all programs that link `libFortranRuntime` also require to be linked with `pthread` on that platform. There is already a code path (for MSVC) that doesn't use `clock_gettime` in the implementation of the Fortran library. Use the same code path also on MinGW by undefining `CLOCKID`. Reviewed By: vzakhari Differential Revision: https://reviews.llvm.org/D149051
-
Slava Zakharin authored
I believe this test started failing pre-commit testing after D148038. For example: https://buildkite.com/llvm-project/premerge-checks/builds/148654#0187b72b-7360-4c52-be94-93eefcb269f4 https://buildkite.com/llvm-project/premerge-checks/builds/148642#0187b691-15a7-44c4-ae23-c7e97ec67755 On Windows the .exe suffix is used for clang-offload-packager tool: "c:\\program files\\llvm\\bin\\clang-offload-packager.exe" ... At the same time, I believe I have seen this test sporadically fail before, meaning that the .exe suffix is not added consistently. I am not sure why this might be happening. I decided just to allow the suffix.
-
Alex Bradbury authored
This will allow reusing the same logic for a select combine.
-
Tobias Hieta authored
There was a bunch of references to bugzilla and other old instructions in there. I have updated it to match the current reality. Reviewed By: tstellar Differential Revision: https://reviews.llvm.org/D149131
-
Cullen Rhodes authored
-
Slava Zakharin authored
Fortran runtime standalone build is broken after D140998 because of the missing CMake modules path. This is a fix. Differential Revision: https://reviews.llvm.org/D149090
-
OCHyams authored
A `ValueAsMetadata` may be replaced with nullptr for several reasons including deleting values and value remapping a use-before-def. In the case of a `MetadataAsValue` user, `handleChangedOperand` intercepts and replaces the metadata with an empty tuple (`!{}`). At the moment, an empty metadata operand in a debug intrinsics signals that it can be deleted. Given that we end up with empty metadata operands in circumstances where the Value has been "lost" the current behaviour can lead to incorrect variable locations. Instead, we should treat empty metadata as meaning "there is no location for the variable" (the same as we currently treat undef operands). This patch changes `isKillLocation` to take this into account. Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D140902
-
- Apr 25, 2023
-
-
Aaron Ballman authored
This amends 2e275e24. That commit added a null to pointer cast kind when determining whether the expression can be a valid constant initializer, but failed to update the constant expression evaluator to perform the evaluation. This commit updates the constant expression evaluator to handle that cast kind.
-
OCHyams authored
This helps towards the effort to remove UndefValue from LLVM. Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value Reviewed By: nlopes Differential Revision: https://reviews.llvm.org/D140991
-
Emilio Cota authored
While at it, fix some typos. Differential Revision: https://reviews.llvm.org/D149159
-
Jay Foad authored
After D147334 we never select _SGPR forms of SMEM instructions on subtargets that also support the _SGPR_IMM form, so there is no need to handle them here. Differential Revision: https://reviews.llvm.org/D149139
-
Doru Bercea authored
-
Victor Perez authored
Move mlir-translate exception-related tests from basic.ll to exception.ll. Signed-off-by:
Victor Perez <victor.perez@codeplay.com> Differential Revision: https://reviews.llvm.org/D149043
-
Zhongyunde authored
Use simplifySelectWithICmpEq to handle the implied equalities from the icmp-or, then both of ICMP_NE and ICMP_EQ will be addressed (X | Y) == 0 ? X : 0 --> 0 (commuted 2 ways) (X | Y) != 0 ? 0 : X --> 0 (commuted 2 ways) Fixes https://github.com/llvm/llvm-project/issues/62263 Reviewed By: nikic, RKSimon Differential Revision: https://reviews.llvm.org/D148986
-
Nikita Popov authored
Relative to the previous attempt, this includes a bailout for phi nodes, whose arguments might refer to a previous cycle iteration. We did not hit this before by a fortunate deficiency of the ConstantFoldInstOperands() API, which doesn't handle phi nodes, unlike ConstantFoldInstruction(). ----- Instead of hardcoding a few instruction kinds, use the generic interface now that we have it. The primary effect of this is that intrinsics are now supported. It's worth noting that this is still limited in that it does not support vectors, so we can't remove e.g. existing fshl special cases.
-
Zhongyunde authored
Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D149115
-
Nikita Popov authored
-
NAKAMURA Takumi authored
`!range(a, b)` generates a list `[a,b)`. `a` is optional and `0` by default. - `!range(-1, 4)` generates `[-1, 0, 1, 2, 3]` - `!range(4)` generates `[0, 1, 2, 3]` - `!range(2, 2)` generates `[]<list<int>>` `!range(list)` is equivalent to `!range(0, !size(list))`. Differential Revision: https://reviews.llvm.org/D145871
-
NAKAMURA Takumi authored
-
OCHyams authored
This reverts commit 1e6fe677 (D140900). Buildbot: https://lab.llvm.org/buildbot/#/builders/196/builds/29937
-
Nikita Popov authored
-
Jeremy Morse authored
In rare situations involving AVX intrinsics, it seems LLVM can be coaxed into generating copies to arguments that look like this: $xmm0 = VMOVAPSrr $xmm1, implicit-def $ymm0 CALL64 @something ymm0 This particular form of copy implicitly zeros the upper lanes of ymm0, hence there's an implicit-def for the register in the copy. The X86 implementation of describeLoadedValue doesn't attempt to describe this sort of copy which causes the generic implementation in TargetInstrInfo::describeLoadedValue to fire an assertion saying it expected the target hook to handle it. Play it safe in the generic implementation and return the "no location / value" return value, rather than asserting. Differential Revision: https://reviews.llvm.org/D148626 -
OCHyams authored
This improves the readability of debugging intrinsics. Instead of: call void @llvm.dbg.value(metadata !2, ...) !2 = !{} We will see: call void @llvm.dbg.value(metadata !{}, ...) !2 = !{} Note that we still get a numbered metadata entry for the node even if it's not used elsewhere. This is to avoid adding more context to the print functions. This is already legal IR - LLVM can parse and understand it - so there is no need to update the parser. The next patches in this stack will make such empty metadata operands more common and semantically important. Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D140900 -
Benjamin Kramer authored
This doesn't change the output in any way, but we have a bunch of emitFill for padding. When emitting an array of floats we'd end up with DataFragment float1 FillFragment 0 DataFragment float2 FillFragment 0 ... and so on We never actually emit anything for those fills, neither in asm nor obj emission mode, they just consume RAM for no reason.
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D149145
-
Tom Eccles authored
Inlining as a hlfir.elemental will allow the transpose to be inlined into subsequent operations in some cases. For example, y = TRANSPOSE(x) z = y * 2 Will operate in a single loop without creating a temporary for the TRANSPOSE (unlike the runtime call, which always allocates). This is in a new SimplifyHLFIRIntriniscs pass. The intention is that some day that pass might replace the FIR SimplifyIntrinsics pass. Depends On: D149060 Reviewed By: jeanPerier, vzakhari Differential Revision: https://reviews.llvm.org/D149067
-
Tom Eccles authored
If we know the extent at compile time, it is better to generate an arith.constant than hlfir.get_extent. This gives more information earlier in compilation (before hflir.get_extent is lowered). Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D149060
-