1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Commit Graph

175760 Commits

Author SHA1 Message Date
Stefan Pintilie
56821de61c [PowerPC] Move the stack pointer update instruction later in the prologue and earlier in the epilogue.
Move the stdu instruction in the prologue and epilogue.
This should provide a small performance boost in functions that are able to do
this. I've kept this change rather conservative at the moment and functions
with frame pointers or base pointers will not try to move the stack pointer
update.

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

llvm-svn: 355085
2019-02-28 12:23:28 +00:00
Simon Pilgrim
812a37b194 [X86][AVX] Remove superfluous insert_subvector(zero, bitcast(x)) -> bitcast(insert_subvector(zero, x)) fold
This is caught by other existing bitcast folds.

llvm-svn: 355084
2019-02-28 11:39:52 +00:00
Diana Picus
5987b93622 [ARM GlobalISel] Make arm_i32imm an IntImmLeaf
This gets rid of some duplication in the TableGen definition, but it
forces us to keep both a pointer and a reference to the subtarget in the
ARMInstructionSelector. That is pretty ugly but it might be a reasonable
trade-off, since the TableGen descriptions should outlive the code in
the selector (or in the worst case we can update to use just the
reference when we get rid of DAGISel).

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

llvm-svn: 355083
2019-02-28 11:13:05 +00:00
Dmitri Gribenko
de282e8bdd Fixed typos in a test: s/CEHCK/CHECK/
Reviewers: ilya-biryukov, serge-sans-paille

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 355080
2019-02-28 10:58:13 +00:00
Dmitri Gribenko
b38df3f22e Fixed a typo in the test s/CEHCK/CHECK/
Summary:
Turns out the test was not correct, I had to adjust the test to work.  I
also added CHECK-LABELs for better error messages from FileCheck while
I'm here.

Reviewers: jsji

Subscribers: nemanjai, eraman, llvm-commits

Tags: #llvm

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

llvm-svn: 355079
2019-02-28 10:56:39 +00:00
Simon Pilgrim
975aa20abe [X86][AVX] Fold vf64 concat_vectors(movddup(x),movddup(x)) -> broadcast(x)
llvm-svn: 355078
2019-02-28 10:53:58 +00:00
Diana Picus
5ee2be1ef2 [ARM GlobalISel] Support global variables for Thumb2
Add the same level of support as for ARM mode (i.e. still no TLS
support).

In most cases, it is sufficient to replace the opcodes with the
t2-equivalent, but there are some idiosyncrasies that I decided to
preserve because I don't understand the full implications:
* For ARM we use LDRi12 to load from constant pools, but for Thumb we
  use t2LDRpci (I'm not sure if the ideal would be to use t2LDRi12 for
  Thumb as well, or to use LDRcp for ARM).
* For Thumb we don't have an equivalent for MOV|LDRLIT_ga_pcrel_ldr, so
  we have to generate MOV|LDRLIT_ga_pcrel plus a load from GOT.

The tests are in separate files because they're hard enough to read even
without doubling the number of checks.

llvm-svn: 355077
2019-02-28 10:42:47 +00:00
George Rimar
47c7c0875f [llvm-objdump] - Improve the error message for "removing a section that is used by relocation" case.
This refines/improves the error message introduced in D58625

Differential revision: https://reviews.llvm.org/D58709

llvm-svn: 355074
2019-02-28 08:21:50 +00:00
George Rimar
a100e9a82e [llvm-readobj] - Fix the invalid dumping of the dynamic sections without terminating DT_NULL entry.
This is https://bugs.llvm.org/show_bug.cgi?id=40861,

Previously llvm-readobj would print the DT_NULL sometimes
for the dynamic section that has no terminator entry.

The logic of printDynamicTable was a bit overcomplicated.
I rewrote it slightly to fix the issue and commented.

Differential revision: https://reviews.llvm.org/D58716

llvm-svn: 355073
2019-02-28 08:15:59 +00:00
Nikita Popov
ccf8d4c393 [ValueTracking] More accurate unsigned add overflow detection
Part of D58593.

Compute precise overflow conditions based on all known bits, rather
than just the sign bits. Unsigned a + b overflows iff a > ~b, and we
can determine whether this always/never happens based on the minimal
and maximal values achievable for a and ~b subject to the known bits
constraint.

llvm-svn: 355072
2019-02-28 08:11:20 +00:00
Craig Topper
94ad43a853 [X86] Use PreprocessISelDAG to convert vector sra/srl/shl to the X86 specific variable shift ISD opcodes.
These allows use to use the same set of isel patterns for sra/srl/shl which are undefined for out of range shifts and intrinsic shifts which aren't undefined.

Doing this late allows DAG combine to have every opportunity to optimize the sra/srl/shl nodes.

This removes about 7000 bytes from the isel table and simplies the td files.

llvm-svn: 355071
2019-02-28 07:21:26 +00:00
Fangrui Song
8a35c45412 [Dominators] Avoid potentially quadratic std::is_permutation
Summary:
If the two sequences are not equal, std::is_permutation may be O(N^2)
and indeed the case in libstdc++ and libc++. Use SmallPtrSet to prevent
pessimizing cases. On my machine, SmallPtrSet starts to outperform
std::is_permutation when there are 16 elements.

Reviewers: kuhar

Reviewed By: kuhar

Subscribers: kristina, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355070
2019-02-28 05:16:01 +00:00
Philip Reames
4877351163 [SelectionDAG] Strengthen assertions about usage of AtomicSDNodes
In D57601, I described the expectations around usage of AtomicSDNode and LoadSDNode/StoreSDNode w.r.t. atomic and volatiles. This patch simply embeds those expectations in assertions so that they can't be accidentally weakened.

Note: The reason only AtomicSDNodes of ATOMIC_LOAD and ATOMIC_STORE opcode are currently checked is that AMDGPU has an intrinsic which gets lowered to an ATOMIC_LOAD_FADD w/o a corresponding atomic MMO. This is suspicious, and I've brought it to the attention of the relevant developers. Once resolved, I'll strengthen that assertion.

Note 2: If this breaks your out-of-tree backend, go read the update instructions associated w/the previously mentioned patch. This will assert on (a subset of) things you need to update per those instructions.

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

llvm-svn: 355069
2019-02-28 04:07:23 +00:00
Richard Trieu
24db3e65cf Fix IR/Analysis layering issue with OptBisect
OptBisect is in IR due to LLVMContext using it.  However, it uses IR units from
Analysis as well.  This change moves getDescription functions from OptBisect
to their respective IR units.  Generating names for IR units will now be up
to the callers, keeping the Analysis IR units in Analysis.  To prevent
unnecessary string generation, isEnabled function is added so that callers know
when the description needs to be generated.

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

llvm-svn: 355068
2019-02-28 04:00:55 +00:00
Alexandre Ganea
052cc61bbf Fix SupportTests.exe/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge when the machine doesn't have large pages enabled.
llvm-svn: 355067
2019-02-28 03:42:07 +00:00
Alexandre Ganea
0db808bf54 Fix non-Windows platforms build break introduced by r355065. Fixes:
In file included from /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm/lib/Support/Memory.cpp:14:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm/include/llvm/Support/Memory.h:38:14: error: private field 'Flags' is not used [-Werror,-Wunused-private-field]
    unsigned Flags = 0;
             ^
1 error generated.

llvm-svn: 355066
2019-02-28 03:03:07 +00:00
Alexandre Ganea
a891789c78 [Memory] Add basic support for large/huge memory pages
This patch introduces Memory::MF_HUGE_HINT which indicates that allocateMappedMemory() shall return a pointer to a large memory page.
However the flag is a hint because we're not guaranteed in any way that we will get back a large memory page. There are several restrictions:

- Large/huge memory pages aren't enabled by default on modern OSes (Windows 10 and Linux at least), and should be manually enabled/reserved.
- Once enabled, it should be kept in mind that large pages are physical only, they can't be swapped.
- Memory fragmentation can affect the availability of large pages, especially after running the OS for a long time and/or running along many other applications.

Memory::allocateMappedMemory() will fallback to 4KB pages if it can't allocate 2MB large pages (if Memory::MF_HUGE_HINT is provided)

Currently, Memory::MF_HUGE_HINT only works on Windows. The hint will be ignored on Linux, 4KB pages will always be returned.

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

llvm-svn: 355065
2019-02-28 02:47:34 +00:00
Eric Christopher
df9622f2af Temporarily revert "ArgumentPromotion should copy all metadata to new Function" and the dependent patch "Refine ArgPromotion metadata handling" as they're causing segfaults in argument promotion.
This reverts commits r354032 and r353537.

llvm-svn: 355060
2019-02-28 01:11:12 +00:00
Craig Topper
b4c9f3b6c3 [X86] Use X86::LAST_VALID_COND instead of assuming X86::COND_S is the last encoding. NFC
llvm-svn: 355059
2019-02-28 01:00:31 +00:00
Matt Arsenault
569c6b39cb AMDGPU/GlobalISel: Add regbankselect test for phis
Add baseline for future fixes. These mostly show how this is broken
and producing illegal situations.

llvm-svn: 355057
2019-02-28 00:52:36 +00:00
Matt Arsenault
f7c6db9454 AMDGPU: Fix typo
llvm-svn: 355056
2019-02-28 00:52:33 +00:00
Matt Arsenault
4b80ae6d95 AMDGPU: Enable function calls by default
Fixes some crashes on illegal call situations which are unfortunately
still valid IR.

llvm-svn: 355051
2019-02-28 00:40:32 +00:00
Abderrazek Zaafrani
7c74725f8a [AArch64] Generate FP16 vector compare instructions.
https://reviews.llvm.org/D58561

llvm-svn: 355050
2019-02-28 00:31:38 +00:00
Matt Arsenault
836b89a4d6 AMDGPU: Fix crashes in invalid call cases
We have to at least tolerate calls to kernels, possibly with a
mismatched calling convention on the callsite.

llvm-svn: 355049
2019-02-28 00:28:44 +00:00
Matt Arsenault
daf210c34f GlobalISel: Implement fewerElementsVector for phi
llvm-svn: 355048
2019-02-28 00:16:32 +00:00
Matt Arsenault
e6b217e4a7 GlobalISel: Implement moreElementsVector for phi
llvm-svn: 355047
2019-02-28 00:01:05 +00:00
Reid Kleckner
eab9f78208 [InstrProf] Use separate comdat group for data and counters
Summary:
I hadn't realized that instrumentation runs before inlining, so we can't
use the function as the comdat group. Doing so can create relocations
against discarded sections when references to discarded __profc_
variables are inlined into functions outside the function's comdat
group.

In the future, perhaps we should consider standardizing the comdat group
names that ELF and COFF use. It will save object file size, since
__profv_$sym won't appear in the symbol table again.

Reviewers: xur, vsk

Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

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

llvm-svn: 355044
2019-02-27 23:38:44 +00:00
Alina Sbirlea
8601cb2c88 [MemorySSA] Make insertDef insert corresponding phi nodes.
Summary:
The original assumption for the insertDef method was that it would not
materialize Defs out of no-where, hence it will not insert phis needed
after inserting a Def.

However, when cloning an instruction (use case used in LICM), we do
materialize Defs "out of no-where". If the block receiving a Def has at
least one other Def, then no processing is needed. If the block just
received its first Def, we must check where Phi placement is needed.
The only new usage of insertDef is in LICM, hence the trigger for the bug.

But the original goal of the method also fails to apply for the move()
method. If we move a Def from the entry point of a diamond to either the
left or right blocks, then the merge block must add a phi.
While this usecase does not currently occur, or may be viewed as an
incorrect transformation, MSSA must behave corectly given the scenario.

Resolves PR40749 and PR40754.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355040
2019-02-27 22:20:22 +00:00
Joerg Sonnenberger
0a1c9d5b84 Default to Secure PLT on PPC for NetBSD and OpenBSD.
This matches the default settings of clang.

llvm-svn: 355038
2019-02-27 21:53:14 +00:00
James Y Knight
f8d4b8a125 Fixup compilation/test failures after r354960 and r355013.
llvm-svn: 355034
2019-02-27 21:47:35 +00:00
Matt Davis
0b0d0dcae8 [llvm-cxxfilt] Re-enable split and demangle stdin input on certain non-alphanumerics.
This restores the patch that splits demangled stdin input on
non-alphanumerics.  I had reverted this patch earlier because it broke
Windows build-bots.  I have updated the test so that it passes on
Windows.

I was running the test from powershell and never saw the issue until I
switched to the mingw shell.

This reverts commit 628ab5c6820bdf3bb5a8e494b0fd9e7312ce7150.

llvm-svn: 355031
2019-02-27 21:39:11 +00:00
Evgeniy Stepanov
fc38155418 [hwasan, asan] Intercept vfork.
Summary:
Intercept vfork on arm, aarch64, i386 and x86_64.

Reviewers: pcc, vitalybuka

Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 355030
2019-02-27 21:11:50 +00:00
Philip Reames
5b88c27efa Seperate volatility and atomicity/ordering in SelectionDAG
At the moment, we mark every atomic memory access as being also volatile. This is unnecessarily conservative and prohibits many legal transforms (DCE, folding, etc..).

This patch removes MOVolatile from the MachineMemOperands of atomic, but not volatile, instructions. This should be strictly NFC after a series of previous patches which have gone in to ensure backend code is conservative about handling of isAtomic MMOs. Once it's in and baked for a bit, we'll start working through removing unnecessary bailouts one by one. We applied this same strategy to the middle end a few years ago, with good success.

To make sure this patch itself is NFC, it is build on top of a series of other patches which adjust code to (for the moment) be as conservative for an atomic access as for a volatile access and build up a test corpus (mostly in test/CodeGen/X86/atomics-unordered.ll)..

Previously landed

    D57593 Fix a bug in the definition of isUnordered on MachineMemOperand
    D57596 [CodeGen] Be conservative about atomic accesses as for volatile
    D57802 Be conservative about unordered accesses for the moment
    rL353959: [Tests] First batch of cornercase tests for unordered atomics.
    rL353966: [Tests] RMW folding tests w/unordered atomic operations.
    rL353972: [Tests] More unordered atomic lowering tests.
    rL353989: [SelectionDAG] Inline a single use helper function, and remove last non-MMO interface
    rL354740: [Hexagon, SystemZ] Be super conservative about atomics
    rL354800: [Lanai] Be super conservative about atomics
    rL354845: [ARM] Be super conservative about atomics

Attention Out of Tree Backend Owners: This patch may break you. If it does, you can use the TLI getMMOFlags hook to restore the MOVolatile to any instruction you need to. (See llvm-dev thread titled "PSA: Changes to how atomics are handled in backends" started Feb 27, 2019.)

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

llvm-svn: 355025
2019-02-27 20:20:08 +00:00
Rong Xu
aa5fe6daf5 Fixed ubsan failures in r355005.
llvm-svn: 355023
2019-02-27 20:01:14 +00:00
Matt Davis
3a2ebb60c0 Revert "[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics."
This reverts commit 5cd5f8f2563395f8767f94604eb4c4bea8dcbea0.
The test passes on linux, but fails on the windows build-bots.

This test failure seems to be a quoting issue between my test and
FileCheck on Windows.  I'm reverting this patch until I can replicate
and fix in my Windows environment.

llvm-svn: 355021
2019-02-27 19:52:02 +00:00
Sanjay Patel
b9abab626a [InstCombine] add tests for add+ext+add; NFC
llvm-svn: 355020
2019-02-27 19:27:45 +00:00
Simon Pilgrim
18a6482a24 [X86][AVX] Pull out some INSERT_SUBVECTOR combines into a combineConcatVectorOps helper. NFCI
A lot of the INSERT_SUBVECTOR combines can be more generally handled as if they have come from a CONCAT_VECTORS node.

I've been investigating adding a CONCAT_VECTORS combine to X86, but this is a much easier first step that avoids the issue of handling a number of pre-legalization issues that I've encountered.

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

llvm-svn: 355015
2019-02-27 18:46:32 +00:00
Matt Davis
28ab235653 [llvm-readobj] Print section type values for unknown sections.
Summary:
This patch displays a hexadecimal section value (Elf_Shdr::sh_type) or section-relative offset when printing unknown sections.

Here is a subset of the output (ignoring the fields following "Type" when dumping an ELF's GNU `--section-headers` table).
Section Headers:
```
  [Nr] Name              Type
  [16] android_rel       LOOS+0x1
  [17] android_rela      LOOS+0x2
  [27] unknown           0x1000: <unknown>
  [28] loos              LOOS+0
  [30] hios              VERSYM
  [31] loproc            LOPROC+0
  [33] hiproc            LOPROC+0xFFFFFFF
  [34] louser            LOUSER+0
  [36] hiuser            LOUSER+0x7FFFFFFF
```

As a comparison, the previous output looked something like the above, but with a blank "Type" field:
```
  [Nr] Name              Type
  [27] unknown
  [28] loos
  [30] hios              VERSYM
  [31] loproc
  [33] hiproc
  [34] louser
  [36] hiuser
```

This fixes PR40773

Reviewers: jhenderson, rupprecht, Bigcheese

Reviewed By: jhenderson, rupprecht, Bigcheese

Subscribers: MaskRay, Bigcheese, srhines, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355014
2019-02-27 18:39:17 +00:00
Alexey Lapshin
e9c55b5947 Attempt to fix buildbot after r354972 [#1]. NFCI.
llvm-svn: 355013
2019-02-27 18:36:46 +00:00
Matt Davis
3d1e0bc097 [llvm-cxxfilt] Re-enable the delimiters test on Windows.
The original intent was to enable this test for Windows; however, that
initial patch broke one of the build-bots.  I temporarily disabled this
test on Windows until that issue was resolved.  It was resolved in my
previous patch (cfd1d9742ee2d1b8dd6b7), and now I am re-enabling this
test.

llvm-svn: 355011
2019-02-27 18:04:21 +00:00
Matt Davis
a1ede46340 Clean up the delimiters test.
Ideally this is a NFCI, used single quotes in most cases.  Hopefully
this will make the Windows bot happy.

I've marked this unsupported on windows, until I get my windows box
setup with this patch to test.  I'll remove that constraint after I'm
confident this will pass on windows.  I just want to silence the
buildbots for now.

llvm-svn: 355007
2019-02-27 17:39:36 +00:00
Rong Xu
d2acd4c4e2 Recommit r354930 "[PGO] Context sensitive PGO (part 1)"
Fixed UBSan failures.

llvm-svn: 355005
2019-02-27 17:24:33 +00:00
James Henderson
2ee55aaff5 [llvm-readobj]Add additional testing for various ELF features
This patch adds testing of areas of the code that are not fully tested,
in particular dynamic table printing, ELF type printing, handling of
edge cases where things are missing/empty (relocations/program header
tables/section header table), and the --string-dump switch.

Reviewed by: grimar, higuoxing, rupprecht

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

llvm-svn: 355003
2019-02-27 16:41:59 +00:00
Xing GUO
7e671b7580 [llvm-objdump] Should print strings when dumping DT_RPATH, DT_RUNPATH, DT_SONAME, DT_AUXILIARY and DT_FILTER tags in dynamic section.
Summary:
Before:
```
Dynamic Section:
  NEEDED               libpthread.so.0
  ...
  NEEDED               ld-linux-x86-64.so.2
  RPATH                0x00000000001c2e61
```

After:
```
Dynamic Section:
  NEEDED               libpthread.so.0
  ...
  NEEDED               ld-linux-x86-64.so.2
  RPATH                $ORIGIN/../lib
```

Only a small problem here, I have no idea on choosing test case. I see there's a test 
file(test/tools/llvm-objdump/private-headers-dynamic-section.test). But it has no DT_RPATH and DT_RUNPATH tags. Shall I replace the ELF file in the 
Inputs dir by a new one?

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: srhines, rupprecht, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 355001
2019-02-27 16:37:15 +00:00
Matt Davis
2fdce41eaf [llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics.
Summary:
This patch attempts to replicate GNU c++-filt behavior when splitting stdin input for demangling.

Previously, cxx-filt would split input only on spaces.  Each delimited item is then demangled.
From what I have tested, GNU c++filt also splits input on any character that does not make
up the mangled name (notably commas, but also a large set of non-alphanumeric characters).

This patch splits stdin input on any character that does not belong to the Itanium mangling
format (since Itanium is currently the only supported format in llvm-cxxfilt).

This is an update to PR39990

Reviewers: jhenderson, tejohnson, compnerd

Reviewed By: compnerd

Subscribers: erik.pilkington, llvm-commits

Tags: #llvm

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

llvm-svn: 354998
2019-02-27 16:29:50 +00:00
Nikita Popov
bce66c8454 [InstCombine] Add additional add.sat overflow tests; NFC
Baseline for D58593.

llvm-svn: 354996
2019-02-27 16:18:29 +00:00
Sanjay Patel
b66ca2fdfe [InstCombine] regenerate complete checks; NFC
llvm-svn: 354993
2019-02-27 15:59:30 +00:00
Nico Weber
571b1cee18 gn build: Merge r354989
llvm-svn: 354991
2019-02-27 15:46:51 +00:00
Nico Weber
cf711aa9cc gn build: Merge r354692
llvm-svn: 354987
2019-02-27 15:29:14 +00:00
Eugene Leviant
02f300e1b3 [DebugInfo] Apply subprogram attributes on behalf of owner CU
When using full LTO it is possible that template function definition DIE
is bound to one compilation unit and it's declaration to another. We should
add function declaration attributes on behalf of its owner CU otherwise
we may end up with malformed file identifier in function declaration 
DW_AT_decl_file attribute.

Differential revision: https://reviews.llvm.org/D58538

llvm-svn: 354978
2019-02-27 14:46:59 +00:00