1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
Commit Graph

195286 Commits

Author SHA1 Message Date
Lang Hames
13d5cb59cb [ORC] Add example showing how to initialize/deinitialize a JITDylib with LLJIT. 2020-04-18 14:16:54 -07:00
Lang Hames
7ae46579a6 [ORC] Add a convenience method to create a JITEvaluatedSymbol from a pointer.
This can be used to reduce boilerplate code, especially when defining absolute
symbols.
2020-04-18 14:16:54 -07:00
Lang Hames
c0b552bc67 [ORC] Replace LLJIT::defineAbsolute with an LLJIT::define convenience method.
LLJIT::defineAbsolute did not mangle its Name argument, which is inconsistent
with the behavior of other LLJIT methods (e.g. lookup). Since it is currently
unused anyway, this commit replaces it with a generic 'define' convenience
method for adding MaterializationUnits to the main JITDylib. This simplifies
use of the generic absoluteSymbols function (as well as the symbolAlias,
reexports and other functions that generate MaterializationUnits) with LLJIT.
2020-04-18 14:16:54 -07:00
Ayal Zaks
68a54b9358 [LV] Mark first-order recurrences as allowed exits
First-order recurrences require special treatment when they are live-out;
such treatment is provided by fixFirstOrderRecurrence(), so they should be
included in AllowedExit set.

(Should probably have been included originally in D16197.)

Fixes PR45526: AllowedExit set is used by prepareToFoldTailByMasking() to
check whether the treatment for live-outs also holds when folding the tail,
which is not (yet) the case for first-order recurrences.

Differential Revision: https://reviews.llvm.org/D78210
2020-04-18 23:54:21 +03:00
Craig Topper
8ebec98113 Recommit "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"
With a tweak to avoid a linker error for passing
MaxAlignmentExponent by reference to std::min.
2020-04-18 13:51:57 -07:00
Simon Pilgrim
c66b050ac5 UnrollLoop.h - replace StringRef.h/ValueMapper.h includes with forward declarations. NFC. 2020-04-18 21:43:22 +01:00
Nikita Popov
913eccffbe [ValueLattice] Remove unnecessary ConstVal nulling (NFC)
ConstVal is not an owned pointer, so setting it to nullptr is not
actually doing anything. If we switch to a state that does not use
ConstVal, the value does not matter.

Split out from D78425.
2020-04-18 22:36:38 +02:00
Nikita Popov
5d66445c06 [PredicateInfo] Factor out PredicateInfoBuilder (NFC)
When running IPSCCP on a module with many small functions, memory
usage is dominated by PredicateInfo, which is a huge structure
(partially due to some unfortunate nested SmallVector use). However,
most of it is actually only temporary state needed to build
predicate info, and does not need to be retained after initial
construction.

This patch factors out the predicate building logic and state
into a separate PrediceInfoBuilder, with the extra bonus that
it does not need to live in the header anymore.

Differential Revision: https://reviews.llvm.org/D78326
2020-04-18 22:34:38 +02:00
Craig Topper
3b99240c11 Revert "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"
This reverts commit e00cfe254d99629ec344031adfe1878a84f3b0b3.

Seems to be causing a linker error on the build bots.
2020-04-18 13:23:29 -07:00
Craig Topper
f88ef9dd83 [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
5ef1cd8cb9 [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
Mircea Trofin
0ca1b1c956 [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
d2f9da4a0a [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
Markus Böck
ababa31040 [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
vgxbj
bbdc25ab11 [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
79fde5bd66 [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
02134e2eaf [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
d9ea866fce 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
138c5557f7 [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
b634f6f189 [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 f128f442a3d, 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
bdf641f815 IRReader.h - remove unnecessary StringRef forward declaration. NFC.
We need to include StringRef.h.
2020-04-18 12:31:42 +01:00
Simon Pilgrim
ca1c8be47b [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
96c135b3c6 [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
007f92f517 [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
b2bf911d3c [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
e4bb0ad874 [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
9ef9eb35cd [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
a8d691ac8e Revert "ADT: SmallVector size/capacity use word-size integers when elements are small"
This reverts commit b8d08e961df1d229872c785ebdbc8367432e9752.

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
a69c448a2d [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
Luís Marques
2f34a6844a [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
Shengchen Kan
8d31971bd9 [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
Andrew Litteken
c5eb58bb14 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
a4ccc4b743 [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
933eddb428 [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
Mircea Trofin
96db842880 [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
Craig Topper
98dab69d28 [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
f5d3007f60 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
Andrew Browne
16ab59cba8 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
LLVM GN Syncbot
6ea6ceec29 [gn build] Port 66037b84cf5 2020-04-17 22:33:56 +00:00
Jessica Paquette
25996ee31a MachineFunctionInfo for AArch64 in MIR
Starting with hasRedZone adding MachineFunctionInfo to be put in the YAML for MIR files.

Split out of: D78062

Based on implementation for MachineFunctionInfo for WebAssembly

Differential Revision: https://reviews.llvm.org/D78173

Patch by Andrew Litteken! (AndrewLitteken)
2020-04-17 15:16:59 -07:00
Anna Thomas
630e5aa65c Fix buildbot failure due to obsolete CallSite usage
Fix buildbot failures due to ef49b1d97e1ac75bff8ff7dec3097b43bcd07e73
(which was a revert of a previous change).
2020-04-17 17:46:19 -04:00
Daniel Sanders
a8cde5881b Don't accidentally create MachineFunctions in mir-debugify/mir-strip-debugify
We should only modify existing ones. Previously, we were creating
MachineFunctions for externally-available functions. AFAICT this was benign
in tree but ultimately led to asan bugs in our out of tree target.
2020-04-17 14:28:41 -07:00
Anna Thomas
9d5348b366 Revert "[InlineFunction] Update metadata on loads that are return values"
This reverts commit 1d0f757904919d19f1cf5dcd307874bceb1e9efb because of
https://bugs.llvm.org/show_bug.cgi?id=45590. Needs investigation.
2020-04-17 17:23:00 -04:00
Christopher Tetreault
2b02937417 Remove asserting getters from base Type
Summary:
Remove asserting vector getters from Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: dexonsmith, sdesmalen, efriedma

Reviewed By: efriedma

Subscribers: cfe-commits, hiraditya, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D77278
2020-04-17 14:03:31 -07:00
Daniel Sanders
2bae4464ae [globalisel][legalizer] Expect to lose DebugLocs in dead code
There's not really anything else that can be done with them.
Fortunately, this dead code cleanup doesn't seem to trigger
very often.
2020-04-17 13:45:44 -07:00
Daniel Sanders
c3fd7b3371 [globalisel][legalizer] Include newly-dead code in artifact combine checks for DebugLoc loss
This dead code deletion is part of the combine and the combine
results should account for their locations.
2020-04-17 13:45:44 -07:00
Daniel Sanders
dd30404b10 [globalisel][legalizer] Fix --verify-legalizer-debug-locs values
It was using the enum class name, like so:
    =DebugLocVerifyLevel::None                                         -   No verification
Changed it to:
    =none                                                              -   No verification
2020-04-17 13:45:44 -07:00
Craig Topper
ada51d3105 [X86] Remove single incoming value phis from tests for the loop SAD pattern. NFC
InstCombine should ensure these don't exist.

I'm looking at making some changes to how we detect these
patterns and not having to worry about these phis will help.
2020-04-17 13:39:47 -07:00
Bjorn Pettersson
9de55915d8 [Float2Int] Make iteration over Roots deterministic
Summary:
Use a SmallSetVector instead of a SmallPtrSet when collecting
and storing Roots.

The iteration order for a SmallPtrSet is not deterministic,
so in the past the order of items inserted in the WorkList
inside walkBackwards has been non-deterministic. This patch
intends to make the order of rewrites done in Float2Int
deterministic by changing the container for the Roots set.

The semantics result of the transformation should not be
any different afaict. But at least naming of IR variables
(when outputting the result as an ll file) should be more
stable now.

Reviewers: craig.topper, spatel, cameron.mcinally

Reviewed By: spatel

Subscribers: mgrang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74534
2020-04-17 21:40:12 +02:00
Francesco Petrogalli
415d62dfda [llvm][CodeGen] Addressing modes for SVE stN.
This reverts commit 17b1869b72f30f2702cb1abd7222027082e49eb6.

It is an attempt to fix the failure reported at

The patch differs from the original one reviwed at
https://reviews.llvm.org/D77435 only for the use of the std::make_tuple
in building the return value of `findAddrModeSVELoadStore`:

   -  return {IsRegReg ? Opc_rr : Opc_ri, NewBase, NewOffset};
   +  return std::make_tuple(IsRegReg ? Opc_rr : Opc_ri, NewBase,

the original patch submitted at
fc4e954ed5
was failing the following build:

http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/29420/

with error:

/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:1439:10:
error: chosen constructor is explicit in copy-initialization
  return {IsRegReg ? Opc_rr : Opc_ri, NewBase, NewOffset};
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/tuple:479:19:
   note: explicit constructor declared here
           constexpr tuple(_UElements&&... __elements)
	                     ^
			     1 error generated.
2020-04-17 20:35:35 +01:00