- Jan 12, 2024
-
-
Chris Bieneman authored
This seems to be causing problems that I couldn't reproduce locally.
-
Philip Reames authored
The term folding logic needs to prove that the induction variable does not cycle through the same set of values so that testing for the value of the IV on the exiting iteration is guaranteed to trigger only on that iteration. The prior code checked the no-self-wrap property on the IV, but this is insufficient as a zero step is trivially no-self-wrap per SCEV's definition but does repeat the same series of values. In the current form, this has the effect of basically disabling lsr's term-folding for all non-constant strides. This is still a net improvement as we've disabled term-folding entirely, so being able to enable it for constant strides is still a net improvement. As future work, there's two SCEV weakness worth investigating. First sext (or i32 %a, 1) to i64 does not return true for isKnownNonZero. This is because we check only the unsigned range in that query. We could either do query pushdown, or check the signed range as well. I tried the second locally and it has very broad impact - i.e. we have a bunch of missing optimizations here. Second, zext (or i32 %a, 1) to i64 as the increment to the IV in expensive_expand_short_tc causes the addrec to no longer be provably no-self-wrap. I didn't investigate this so it might be necessary, but the loop structure is such that I find this result surprising.
-
dancing-leaves authored
There seems to be a regression since https://github.com/llvm/llvm-project/commit/6f8b33f6dfd0a0f8d2522b6c832bd6298ae2f3f3. `Max String Summary Length` target property is not read properly and the default value (1024) is being used instead. 16.0.6: ``` (lldb) settings set target.max-string-summary-length 16 (lldb) var (std::string) longStdString = "0123456789101112131415161718192021222324252627282930313233343536" (const char *) longCharPointer = 0x000055555556f310 "0123456789101112131415161718192021222324252627282930313233343536" ``` 17.0.4: ``` (lldb) settings set target.max-string-summary-length 16 (lldb) var (std::string) longStdString = "0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377"... (const char *) longCharPointer = 0x000055555556f310 "*same as line above*"... ``` Comparison fails here: https://github.com/llvm/llvm-project/blob/9cb1673fa5d267148ac81ee31b37f1d2f7c0f2b8/lldb/source/Interpreter/OptionValue.cpp#L256 Due to the type difference: https://github.com/llvm/llvm-project/blob/9cb1673fa5d267148ac81ee31b37f1d2f7c0f2b8/lldb/source/Target/Target.cpp#L4611 https://github.com/llvm/llvm-project/blob/9cb1673fa5d267148ac81ee31b37f1d2f7c0f2b8/lldb/source/Target/TargetProperties.td#L98
-
Ivan Butygin authored
-
erichkeane authored
'use_device' is effectively identical to the 'copy' parsing in that it has required parens and no 'special' name, so this is a pretty trivial impementation. There are a number of other similar situation clauses I'll do in a followup patch.
-
Joseph Huber authored
Summary: Recently a patch added an assertion in the GlobalHandler to indicate when an ELF was not used. This began to fire whenever NVPTX JIT was used, because the JIT pass output a PTX file instead of an ELF. The CUModuleLoad method consumes `.s` internally and compiles it to a cubin, however, this is too late as we perform several checks on the ELF directly for the presence of certain symbols and to read some necessary constants. This results in inconsistent behaviour. To address this, this patch simply calls `ptxas` manually, similar to how `lld` is called for the AMDGPU JIT pass. This is inevitably going to be slower than simply passing it to the CUDA routine due to the overhead involved in file IO and a fork call, but it's necessary for correctness. CUDA provides an API for compiling PTX manually. However, this only started showing up in CUDA 11.1 and is only provided "officially" in a static library. The `libnvidia-ptxjitcompiler.so` next to the CUDA driver has the same symbols and can likely be used as a replacement. This would be the faster solution. However, given that it's not documented it may have some issues.
-
Luke Lau authored
This already gets converted to a strided intrinsic because we currently call haveNoCommonBitsSet when checking or instructions, but an upcoming patch will change this logic and we want to preserve this case. Note that this IR is in the form that comes from instcombine. The splats need to be inline constexprs, otherwise isSplatValue() will fail. (It can't currently handle splats where the shufflevector is an instruction, and the insertelement is a constexpr.
-
erichkeane authored
The copy clause takes a var-list, similar to cache. This patch implements the parsing in terms of how we did cache, and does some infrastructure for future clause parsing. As a part of this, many functions needed to become members of Parser, which I anticipated needing to happen in the future anyway.
-
Eleanor Bonnici authored
The relocations that map to R_ARM_PCA are equivalent to R_PC. They are PC-relative and safe to use in shared libraries, but have a different relocation code as they are evaluated differently. Now that LLVM may generate these relocations in object files, they may occur in shared libraries or position-independent executables.
-
Florian Hahn authored
-
Momchil Velikov authored
The missing diagnostic causes an ICE when a suffix other than `.B` is used in a `pfalse` instruction with a predicate-as-counter operand.
-
Mirko Brkušanin authored
-
Vladislav Dzhidzhoev authored
- [DebugMetadata][DwarfDebug] Support function-local types in lexical block scopes (4/7) - [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions This is a follow-up for https://reviews.llvm.org/D144006, fixing a crash reported in Chromium (https://reviews.llvm.org/D144006#4651955). The first commit is added for convenience, as it has already been accepted. If DISubpogram was not cloned (e.g. we are cloning a function that has other functions inlined into it, and subprograms of the inlined functions are not supposed to be cloned), it doesn't make sense to clone its DILocalVariables as well. Otherwise get duplicated DILocalVariables not tracked in their subprogram's retainedNodes, that crash LTO with Chromium. This is meant to be committed along with https://reviews.llvm.org/D144006.
-
- Jan 11, 2024
-
-
Leandro Lupori authored
-
Teresa Johnson authored
Should fix buildbot failure https://lab.llvm.org/buildbot/#/builders/54/builds/8451 from #75823.
-
HaohaiWen authored
-
Guillaume Chatelet authored
This is less confusing since the implementation only cares about the 4 lower bits.
-
Louis Dionne authored
I recently came across LIBCXXABI_USE_LLVM_UNWINDER and was surprised to notice it was disabled by default. Since we build libunwind by default and ship it in the LLVM toolchain, it would seem to make sense that libc++ and libc++abi rely on libunwind for unwinding instead of using the system-provided unwinding library (if any). Most importantly, using the system unwinder implies that libc++abi is ABI compatible with that system unwinder, which is not necessarily the case. Hence, it makes a lot more sense to instead default to using the known-to-be-compatible LLVM unwinder, and let vendors manually select a different unwinder if desired. As a follow-up change, we should probably apply the same default to compiler-rt. Differential Revision: https://reviews.llvm.org/D150897 Fixes #77662 rdar://120801778
-
Luke Lau authored
-
Rainer Orth authored
18af032c broke the Solaris build: ``` /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:60:24: error: use of undeclared identifier 'LOGIN_NAME_MAX' 60 | const int nameMaxLen{LOGIN_NAME_MAX + 1}; | ^ /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:61:12: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension] 61 | char str[nameMaxLen]; | ^~~~~~~~~~ /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:61:12: note: initializer of 'nameMaxLen' is unknown /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:60:13: note: declared here 60 | const int nameMaxLen{LOGIN_NAME_MAX + 1}; | ^ ``` `flang/unittests/Runtime/CommandTest.cpp` has the same issue. As documented in Solaris 11.4 `limits.h(3HEAD)`, `LOGIN_NAME_MAX` can be undefined. To determine the value, `sysconf(3C)` needs to be used instead. Beside that portable method, Solaris also provides a non-standard `LOGNAME_MAX` which could be used, but I've preferred the standard route instead which would support other targets with the same issue. Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
-
Alexey Bataev authored
[SLP]Do not require external uses for roots and single use for other instructions in computeMinimumValueSizes. (#72679) After changes, that does not require support from InstCombine, we can drop some extra requirements for values-to-be-demoted. No need to check for external uses for roots/other instructions, just check that the no non-vectorized insertelement instruction, which may require widening. Review: https://github.com/llvm/llvm-project/pull/72679
-
Teresa Johnson authored
If tail call optimization was not disabled for the profiled binary, the call contexts will be missing frames for tail calls. Handle this by performing a limited search through tail call edges for the profiled callee when a discontinuity is detected. The search depth is adjustable but defaults to 5. If we are able to identify a short sequence of tail calls, update the graph for those calls. In the case of ThinLTO, synthesize the necessary CallsiteInfos for carrying the cloning information to the backends.
-
Alexey Bataev authored
-
Momchil Velikov authored
Several SVE instruction aliases accept predicate-as-counter register names as a convenience. These ought to be enabled with SVE/SME because the underlying encoding is valid and it's required by Arm ARM.
-
Nikita Popov authored
-
Jie Fu authored
llvm-project/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp:2376:9: error: object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl] tensor::getMixedSizes(rewriter, loc, input_real); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp:2366:10: error: unused variable 'imag_el_ty' [-Werror,-Wunused-variable] auto imag_el_ty = cast<FloatType>( ^ 2 errors generated. -
Florian Hahn authored
Based on https://github.com/llvm/llvm-project/issues/71517.
-
Dominik Adamski authored
Variables `__omp_rtl_assume_teams_oversubscription` and `__omp_rtl_assume_threads_oversubscription `are used by functions: `__kmpc_distribute_static_loop`, `__kmpc_distribute_for_static_loop `and `__kmpc_for_static_loop`.
-
HaohaiWen authored
Those not reachable blocks was not analyzed by LiveDebugValues and may raise out of bound access to VarLocs as case in #77441.
-
HaohaiWen authored
When removing an empty machine basic block, all of its successors should be inherited by its fall through MBB. This keeps CFG as only have one entry which is required by LiveDebugValues. Reland #77441 as LiveDebugValues test.
-
John Brawn authored
When rebasing #75486 I missed adding an extra initializer value to ParsedBranchProtection, so fix that.
-
Leandro Lupori authored
Fixes fveclib.f90 and fveclib-codegen.f90 tests, that were failing on Darwin.
-
Leandro Lupori authored
If DEFAULT_SYSROOT is not specfied when building flang, then the -isysroot flag is needed to link binaries against system libraries on Darwin. It's also needed when linking against a non-default sysroot.
-
Jie Fu authored
llvm-project/llvm/lib/TargetParser/ARMTargetParserCommon.cpp:143:39: error: missing field 'GuardedControlStack' initializer [-Werror,-Wmissing-field-initializers] PBP = {"none", "a_key", false, false}; ^ 1 error generated. -
Jay Foad authored
Modify GCNHazardRecognizer::fixLdsDirectVMEMHazard() so the waitvsrc operand in gfx12 DS_PARAM_LOAD or DS_DIRECT_LOAD instructions is set appropriately depending on whether a hazard is found or not, rather than inserting an S_WAITCNT_DEPCTR instruction if a hazard needs to be mitigated. Co-authored-by:Stephen Thomas <Stephen.Thomas@amd.com>
-
John Brawn authored
-mbranch-protection=gcs (enabled by -mbranch-protection=standard) causes generated objects to be marked with the gcs feature. This is done via the guarded-control-stack module flag, in a similar way to branch-target-enforcement and sign-return-address. Enabling GCS causes the GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit to be set on generated objects. No code generation changes are required, as GCS just requires that functions are called using BL and returned from using RET (or other similar variant instructions), which is already the case.
-
r4nt authored
1. There are multiple calls to addFakeParenthesis; move the guard to not assign fake parenthesis into the function to make sure we cover all calls. 2. MustBreakBefore can be set on a token in two cases: either during unwrapped line parsing, or later, during token annotation. We must keep the latter, but reset the former. 3. Added a test to document that the intended behavior of preferring not to break between a return type and a function identifier. For example, with MOCK_METHOD(r, n, a)=r n a, the code MOCK_METHOD(void, f, (int a, int b)) should prefer the same breaks as the expanded void f(int a, int b).
-
goussepi authored
Calling one of pthread join/detach interceptor on an already joined/detached thread causes asserts such as: AddressSanitizer: CHECK failed: sanitizer_thread_arg_retval.cpp:56 "((t)) != (0)" (0x0, 0x0) (tid=1236094) #0 0x555555634f8b in __asan::CheckUnwind() compiler-rt/lib/asan/asan_rtl.cpp:69:3 #1 0x55555564e06e in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:86:24 #2 0x5555556491df in __sanitizer::ThreadArgRetval::BeforeJoin(unsigned long) const compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.cpp:56:3 #3 0x5555556198ed in Join<___interceptor_pthread_tryjoin_np(void*, void**)::<lambda()> > compiler-rt/lib/asan/../sanitizer_common/sanitizer_thread_arg_retval.h:74:26 #4 0x5555556198ed in pthread_tryjoin_np compiler-rt/lib/asan/asan_interceptors.cpp:311:29 The assert are replaced by error codes.
-
Dmitriy Smirnov authored
This PR adds lowering for TOSA Fft2d operator down to Linalg.
-
Yi Wu authored
reference to gfortran fdate https://gcc.gnu.org/onlinedocs/gfortran/FDATE.html usage: ```fortran CHARACTER(32) :: time CALL fdate(time) WRITE(*,*) time ``` fdate is used in the ECP proxy application https://proxyapps.exascaleproject.org/app/minismac2d/ https://github.com/Mantevo/miniSMAC/blob/f90446714226eeef650b78bce06ca4967792e74d/ref/smac2d.f#L1570 `fdate` now produce the same result on flang, compare to gfortran, where If the length is too short to fit completely, blank return. ```fortran character(20) :: string call fdate(string) write(*, *) string, "X" ``` ```bash $ ../build-release/bin/flang-new test.f90 $ ./a.out X ``` If length if larger than it requires(24), fill the rest of buffer space. ```fortran character(30) :: string call fdate(string) write(*, *) string, "X" ``` ```bash $ ../build-release/bin/flang-new test.f90 $ ./a.out Wed Nov 15 16:59:13 2023 X ``` The length value is hardcoded, because: ```c++ // Day Mon dd hh:mm:ss yyyy\n\0 is 26 characters, e.g. // Tue May 26 21:51:03 2015\n\0 ``` --------- Co-authored-by:
Yi Wu <yiwu02@wdev-yiwu02.arm.com>
-