Commit Graph

351862 Commits

Author SHA1 Message Date
Craig Topper 44d63b7528 Revert "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"
This reverts commit e00cfe254d.

Seems to be causing a linker error on the build bots.
2020-04-18 13:23:29 -07:00
kpdev 1b0436cd4b [scudo] Silent warning for u64 -> u32 convertion
Error is raised because of using -Werror=convertion
2020-04-17 09:29:55 +03:00
Craig Topper e00cfe254d [Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI
We previously clamped the trailing zero count to 31 bits. And
then clamped the final alignment to MaximumAlignment which is
1 << 29.

This patch simplifies this to just clamp the trailing zero to
29 using MaxAlignmentExponent.

I was looking into changing this function to use Align/MaybeAlign
and noticed this.

Differential Revision: https://reviews.llvm.org/D78418
2020-04-18 12:52:47 -07:00
LemonBoy aad3d578da [DebugInfo] Change DIEnumerator payload type from int64_t to APInt
This allows the representation of arbitrarily large enumeration values.
See https://lists.llvm.org/pipermail/llvm-dev/2017-December/119475.html for context.

Reviewed By: andrewrk, aprantl, MaskRay

Differential Revision: https://reviews.llvm.org/D62475
2020-04-18 12:49:31 -07:00
Uday Bondhugula ecddafd84a [MLIR] NFC affine for op tiling cleanup / utility rename
Rename mlir::tileCodeGen -> mlir::tilePerfectlyNested to be consistent.
NFC clean up tiling utility code, drop dead code, better comments.
Expose isPerfectlyNested and reuse.

Differential Revision: https://reviews.llvm.org/D78423
2020-04-19 00:53:34 +05:30
Mircea Trofin ec73ae11a3 [llvm][NFC][CallSite] Remove CallSite from ProfileSummary
Summary: Depends on D78395.

Reviewers: craig.topper, dblaikie, wmi, davidxl

Subscribers: eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78414
2020-04-18 12:03:14 -07:00
Florian Hahn 46853b95ca [SCCP] Drop unused early exit from visitStoreInst (NFC).
There are no lattice values associated with store instructions
directly. They will never get marked as overdefined.
2020-04-18 19:44:54 +01:00
Uday Bondhugula f043677f6d [MLIR] Make isPerfectlyNested check more efficient
Make mlir::isPerfectlyNested more efficient; use O(1) check instead of
O(N) size() method.

Differential Revision: https://reviews.llvm.org/D78428
2020-04-18 23:34:49 +05:30
Markus Böck cacf1b5093 [llvm-objdump] Demangle C++ Symbols in branch and call targets
Currently C++ symbols are demangled in the symbol table as well as in
the disassembly and relocations. This patch adds demangling of C++
symbols in targets of calls and branches making it easier to decipher
control flow in disassembly. This also matches up with GNUobjdump's
behavior

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D77957
2020-04-18 08:30:50 -07:00
Louis Dionne 5eb8d45ab5 [libc++] Use proper shell escaping in the executors
This was originally committed as f8452ddfcc and reverted in 7cb1aa9d93.
The issue was that shell builtins were being escaped too, and apparently
Bash won't execute a builtin when it is quoted e.g. '!'. Instead, it
thinks it's a command and it can't find it.

Re-committing the change with that issue fixed.
2020-04-18 11:22:42 -04:00
Tobias Hieta 87383e408d [ELF][ARM] Increase default max-page-size from 4096 to 6536
See http://lists.llvm.org/pipermail/llvm-dev/2020-April/140549.html

For the record, GNU ld changed to 64k max page size in 2014
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7572ca8989ead4c3425a1500bc241eaaeffa2c89
"[RFC] ld/ARM: Increase maximum page size to 64kB"

Android driver forced 4k page size in AArch64 (D55029) and ARM (D77746).

A binary linked with max-page-size=4096 does not run on a system with a
higher page size configured. There are some systems out there that do
this and it leads to the binary getting `Killed!` by the kernel.

In the non-linker-script cases, when linked with -z noseparate-code
(default), the max-page-size increase should not cause any size
difference. There may be some VMA usage differences, though.

Reviewed By: psmith, MaskRay

Differential Revision: https://reviews.llvm.org/D77330
2020-04-18 08:19:45 -07:00
Denis Khalikov a48f0a3c7e [mlir][vulkan-runner] Simplify vulkan launch call op.
Summary:
Workgroup size is written into the kernel. So to properly modelling
vulkan launch, we have to skip local workgroup size for vulkan launch
call op.

Differential Revision: https://reviews.llvm.org/D78307
2020-04-18 16:49:47 +03:00
vgxbj ac00376a13 [Object] Change uint32_t getSymbolFlags() to Expected<uint32_t> getSymbolFlags().
This change enables getSymbolFlags() to return errors which benefit error reporting in clients.

Differential Revision: https://reviews.llvm.org/D77860
2020-04-18 21:27:57 +08:00
Florian Hahn 9cd68bfa0e [SCCP] Add additional tests for structs, conditional prop and widening.
This patch adds a few additional test cases with cases subsequent patches
will improve on.
2020-04-18 14:07:56 +01:00
Florian Hahn 034e8d58a8 [SCCP] Drop unused early exit from visitReturnInst (NFC).
There are no lattice values associated with return instructions
directly. They will never get marked as overdefined.
2020-04-18 13:52:41 +01:00
Simon Pilgrim 9b95186c30 HeatUtils.h - remove unnecessary includes. NFC.
Replace with BlockFrequencyInfo/Function forward declarations
Move BlockFrequencyInfo.h include to HeatUtils.cpp
2020-04-18 13:37:06 +01:00
Florian Hahn b7cdb138af [ValueLattice] Use 8 bits for Tag.
Suggested as follow-up in D78145 post-commit to be more machine friendly.
2020-04-18 13:31:17 +01:00
Luís Marques a348de480d [CMake][NFC] Clean up CheckAtomic.cmake
`CheckAtomic.cmake` was skipping the test of whether atomics work in MSVC
without an atomics library (they do), but not setting the value of
`HAVE_CXX_ATOMICS_WITHOUT_LIB`. That caused build issues when trying to land
D69869. I fixed that issue in f128f442a3, by adding an `elseif(MSVC)`, as
was being done below in the 64-bit atomics check. That minimal fix did work,
but it kept various inconsistencies between the original atomics check and
the 64-bit one. This patch now makes the checks follow the same structure,
cleaning them up.

Differential Revision: https://reviews.llvm.org/D74767
2020-04-18 12:53:22 +01:00
Simon Pilgrim 0b24215101 IRReader.h - remove unnecessary StringRef forward declaration. NFC.
We need to include StringRef.h.
2020-04-18 12:31:42 +01:00
Simon Pilgrim a140a9b112 [cmake] LLVMPasses - add include/llvm header path
Pick up all the Pass headers in the root for MSVC projects
2020-04-18 12:31:41 +01:00
Simon Pilgrim f1f2acf9e1 [cmake] LLVMDWARFLinker - add include/llvm/DWARFLinker header path
Pick up the DWARFLinker headers in MSVC projects
2020-04-18 12:31:41 +01:00
Simon Pilgrim 2333ea1e70 [cmake] LLVMMIRParser - add include/llvm/CodeGen/LLVMMIRParser header path
Pick up the CodeGen/MIRParser headers in MSVC projects
2020-04-18 12:31:41 +01:00
Simon Pilgrim 5c16da387e [cmake] LLVMGlobalISel - add include/llvm/CodeGen/GlobalISel header path
Pick up the GlobalISel headers in MSVC projects
2020-04-18 12:31:40 +01:00
Simon Pilgrim 2aef5b62c9 [cmake] LLVMAsmParser - add include/llvm/ASMParser header path
Copy + paste typo meant we were picking up the include/llvm/Analysis path instead
2020-04-18 12:31:40 +01:00
Simon Pilgrim e7ae732a44 [cmake] LLVMFrontendOpenMP - fix include/llvm/Frontend/OpenMP header path
Correctly pick up the OMP*.h headers in MSVC projects
2020-04-18 12:31:39 +01:00
Nikita Popov f005f6c234 Revert "ADT: SmallVector size/capacity use word-size integers when elements are small"
This reverts commit b8d08e961d.

This change causes a 1% compile-time and 1% memory usage regression:

http://llvm-compile-time-tracker.com/compare.php?from=73b7dd1fb3c17a4ac4b1f1e603f26fa708009649&to=b8d08e961df1d229872c785ebdbc8367432e9752&stat=instructions
http://llvm-compile-time-tracker.com/compare.php?from=73b7dd1fb3c17a4ac4b1f1e603f26fa708009649&to=b8d08e961df1d229872c785ebdbc8367432e9752&stat=max-rss
2020-04-18 11:46:58 +02:00
Florian Hahn 4ee45ab60f [LV] Invalidate cost model decisions along with interleave groups.
Cost-modeling decisions are tied to the compute interleave groups
(widening decisions, scalar and uniform values). When invalidating the
interleave groups, those decisions also need to be invalidated.

Otherwise there is a mis-match during VPlan construction.
VPWidenMemoryRecipes created initially are left around w/o converting them
into VPInterleave recipes. Such a conversion indeed should not take place,
and these gather/scatter recipes may in fact be right. The crux is leaving around
obsolete CM_Interleave (and dependent) markings of instructions along with
their costs, instead of recalculating decisions, costs, and recipes.

Alternatively to forcing a complete recompute later on, we could try
to selectively invalidate the decisions connected to the interleave
groups. But we would likely need to run the uniform/scalar value
detection parts again anyways and the extra complexity is probably not
worth it.

Fixes PR45572.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D78298
2020-04-18 10:23:49 +01:00
Jan Kratochvil 239093f30c [lldb] [testsuite] Fix a regression of TestCppScope.py
This is a regression since:
  [lldb][NFC] Modernize lang/cpp/scope test
  acb0b99c8e
  rGacb0b99c8e4f

  File "/home/jkratoch/redhat/llvm-monorepo/lldb/test/API/lang/cpp/scope/TestCppScope.py", line 19, in test
    self.assertEqual(global_var_names, expected_var_names)
  AssertionError: Lists differ: ['C::a', 'A::a', 'B::a', '::a'... != ['A::a', 'B::a', 'C::a', '::a'...
  First differing element 0:
  C::a
  A::a
  - ['C::a', 'A::a', 'B::a', '::a']
  + ['A::a', 'B::a', 'C::a', '::a']

ManualDWARFIndex using NameToDIE does not sort alphabetically:
    // This is only for uniqueness, not lexicographical ordering, so we can
    // just compare pointers.
    return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
2020-04-18 10:46:32 +02:00
Luís Marques 60ce987bf3 [RISCV][PowerPC] Fix google/benchmark benchmark::cycleclock::Now
Cherrypick the upstream fix commit a77d5f7 onto llvm/utils/benchmark
and libcxx/utils/google-benchmark.
This fixes LLVM's 32-bit RISC-V compilation, and the issues
mentioned in https://github.com/google/benchmark/pull/955
An additional cherrypick of ecc1685 fixes some minor formatting
issues introduced by the preceding commit.

Differential Revision: https://reviews.llvm.org/D78084
2020-04-18 09:32:19 +01:00
Anchu Rajendran c1c01212c4 [flang]Implemented Semantic Checkes for 5 data constraints
Summary:
 C874, C875, C878, C880 and C881 checks are implemented.

Differential Revision: https://reviews.llvm.org/D78008
2020-04-18 12:21:30 +05:30
Shengchen Kan 0d3149f431 [MC][X86] Disable branch align in non-text section
Summary:
The instruction in non-text section can not be executed, so they will not affect performance.
In addition, their encoding values are treated as data, so we should not touch them.

Reviewers: MaskRay, reames, LuoYuanke, jyknight

Reviewed By: MaskRay

Subscribers: annita.zhang, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77971
2020-04-18 14:41:25 +08:00
Jan Kratochvil eef9cb1628 [lldb] [testsuite] Fix TestFixIts.py on Linux
Since D77214 there is a testsuite regression for TestFixIts.py
on Fedora 31 x86_64.
    File "/home/jkratoch/redhat/llvm-monorepo/lldb/test/API/commands/expression/fixits/TestFixIts.py", line 148, in test_with_target
      self.assertEquals(value.GetError().GetCString(), "error: No value")
  AssertionError: 'error: error: Multiple internal symbols found for \'d\'\nid = {0x00000d2a}, ran [truncated]... != 'error: No value'

That is because Fedora glibc incl. libm.so contains also ELF debug
symbols and there exists a 'd' symbol:
  (gdb) p d
  $1 = {i = {0, 1076887552}, d = 16}
  (gdb) p &d
  $2 = (const number *) 0x7ffff78e8bc0 <d>
  (gdb) info sym 0x7ffff78e8bc0
  d in section .rodata of /lib64/libm.so.6

  $ nm /lib64/libm.so.6 |grep ' d$'
  00000000000bfbc0 r d
  00000000000caa20 r d
  00000000000caa20 r d
  00000000000caa20 r d

  glibc-build$ for i in `find -name "*.o"`;do nm 2>/dev/null $i|grep ' d$' && echo $i;done
  0000000000000080 r d
  ./math/s_atan-fma4.o
  0000000000000080 r d
  ./math/s_atan-avx.o
  0000000000000080 r d
  ./math/s_atan.o
2020-04-18 08:32:12 +02:00
Petr Hosek 6919b708a1 [CMake] Set UBSAN_LINK_FLAGS for ubsan
This variable is being used, but it's not being set (it's only set
for ubsan_minimal, but not ubsan). This addresses a regression that
was introduced in D78325.

Differential Revision: https://reviews.llvm.org/D78410
2020-04-17 23:21:59 -07:00
Richard Smith 6bc7502385 When making modules transitively visible, don't take into account
whether they have missing header files.

Whether a module's headers happen to be present on the local file system
should make no difference to whether we make its contents visible when
importing another module that re-exports it. If we have an up-to-date
AST file that we can load, that's all that matters.

This fixes the ability to header syntax checking for modular headers in
C++20 mode (or in prior modes where -fmodules-local-submodule-visibility
is enabled but -fmodules is not).
2020-04-17 22:49:58 -07:00
Richard Smith fc76b4ad3d Rename IsMissingRequirement to IsUnimportable and set it for shadowed
modules too.

This more accurately reflects the semantics of this flag, as distinct
from "IsAvailable", which (in an explicit modules world) only describes
whether a module is buildable, not whether it's importable.
2020-04-17 22:48:56 -07:00
Richard Smith c8248dc3bb Change deprecated -fsanitize-recover flag to apply to all sanitizers, not just UBSan.
Summary:
This flag has been deprecated, with an on-by-default warning encouraging
users to explicitly specify whether they mean "all" or ubsan for 5 years
(released in Clang 3.7). Change it to mean what we wanted and
undeprecate it.

Also make the argument to -fsanitize-trap optional, and likewise default
it to 'all', and express the aliases for these flags in the .td file
rather than in code. (Plus documentation updates for the above.)

Reviewers: kcc

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77753
2020-04-17 22:37:30 -07:00
Andrew Litteken 8d5024f7fe fix to outline cfi instruction when can be grouped in a tail call
[MachineOutliner] fix test for excluding CFI and add test to include CFI in outlining

New test to check that we only outline CFI instruction if all CFI
Instructions in the function would be captured by the outlining

adding x86 tests analagous to AARCH64 cfi tests

Revision: https://reviews.llvm.org/D77852
2020-04-17 22:26:34 -07:00
Brad Moody fb42d3afad [ADT] Fix bug in BitVector and SmallBitVector DenseMap hashing.
BitVectors and SmallBitVectors with equal contents but different
capacities were getting different hashes.

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D77038
2020-04-18 00:21:08 -05:00
Craig Topper 31a166e4cb [X86] Clean up some mir tests with INLINEASM to avoid regdef or to correct the immediate for the regdef.
The immediate used for the regdef is the encoding for the register
class in the enum generated by tablegen. This encoding will change
any time a new register class is added. Since the number is part
of the input, this means it can become stale.

This change modifies some test to avoid this kind of immediate
all together. And updates one test to use the current encoding of
GR64.
2020-04-17 21:55:44 -07:00
Lucy Fox a0d5e54966 [MLIR] Update tutorial to add missing tests and bring directory paths and code snippets up to date.
Summary:
The tests referred to in Chapter 3 of the tutorial were missing from the tutorial test
directory; this adds those missing tests. This also cleans up some stale directory paths and code
snippets used throughout the tutorial.

Differential Revision: https://reviews.llvm.org/D76809
2020-04-17 20:15:16 -07:00
Lucy Fox a6b427167e [MLIR] Update tutorial to add missing tests and bring directory paths and code snippets up to date.
Summary:
The tests referred to in Chapter 3 of the tutorial were missing from the tutorial test
directory; this adds those missing tests. This also cleans up some stale directory paths and code
snippets used throughout the tutorial.

Differential Revision: https://reviews.llvm.org/D76809
2020-04-17 20:15:15 -07:00
Lucy Fox 495cf27291 [MLIR] Update tutorial to add missing tests and bring directory paths and code snippets up to date.
Summary:
The tests referred to in Chapter 3 of the tutorial were missing from the tutorial test
directory; this adds those missing tests. This also cleans up some stale directory paths and code
snippets used throughout the tutorial.

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, aartbik, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76809
2020-04-17 20:15:15 -07:00
Mircea Trofin 41ad8b7388 [llvm][NFC][CallSite] Remove CallSite from Evaluator.
Reviewers: craig.topper, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78395
2020-04-17 19:11:17 -07:00
Nico Weber c7c3b877c8 add temporary logging to help diagnose a bot-only failure 2020-04-17 22:06:37 -04:00
Peter Collingbourne 21d50019ca scudo: Add support for diagnosing memory errors when memory tagging is enabled.
Introduce a function __scudo_get_error_info() that may be called to interpret
a crash resulting from a memory error, potentially in another process,
given information extracted from the crashing process. The crash may be
interpreted as a use-after-free, buffer overflow or buffer underflow.

Also introduce a feature to optionally record a stack trace for each
allocation and deallocation. If this feature is enabled, a stack trace for
the allocation and (if applicable) the deallocation will also be available
via __scudo_get_error_info().

Differential Revision: https://reviews.llvm.org/D77283
2020-04-17 17:26:30 -07:00
Reid Kleckner 91a6bfed61 [COFF] Assign unique identifiers to ObjFiles from LTO
Use the unique filenames that are used when /lldsavetemps is passed.
After this change, module names for LTO blobs in PDBs will be unique.
Visual Studio and probably other debuggers expect module names to be
unique.

Revert some changes from 1e0b158db (2017) that are no longer necessary
after removing MSVC LTO support.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D78221
2020-04-17 17:15:12 -07:00
Craig Topper cd28a4736a [AbstractCallSite] Fix some doxygen comments I failed to update when ImmutableCallSite was replaced with CallBase.
Also fix an 80 column violation.
2020-04-17 17:08:28 -07:00
Matt Arsenault f463792506 AMDGPU: Remove custom node for RSQ_LEGACY
Directly select from the intrinsic. This wasn't getting much value
from the custom node.
2020-04-17 19:50:36 -04:00
Erich Keane 50511a406d Add SemaTemplateDeduction.cpp to /bigobj
According to Nathaniel McVicar on the review for D73967,
SematTemplateDeduction hit the 16 bit COFF limit.  This adds it to the
/bigobj list.
2020-04-17 16:33:07 -07:00
Andrew Browne b8d08e961d ADT: SmallVector size/capacity use word-size integers when elements are small
SmallVector currently uses 32bit integers for size and capacity to reduce
sizeof(SmallVector). This limits the number of elements to UINT32_MAX.

For a SmallVector<char>, this limits the SmallVector size to only 4GB.
Buffering bitcode output uses SmallVector<char>, but needs >4GB output.

This changes SmallVector size and capacity to conditionally use word-size
integers if the element type is small (<4 bytes). For larger elements types,
the vector size can reach ~16GB with 32bit size.

Making this conditional on the element type provides both the smaller
sizeof(SmallVector) for larger types which are unlikely to grow so large,
and supports larger capacities for smaller element types.

This change also includes a fix for the bug where a SmallVector with 32bit
size has reached UINT32_MAX elements, and cannot provide guaranteed growth.

Context:

    // Double the size of the allocated memory, guaranteeing space for at
    // least one more element or MinSize if specified.
    void grow(size_t MinSize = 0) { this->grow_pod(MinSize, sizeof(T)); }

    void push_back(const T &Elt) {
      if (LLVM_UNLIKELY(this->size() >= this->capacity()))
        this->grow();
      memcpy(reinterpret_cast<void *>(this->end()), &Elt, sizeof(T));
      this->set_size(this->size() + 1);
    }

When grow is called in push_back() without a MinSize specified, this is
relying on the guarantee of space for at least one more element.

There is an edge case bug where the SmallVector is already at its maximum size
and push_back() calls grow() with default MinSize of zero. Grow is unable to
provide space for one more element, but push_back() assumes the additional
element it will be available. This can result in silent memory corruption, as
this->end() will be an invalid pointer and the program may continue executing.

An alternative to this fix would be to remove the default argument from
grow(), which would mean several changing grow() to grow(this->size()+1)
in several places.

No test case added because it would require allocating a large ammount.

Differential Revision: https://reviews.llvm.org/D77621
2020-04-17 16:11:13 -07:00