- Mar 03, 2020
-
-
Florian Hahn authored
This patch adds a getPlan accessor to VPBlockBase, which finds the entry block of the plan containing the block and returns the plan set for this block. VPBlockBase contains a VPlan pointer, but it should only be set for the entry block of a plan. This allows moving blocks without updating the pointer for each moved block and in the future we might introduce a parent relationship between plans and blocks, similar to the one in LLVM IR. Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr Reviewed By: gilr Differential Revision: https://reviews.llvm.org/D74445
-
serge-sans-paille authored
llvm/Support/Base64, fix its implementation and provide a decent test suite. Previous implementation code was using + operator instead of | to combine results, which is a problem when shifting signed values. (0xFF << 16) is implicitly converted to a (signed) int, and thus results in 0xffff0000, h is negative. Combining negative numbers with a + in that context is not what we want to do. This is a recommit of 5a1958f2 with UB removved. This fixes https://github.com/llvm/llvm-project/issues/149. Differential Revision: https://reviews.llvm.org/D75057
-
Hans Wennborg authored
and follow-ups: a2ca1c2d "build: disable zlib by default on Windows" 2181bf40 "[CMake] Link against ZLIB::ZLIB" 1079c68a "Attempt to fix ZLIB CMake logic on Windows" This changed the output of llvm-config --system-libs, and more importantly it broke stand-alone builds. Instead of piling on more fix attempts, let's revert this to reduce the risk of more breakages.
-
- Mar 02, 2020
-
-
Hiroshi Yamauchi authored
Summary: This follows up D67377 that added the isHot side. Reviewers: davidxl Subscribers: eraman, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D75283
-
Mitch Phillips authored
This reverts commit 5a1958f2. This change broke the UBSan build bots. See https://reviews.llvm.org/D75057 for more information.
-
Mitch Phillips authored
This reverts commit b52355f8. The change this patch depends on (5a1958f2) broke the UBSan buildbots. See https://reviews.llvm.org/D75057 for more information.
-
David Green authored
getReductionVars, getInductionVars and getFirstOrderRecurrences were all being returned from LoopVectorizationLegality as pointers to lists. This just changes them to be references, cleaning up the interface slightly. Differential Revision: https://reviews.llvm.org/D75448
-
Luke Geeson authored
This patch upstreams support for the ARM Armv8.1m cpu Cortex-M55. In detail adding support for: - mcpu option in clang - Arm Target Features in clang - llvm Arm TargetParser definitions details of the CPU can be found here: https://developer.arm.com/ip-products/processors/cortex-m/cortex-m55 Reviewers: chill Reviewed By: chill Subscribers: dmgreen, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D74966
-
Awanish Pandey authored
in C++ templates." This was reverted in 802b22b5 due to missing .bc file and a chromium bot failure. https://bugs.chromium.org/p/chromium/issues/detail?id=1057559#c1 This revision address both of them. Summary: This patch adds support for debuginfo generation for defaulted parameters in clang and also extends corresponding DebugMetadata/IR to support this feature. Reviewers: probinson, aprantl, dblaikie Reviewed By: aprantl, dblaikie Differential Revision: https://reviews.llvm.org/D73462
-
Pavel Labath authored
Summary: In this patch I've done a slightly bigger rewrite to also remove the hardcoded header lengths. Reviewers: jhenderson, dblaikie, ikudrin Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D75119
-
Pavel Labath authored
Summary: The error messages change somewhat, but I believe the overall informational value remains unchanged. Reviewers: jhenderson, dblaikie, ikudrin Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D75116
-
serge-sans-paille authored
Move Base64 implementation from clangd/SemanticHighlighting to llvm/Support/Base64, fix its implementation and provide a decent test suite. Previous implementation code was using + operator instead of | to combine some results, which is a problem when shifting signed values. (0xFF << 16) is implicitly converted to a (signed) int, and thus results in 0xffff0000, which is negative. Combining negative numbers with a + in that context is not what we want to do. This fixes https://github.com/llvm/llvm-project/issues/149. Differential Revision: https://reviews.llvm.org/D75057
-
Hans Wennborg authored
Revert "[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaulted parameters" The Bitcode/DITemplateParameter-5.0.ll test is failing: FAIL: LLVM :: Bitcode/DITemplateParameter-5.0.ll (5894 of 36324) ******************** TEST 'LLVM :: Bitcode/DITemplateParameter-5.0.ll' FAILED ******************** Script: -- : 'RUN: at line 1'; /usr/local/google/home/thakis/src/llvm-project/out/gn/bin/llvm-dis -o - /usr/local/google/home/thakis/src/llvm-project/llvm/test/Bitcode/DITemplateParameter-5.0.ll.bc | /usr/local/google/home/thakis/src/llvm-project/out/gn/bin/FileCheck /usr/local/google/home/thakis/src/llvm-project/llvm/test/Bitcode/DITemplateParameter-5.0.ll -- Exit Code: 2 Command Output (stderr): -- It looks like the Bitcode/DITemplateParameter-5.0.ll.bc file was never checked in. This reverts commit c2b437d5.
-
Awanish Pandey authored
in C++ templates. Summary: This patch adds support for debuginfo generation for defaulted parameters in clang and also extends corresponding DebugMetadata/IR to support this feature. Reviewers: probinson, aprantl, dblaikie Reviewed By: aprantl, dblaikie Differential Revision: https://reviews.llvm.org/D73462
-
- Feb 29, 2020
-
-
Reid Kleckner authored
Lots of headers pass around MemoryBuffer objects, but very few open them. Let those that do include FileSystem.h. Saves ~250 includes of Chrono.h & FileSystem.h: $ diff -u thedeps-before.txt thedeps-after.txt | grep '^[-+] ' | sort | uniq -c | sort -nr 254 - ../llvm/include/llvm/Support/FileSystem.h 253 - ../llvm/include/llvm/Support/Chrono.h 237 - ../llvm/include/llvm/Support/NativeFormatting.h 237 - ../llvm/include/llvm/Support/FormatProviders.h 192 - ../llvm/include/llvm/ADT/StringSwitch.h 190 - ../llvm/include/llvm/Support/FormatVariadicDetails.h ... This requires duplicating the file_t typedef, which is unfortunate. I sunk the choice of mapping mode down into the cpp file using variable template specializations instead of class members in headers.
-
Vedant Kumar authored
Try again with an up-to-date version of D69471 (99317124 was a stale revision). --- Revise the coverage mapping format to reduce binary size by: 1. Naming function records and marking them `linkonce_odr`, and 2. Compressing filenames. This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB) and speeds up end-to-end single-threaded report generation by 10%. For reference the compressed name data in llc is 81MB (__llvm_prf_names). Rationale for changes to the format: - With the current format, most coverage function records are discarded. E.g., more than 97% of the records in llc are *duplicate* placeholders for functions visible-but-not-used in TUs. Placeholders *are* used to show under-covered functions, but duplicate placeholders waste space. - We reached general consensus about giving (1) a try at the 2017 code coverage BoF [1]. The thinking was that using `linkonce_odr` to merge duplicates is simpler than alternatives like teaching build systems about a coverage-aware database/module/etc on the side. - Revising the format is expensive due to the backwards compatibility requirement, so we might as well compress filenames while we're at it. This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB). See CoverageMappingFormat.rst for the details on what exactly has changed. Fixes PR34533 [2], hopefully. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html [2] https://bugs.llvm.org/show_bug.cgi?id=34533 Differential Revision: https://reviews.llvm.org/D69471
-
Vedant Kumar authored
This reverts commit 99317124. This is still busted on Windows: http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/40873 The llvm-cov tests report 'error: Could not load coverage information'.
-
Vedant Kumar authored
Revise the coverage mapping format to reduce binary size by: 1. Naming function records and marking them `linkonce_odr`, and 2. Compressing filenames. This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB) and speeds up end-to-end single-threaded report generation by 10%. For reference the compressed name data in llc is 81MB (__llvm_prf_names). Rationale for changes to the format: - With the current format, most coverage function records are discarded. E.g., more than 97% of the records in llc are *duplicate* placeholders for functions visible-but-not-used in TUs. Placeholders *are* used to show under-covered functions, but duplicate placeholders waste space. - We reached general consensus about giving (1) a try at the 2017 code coverage BoF [1]. The thinking was that using `linkonce_odr` to merge duplicates is simpler than alternatives like teaching build systems about a coverage-aware database/module/etc on the side. - Revising the format is expensive due to the backwards compatibility requirement, so we might as well compress filenames while we're at it. This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB). See CoverageMappingFormat.rst for the details on what exactly has changed. Fixes PR34533 [2], hopefully. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html [2] https://bugs.llvm.org/show_bug.cgi?id=34533 Differential Revision: https://reviews.llvm.org/D69471
-
- Feb 28, 2020
-
-
Reid Kleckner authored
DenseMap requires two sentinel values for keys: empty and tombstone values. To avoid undefined behavior, LLVM aligns the two sentinel pointers to alignof(T). This requires T to be complete, which is needlessly restrictive. Instead, assume that DenseMap pointer keys have a maximum alignment of 4096, and use the same sentinel values for all pointer keys. The new sentinels are: empty: static_cast<uintptr_t>(-1) << 12 tombstone: static_cast<uintptr_t>(-2) << 12 These correspond to the addresses of -4096 and -8192. Hopefully, such a key is never inserted into a DenseMap. I encountered this while looking at making clang's SourceManager not require FileManager.h, but it has several maps keyed on classes defined in FileManager.h. FileManager depends on various LLVM FS headers, which cumulatively take ~200ms to parse, and are generally not needed. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D75301
-
Hiroshi Yamauchi authored
Summary: This fixes the crash that led to the revert of D69591. Reviewers: davidxl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D75307
-
Jeremy Morse authored
Way back in D24994, the combination of LexicalScopes::dominates and LiveDebugValues was identified as having worst-case quadratic complexity, but it wasn't triggered by any code path at the time. I've since run into a scenario where this occurs, in a very large basic block where large numbers of inlined DBG_VALUEs are present. The quadratic-ness comes from LiveDebugValues::join calling "dominates" on every variable location, and LexicalScopes::dominates potentially touching every instruction in a block to test for the presence of a scope. We have, however, already computed the presence of scopes in blocks, in the "InstrRanges" of each scope. This patch switches the dominates method to examine whether a block is present in a scope's InsnRanges, avoiding walking through the whole block. At the same time, fix getMachineBasicBlocks to account for the fact that InsnRanges can cover multiple blocks, and add some unit tests, as Lexical Scopes didn't have any. Differential revision: https://reviews.llvm.org/D73725
-
Pavel Labath authored
Summary: Include the offset at which this happened. Reviewers: dblaikie, jhenderson Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D75265
-
Reid Kleckner authored
MathExtras.h was just wrapping SwapByteOrder.h functionality, so have the callers use it directly. Use the MathExtras.h name (ByteSwap_NN) as the standard naming, since it appears to be the most popular.
-
- Feb 27, 2020
-
-
Vedant Kumar authored
Hopefully fixes compile errors on some bots, like: http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/13383/steps/ninja%20check%201/logs/stdio /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/llvm/llvm/unittests/ADT/CoalescingBitVectorTest.cpp:452:3: required from here /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/llvm/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h:377:56: error: ‘const class llvm::CoalescingBitVector<long unsigned int>::const_iterator’ has no member named ‘begin’ for (typename C::const_iterator it = container.begin(); ^ /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/llvm/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h:378:11: error: ‘const class llvm::CoalescingBitVector<long unsigned int>::const_iterator’ has no member named ‘end’ it != container.end(); ++it, ++count) { ^
-
Vedant Kumar authored
On some bots, using gtest asserts to compare iterators does not compile, and I'm not sure why (this certainly compiles with clang). Disable the checks for now :/. ``` C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\utils\unittest\googletest\include\gtest/gtest-printers.h(377): error C2039: 'begin': is not a member of 'llvm::CoalescingBitVector<unsigned int,16>::const_iterator' C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\include\llvm/ADT/CoalescingBitVector.h(243): note: see declaration of 'llvm::CoalescingBitVector<unsigned int,16>::const_iterator' C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\utils\unittest\googletest\include\gtest/gtest-printers.h(478): note: see reference to function template instantiation 'void testing::internal::DefaultPrintTo<T>(testing::internal::IsContainer,testing::internal::false_type,const C &,std::ostream *)' being compiled with [ T=T1, C=T1 ] ``` http://lab.llvm.org:8011/builders/llvm-clang-x86_64-win-fast/builds/12006/steps/test-check-llvm-unit/logs/stdio http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/34521/steps/ninja%20check%201/logs/stdio
-
Vedant Kumar authored
Add CoalescingBitVector to ADT. This is part 1 of a 3-part series to address a compile-time explosion issue in LiveDebugValues. --- CoalescingBitVector is a bitvector that, under the hood, relies on an IntervalMap to coalesce elements into intervals. CoalescingBitVector efficiently represents sets which predominantly contain contiguous ranges (e.g. the VarLocSets in LiveDebugValues, which are very long sequences that look like {1, 2, 3, ...}). OTOH, CoalescingBitVector isn't good at representing sets with lots of gaps between elements. The first N coalesced intervals of set bits are stored in-place (in the initial heap allocation). Compared to SparseBitVector, CoalescingBitVector offers more predictable performance for non-sequential find() operations. This provides a crucial speedup in LiveDebugValues. Differential Revision: https://reviews.llvm.org/D74984
-
Alexey Lapshin authored
Summary: Error reporting in DebugInfoDWARF library currently done in three ways : 1. Direct calls to WithColor::error()/WithColor::warning() 2. ErrorPolicy defaultErrorHandler(Error E); 3. void dumpWarning(Error Warning); additionally, other locations could have more variations: lld/ELF/SyntheticSection.cpp if (Error e = cu->tryExtractDIEsIfNeeded(false)) { error(toString(sec) + ": " + toString(std::move(e))); DebugInfo/DWARF/DWARFUnit.cpp if (Error e = tryExtractDIEsIfNeeded(CUDieOnly)) WithColor::error() << toString(std::move(e)); Thus error reporting could look inconsistent. To have a consistent error messages it is necessary to have a possibility to redefine error reporting functions. This patch creates two handlers and allows to redefine them. It also patches all places inside DebugInfoDWARF to use these handlers. The intention is always to use following handlers for error reporting purposes inside DebugInfoDWARF: DebugInfo/DWARF/DWARFContext.h std::function<void(Error E)> RecoverableErrorHandler = WithColor::defaultErrorHandler; std::function<void(Error E)> WarningHandler = WithColor::defaultWarningHandler; This is last patch from series of patches: D74481, D74635, D75118. Reviewers: jhenderson, dblaikie, probinson, aprantl, JDevlieghere Reviewed By: jhenderson Subscribers: grimar, hiraditya, llvm-commits Tags: #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D74308
-
- Feb 26, 2020
-
-
Alexey Lapshin authored
Summary: Current LLVM code base does not use error handler with ErrorPolicy. This patch removes ErrorPolicy from DWARFContext. This patch is extracted from the D74308. Reviewers: jhenderson, dblaikie, grimar, aprantl, JDevlieghere Reviewed By: grimar Subscribers: hiraditya, llvm-commits Tags: #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D75118
-
Pavel Labath authored
Summary: This patch introduces a function to house the code needed to do the DWARF64 detection dance. The function decodes the initial length field and returns it as a pair containing the actual length, and the DWARF encoding. This patch does _not_ attempt to handle the problem of detecting lengths which extend past the size of the section, or cases when reads of a single contribution accidentally escape beyond its specified length, but I think it's useful in its own right. Reviewers: dblaikie, jhenderson, ikudrin Subscribers: hiraditya, probinson, aprantl, JDevlieghere, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74560
-
Lang Hames authored
It was being used inconsistently. Uses have been replaced with direct checks on the symbol state.
-
Quentin Colombet authored
Unlike what I claimed in my previous commit. The caching is actually not NFC on PHIs. When we put a big enough max depth, we end up simulating loops. The cache is effectively cutting the simulation short and we get less information as a result. E.g., ``` v0 = G_CONSTANT i8 0xC0 jump v1 = G_PHI i8 v0, v2 v2 = G_LSHR i8 v1, 1 ``` Let say we want the known bits of v1. - With cache: Set v1 cache to we know nothing v1 is v0 & v2 v0 gives us 0xC0 v2 gives us known bits of v1 >> 1 v1 is in the cache => v1 is 0, thus v2 is 0x80 Finally v1 is v0 & v2 => 0x80 - Without cache and enough depth to do two iteration of the loop: v1 is v0 & v2 v0 gives us 0xC0 v2 gives us known bits of v1 >> 1 v1 is v0 & v2 v0 is 0xC0 v2 is v1 >> 1 Reach the max depth for v1... unwinding v1 is know nothing v2 is 0x80 v0 is 0xC0 v1 is 0x80 v2 is 0xC0 v0 is 0xC0 v1 is 0xC0 Thus now v1 is 0xC0 instead of 0x80. I've added a unittest demonstrating that. NFC
-
- Feb 25, 2020
-
-
Cyndy Ishida authored
* Conforms to clang tidy
-
Roman Lebedev authored
Summary: Future patches will make use of TTI to perform cost-model-driven `SCEVExpander::isHighCostExpansionHelper()` This is a fully NFC patch to make things reviewable. Reviewers: reames, mkazantsev, wmi, sanjoy Reviewed By: mkazantsev Subscribers: hiraditya, zzheng, javed.absar, dmgreen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73704
-
- Feb 24, 2020
-
-
Greg Clayton authored
Summary: These modificaitons will be used in D74883. Fixed length C strings can have trailing NULLs or sometimes spaces (BSD archive files), so the fixed length C string defaults to stripping trailing NULLs, but can have the arguments specify to remove one or more kinds of spaces if needed. This is used to extract fixed length C strings from ELF NOTEs in D74883. Reviewers: labath, dblaikie, aprantl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74991
-
Francis Visoiu Mistrih authored
Add checks for triples that don't use mach-o, and unit tests for everything.
-
Pavel Labath authored
Summary: This should produce slightly better error messages in case of failures. Only slightly, because this code was pretty careful about that to begin with -- I've seen code which does much worse. Reviewers: jhenderson, dblaikie Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74899
-
- Feb 22, 2020
-
-
Tyker authored
-
- Feb 21, 2020
-
-
Fangrui Song authored
-
Pavel Labath authored
Summary: We already have a "Failed" matcher, which can be used to check any property of the Error object. However, most frequently one just wants to check the error message, and while this is possible with the "Failed" matcher, it is also very convoluted (Failed<ErrorInfoBase>(testing::Property(&ErrorInfoBase::message, "the message"))). Now, one can just write: FailedWithMessage("the message"). I expect that most of the usages will remain this simple, but the argument of the matcher is not limited to simple strings -- the argument of the matcher can be any other matcher, so one can write more complicated assertions if needed (FailedWithMessage(ContainsRegex("foo|bar"))). If one wants to match multiple error messages, he can pass multiple arguments to the matcher. If one wants to match the message list as a whole (perhaps to check the message count), I've also included a FailedWithMessageArray matcher, which takes a single matcher receiving a vector of error message strings. Reviewers: sammccall, dblaikie, jhenderson Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74898
-