- Aug 28, 2023
-
-
Donát Nagy authored
...because it provides no useful functionality compared to its base class `BugType`. A long time ago there were substantial differences between `BugType` and `BuiltinBug`, but they were eliminated by commit 1bd58233 in 2009 (!). Since then the only functionality provided by `BuiltinBug` was that it specified `categories::LogicError` as the bug category and it stored an extra data member `desc`. This commit sets `categories::LogicError` as the default value of the third argument (bug category) in the constructors of BugType and replaces use of the `desc` field with simpler logic. Note that `BugType` has a data member `Description` and a non-virtual method `BugType::getDescription()` which queries it; these are distinct from the member `desc` of `BuiltinBug` and the identically named method `BuiltinBug::getDescription()` which queries it. This confusing name collision was a major motivation for the elimination of `BuiltinBug`. As this commit touches many files, I avoided functional changes and left behind FIXME notes to mark minor issues that should be fixed later. Differential Revision: https://reviews.llvm.org/D158855
-
Nikita Popov authored
Make sure we don't crash if we encounter a malloc with memory(none). Related to https://github.com/llvm/llvm-project/issues/64827.
-
Phoebe Wang authored
This reverts commit 4ae7ed6e. Sorry, missing the test update.
-
Phoebe Wang authored
Fixes #64460 Reviewed By: RKSimon, skan Differential Revision: https://reviews.llvm.org/D158950
-
Phoebe Wang authored
This reverts commit 915139fc. The constant value is 16 rather than 8. Revert it and then reland.
-
David CARLIER authored
Api available since Windows Server 2016/Windows 10 1607 Reviewers: vitalybuka Reviewed-By: vitalybuka Differential Revison: https://reviews.llvm.org/D156317
-
David CARLIER authored
Reviewers: vitalybuka Reviewed-By: vitalybuka Differential Revision: https://reviews.llvm.org/D156578
-
David CARLIER authored
the ParseUnixMemoryProfile makes sense only on platforms which truly support procfs Reviewers: vitalybuka Reviewed-By: vitalybuka Differential Revision: https://reviews.llvm.org/D156628
-
Aaron Ballman authored
The code previously required two levels of conversion, one from SmallString to StringRef and one from StringRef to Regex. This made the implicit conversion to StringRef be explicit instead.
-
Aaron Ballman authored
-
Sergio Afonso authored
This patch fixes a compiler crash that would happen during translation to LLVM IR if the optional `map` argument of the `omp.target` operation was not present. A unit test is added to ensure this has been fixed. Differential Revision: https://reviews.llvm.org/D158722
-
Balazs Benics authored
The checker assumed that it could safely cast an SVal to Nonloc. This surfaced because, with std::ranges, we can unintentionally match on other APIs as well, thus increasing the likelihood of violating checker assumptions about the context it's invoked. https://godbolt.org/z/13vEb3K76 See the discourse post on CallDescriptions and std::ranges here. https://discourse.llvm.org/t/calldescriptions-should-not-skip-the-ranges-part-in-std-names-when-matching/73076 Fixes https://github.com/llvm/llvm-project/issues/65009 Differential Revision: https://reviews.llvm.org/D158968
-
Jim Lin authored
-
Luke Lau authored
We can work out the known bits for a given lane by concatenating the known bits of each scalar operand. In the description of ISD::SPLAT_VECTOR_PARTS in ISDOpcodes.h it says that the total size of the scalar operands must cover the output element size, but I've added a stricter assertion here that the total width of the scalar operands must be exactly equal to the element size. It doesn't seem to trigger, and I'm not sure if there any targets that use SPLAT_VECTOR_PARTS for anything other than v4i32 -> v2i64 splats. We also need to include it in isTargetCanonicalConstantNode, otherwise returning the known bits introduces an infinite combine loop. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D158852
-
Luke Lau authored
This improves some cases where a splat_vector uses a build_pair that can be simplified, e.g: (rotl x:i64, splat_vector (build_pair x1:i32, x2:i32)) rotl only demands the bottom 6 bits, so this patch allows it to simplify it to: (rotl x:i64, splat_vector (build_pair x1:i32, undef:i32)) Which in turn improves some cases where a splat_vector_parts is lowered on RV32. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D158839
-
Podchishchaeva, Mariya authored
Fixes https://github.com/llvm/llvm-project/issues/48974 Reviewed By: shafik Differential Revision: https://reviews.llvm.org/D158827
-
Luke Drummond authored
The sync pipeline should always contain the candidate ID. If it doesn't something's gone awry. assert on that. Reviewed by: jrbyrnes Differential Revision: https://reviews.llvm.org/D158845
-
Chuanqi Xu authored
The original patch is incorrect since it marks too many calls to be noinline. It shows that it is bad to do analysis in the frontend again. This patch tries to mark the await_suspend function as noinlne only. --- Close https://github.com/llvm/llvm-project/issues/56301 Close https://github.com/llvm/llvm-project/issues/64151 Close https://github.com/llvm/llvm-project/issues/65018 See the summary and the discussion of https://reviews.llvm.org/D157070 to get the full context. As @rjmccall pointed out, the key point of the root cause is that currently we didn't implement the semantics for '@llvm.coro.save' well ("after the await-ready returns false, the coroutine is considered to be suspended ") well. Since the semantics implies that we (the compiler) shouldn't write the spills into the coroutine frame in the await_suspend. But now it is possible due to some combinations of the optimizations so the semantics are broken. And the inlining is the root optimization of such optimizations. So in this patch, we tried to add the `noinline` attribute to the await_suspend function. This looks slightly problematic since the users are able to call the await_suspend function standalone. This is limited by the implementation. On the one hand, we don't want the workaround solution (See the proposed solution later) to be too complex. On the other hand, it is rare to call await_suspend standalone. Also it is not semantically incorrect to do so since the inlining is not part of the C++ standard. Also as an optimization, we don't add the `noinline` attribute to the await_suspend function if the awaiter is an empty class. This should be correct since the programmers can't access the local variables in await_suspend if the awaiter is empty. I think this is necessary for the performance since it is pretty common. The long term solution is: call @llvm.coro.await_suspend(ptr %awaiter, ptr %handle, ptr @awaitSuspendFn) Then it is much easier to perform the safety analysis in the middle end. If it is safe to inline the call to awaitSuspend, we can replace it in the CoroEarly pass. Otherwise we could replace it in the CoroSplit pass. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D157833
-
Nikita Popov authored
D158607 switched this code to use CMAKE_INSTALL_LIBDIR, but kept the explicit LLVM_DIR_SUFFIX. However, CMAKE_INSTALL_LIBDIR already contains the suffix, so we end up installing into a path like lib6464.
-
Adrian Kuegel authored
Prefer to use .empty() instead of checking for size() > 0.
-
Kadir Cetinkaya authored
This reverts commit 0e63f1aa. clang-format started to crash with contents like: a.h: ``` ``` $ clang-format a.h ``` PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: ../llvm/build/bin/clang-format a.h #0 0x0000560b689fe177 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/kadircet/repos/llvm/llvm/lib/Support/Unix/Signals.inc:723:13 #1 0x0000560b689fbfbe llvm::sys::RunSignalHandlers() /usr/local/google/home/kadircet/repos/llvm/llvm/lib/Support/Signals.cpp:106:18 #2 0x0000560b689feaca SignalHandler(int) /usr/local/google/home/kadircet/repos/llvm/llvm/lib/Support/Unix/Signals.inc:413:1 #3 0x00007f030405a540 (/lib/x86_64-linux-gnu/libc.so.6+0x3c540) #4 0x0000560b68a9a980 is /usr/local/google/home/kadircet/repos/llvm/clang/include/clang/Lex/Token.h:98:44 #5 0x0000560b68a9a980 is /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/FormatToken.h:562:51 #6 0x0000560b68a9a980 startsSequenceInternal<clang::tok::TokenKind, clang::tok::TokenKind> /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/FormatToken.h:831:9 #7 0x0000560b68a9a980 startsSequence<clang::tok::TokenKind, clang::tok::TokenKind> /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/FormatToken.h:600:12 #8 0x0000560b68a9a980 getFunctionName /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/TokenAnnotator.cpp:3131:17 #9 0x0000560b68a9a980 clang::format::TokenAnnotator::annotate(clang::format::AnnotatedLine&) /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/TokenAnnotator.cpp:3191:17 Segmentation fault ```
-
Job Noorman authored
BOLT uses `MCAsmLayout` to calculate the output values of functions and basic blocks. This means output values are calculated based on a pre-linking state and any changes to symbol values during linking will cause incorrect values to be used. This issue can be triggered by enabling linker relaxation on RISC-V. Since linker relaxation can remove instructions, symbol values may change. This causes, among other things, the symbol table created by BOLT in the output executable to be incorrect. This patch solves this issue by using `BOLTLinker` to get symbol values instead of `MCAsmLayout`. This way, output values are calculated based on a post-linking state. To make sure the linker can update all necessary symbols, this patch also makes sure all these symbols are not marked as temporary so that they end-up in the object file's symbol table. Note that this patch only deals with symbols of binary functions (`BinaryFunction::updateOutputValues`). The technique d...
-
Ingo Müller authored
Extends the existing mix-in for VectorizeOp with support for the missing unit attributes. Also fixes the unintuitive implementation where `structured.VectorizeOp(target=target, vectorize_padding=False)` still resulted in the creation of the UnitAttr `vectorize_padding`. Reviewed By: ingomueller-net Differential Revision: https://reviews.llvm.org/D158726
-
Martin Erhart authored
[mlir][bufferization] Run the simple dealloc canonicalization patterns as part of BufferDeallocationSimplification Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D158744
-
Martin Erhart authored
Deallocation operations where the allocated value is the 'memref' and 'retained' list are currently not supported. This is because when values are in the retained list, they typically have a use-site at a later point and another deallocation op exists at that later point to free the memref then. There alrady exists a canonicalization pattern in the buffer deallocation simplification pass that removes the allocated value from the earlier dealloc because it will never be actually deallocated in that case and thus does not have to be considered in this new pattern. Differential Revision: https://reviews.llvm.org/D158740
-
Fangrui Song authored
`strtol("0b1", 0, 0)` can be (pre-C23) 0 or (C23) 1. `sscanf("0b10", "%i", &x)` is similar. glibc 2.38 introduced `__isoc23_strtol` and `__isoc23_scanf` family functions for binary compatibility. When `_ISOC2X_SOURCE` is defined (implied by `_GNU_SOURCE`) or `__STDC_VERSION__ > 201710L`, `__GLIBC_USE_ISOC2X` is defined to 1 and these `__isoc23_*` symbols are used. Add `__isoc23_` versions for the following interceptors: * sanitizer_common_interceptors.inc implements strtoimax/strtoumax. Remove incorrect FIXME about https://github.com/google/sanitizers/issues/321 * asan_interceptors.cpp implements just strtol and strtoll. The default `replace_str` mode checks `nptr` is readable and `endptr` is writable. atoi reuses the existing strtol interceptor. * msan_interceptors.cpp implements strtol family functions and their `_l` versions. Tested by lib/msan/tests/msan_test.cpp * sanitizer_common_interceptors.inc implements scanf family functions. The strtol family functions are spreaded, which is not great, but the patch (intended for release/17.x) does not attempt to address the issue. Add symbols to lib/sanitizer_common/symbolizer/scripts/global_symbols.txt to support both glibc pre-2.38 and 2.38. When build bots migrate to glibc 2.38+, we will lose test coverage for non-isoc23 versions since the existing C++ unittests imply `_GNU_SOURCE`. Add test/sanitizer_common/TestCases/{strtol.c,scanf.c}. They catch msan false positive in the absence of the interceptors. Fix https://github.com/llvm/llvm-project/issues/64388 Fix https://github.com/llvm/llvm-project/issues/64946 Link: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html ("The GNU C Library version 2.38 is now available") Reviewed By: #sanitizers, vitalybuka, mgorny Differential Revision: https://reviews.llvm.org/D158943 -
Nikita Popov authored
This reverts commit 183f49c3. The lang/cpp/trivial_abi/TestTrivialABI.py lldb test fails on buildbots.
-
Joachim Jenke authored
At the moment Archer segfaults due to a null-pointer access, if an application uses taskwait with depend clause as used in the two new tests. This patch cleans up the task_schedule function, moves semantic blocks into functions and replaces the if blocks by a single switch statement. The switch statement will warn, when new enum values are added in OMPT and makes clear what code is executed for the different cases. With free-agent tasks coming up in OpenMP 6.0, we should expect more null-pointer task_data, so additional null-pointer checks were added. We also cannot rely on having an implicit task on the stack, so the BarrierIndex is stored during task creation. Differential Revision: https://reviews.llvm.org/D158072
-
Kadir Cetinkaya authored
We were treating enum constants more like regular decls, which results in ignoring type aliases/exports. This patch brings the handling to be closer to member-like decls, with one caveat. When we encounter reference to an enum constant we still report an explicit reference to the particular enum constant, as otherwise we might not see any references to the enum itself. Also drops implicit references from qualified names to containers, as we already have explicit references from the qualifier to relevant container. Differential Revision: https://reviews.llvm.org/D158515
-
Rainer Orth authored
Following the lead of the Linux code, this patch passes the `ld -z` options as two separate args on Solaris, improving legibility. For lack of a variadic `std::push_back`, `getAsNeededOption` had to be changed to `addAsNeededOption`, matching other `add*Options` functions, changing callers accordingly. The additional args are also used in a WIP revision of the Solaris GNU ld patch D85309 <https://reviews.llvm.org/D85309>, which will allow runtime selection of the linker to use. Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`. Differential Revision: https://reviews.llvm.org/D158955
-
Joachim Jenke authored
Since td_allow_completion_event is a member of the taskdata struct, not all firstprivate/shared variables are stored at the end of the task memory allocation. Simply report the whole allocation instead. Furthermore, the function should always return 0 since in no case there is another block to report. Differential Review: https://reviews.llvm.org/D158080
-
Nikita Popov authored
Add a check that the DILocalVariable fragment size in dbg.declare does not exceed the size of the alloca. This would have caught the invalid debuginfo regenerated by rustc in https://github.com/llvm/llvm-project/issues/64149. Differential Revision: https://reviews.llvm.org/D158743
-
Enna1 authored
The return type of `internal_strlen()` is 'uptr', but in `printf_common()` we store the result of `internal_strlen()` into an 'int' type variable. When the result value of `internal_strlen()` is larger than the largest possible value of 'int' type, the implicit conversion from 'uptr' to 'int' will change the result value to a negative value. Without this change, asan reports a false positive negative-size-param in the added testcase. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D157266
-
Fangrui Song authored
This test is simplified from lld/test/MachO/compact-unwind-lsda-folding.s, which tests .uleb128 A-B where A and B are in different fragments (not tested in llvm/). `.uleb128 Lfunc_end0-Ltmp1` requires evaluateKnownAbsolute in MCAssembler::relaxLEB to be foldable.
-
Kai Luo authored
-
Adrian Kuegel authored
-
khei4 authored
-
Craig Topper authored
Store the string with the '+' in FeatureInfos. Drop the '+' at runtime for the users that don't want it. Reviewed By: RKSimon, FreddyYe Differential Revision: https://reviews.llvm.org/D158814
-
Chuanqi Xu authored
This reverts commit 9d9c25f8. This reverts commit 19ab2664. This reverts commit c4672454. As the issue https://github.com/llvm/llvm-project/issues/65018 shows, the previous fix introduce a regression actually. So this commit reverts the fix by our policies.
-
Fangrui Song authored
When the optional assignment-allocation character 'm' (Extension to the ISO C standard) is present, we currently use internal_strlen(buf)+1 for all of cCsS[ (D85350). Fix cCS to use the correct size. Fix https://github.com/llvm/llvm-project/issues/61768 Reviewed By: #sanitizers, vitalybuka Differential Revision: https://reviews.llvm.org/D158485
-