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

195599 Commits

Author SHA1 Message Date
Georgii Rymar
6a22adad8b [yaml2obj] - Change how p_offset is calculated when creating segments. NFCI.
This depends on D78361 and simplifies the computation of the `p_offset`.

Differential revision: https://reviews.llvm.org/D78363
2020-04-22 12:37:44 +03:00
Georgii Rymar
c57ab2a547 [obj2yaml] - Fix the issue with dumping empty sections when dumping program headers.
Imagine we have:

```
ProgramHeaders:
  - Type:  PT_LOAD
    Flags: [ PF_W, PF_R ]
    Sections:
      - Section: .bar
    VAddr: 0x2000
Sections:
  - Name:    .foo
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
    Address: 0x1000
  - Name:    .bar
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
    Address: 0x2000
```

Both `.foo` and `.bar` share the same starting file offset,
but `VA(.foo)` < `VA(PT_LOAD)`, we should not include it into segment.

This patch fixes the issue.

Differential revision: https://reviews.llvm.org/D77652
2020-04-22 12:36:00 +03:00
Sjoerd Meijer
04ed5838a4 [ARM][MVE] Tail-predication: some more comments and debug messages. NFC.
Finding the loop tripcount is the first crucial step in preparing a loop for
tail-predication, and this adds a debug message if a tripcount cannot be found.

And while I was at it, I added some more comments here and there.

Differential Revision: https://reviews.llvm.org/D78485
2020-04-22 10:34:23 +01:00
Jay Foad
3f338fc717 [AMDGPU] Remove obsolete special case for 1024-bit vector types. NFC. 2020-04-22 09:05:24 +01:00
Jay Foad
e3845d5641 [AMDGPU] Simplify definition of VReg and AReg classes. NFC.
Differential Revision: https://reviews.llvm.org/D78553
2020-04-22 08:59:28 +01:00
Sam Parker
ab3eae3e7d [NFC] Test changes
Add some more targets for the ARM cost model tests and add some tests
for icmps and bitcasts.
2020-04-22 08:28:52 +01:00
aartbik
8b6f688ff4 [llvm] [X86] Make test more robust against different builds
Summary:
Rationale:
Using the --debug-only flag requires a debug build. Also, the debug output is not always consistent over different builds.
This change avoids all problems by just testing the generated assembly for AVX.

Reviewers: craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78609
2020-04-22 00:23:46 -07:00
Kazushi (Jam) Marukawa
7bb2a7f47f [VE] Update shift operation instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all shift operation instructions.  This also
corrects instruction's operation kinds.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D78468
2020-04-22 09:10:10 +02:00
Kazushi (Jam) Marukawa
1792929a97 [VE] Add alternative names to registers
Summary:
VE uses identical names "%s0-63" to all generic registers.  Change to use
alternative name mechanism among all generic registers instead of hard-
coding them.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D78174
2020-04-22 09:07:42 +02:00
Craig Topper
bb554c7b77 [CallSite removal] Remove unneeded includes of CallSite.h. NFC 2020-04-22 00:07:13 -07:00
Johannes Doerfert
0f003ab997 [Attributor] Replace AccessKind2Accesses map with an "array map"
The number of different access location kinds we track is relatively
small (8 so far). With this patch we replace the DenseMap that mapped
from index (0-7) to the access set pointer with an array of access set
pointers. This reduces memory consumption.

No functional change is intended.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 472499 (215654/s)
temporary memory allocations: 77794 (35506/s)
peak heap memory consumption: 35.28MB
peak RSS (including heaptrack overhead): 125.46MB
total memory leaked: 269.04KB
```

After:
```
calls to allocation functions: 472270 (308673/s)
temporary memory allocations: 77578 (50704/s)
peak heap memory consumption: 32.70MB
peak RSS (including heaptrack overhead): 121.78MB
total memory leaked: 269.04KB
```

Difference:
```
calls to allocation functions: -229 (346/s)
temporary memory allocations: -216 (326/s)
peak heap memory consumption: -2.58MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

---
2020-04-22 01:35:27 -05:00
Johannes Doerfert
0b6153cc35 [Attributor] Run IRPosition::verify only with EXPENSIVE_CHECKS 2020-04-22 01:35:12 -05:00
Craig Topper
16003666af [CallSite removal][Target] Replace CallSite with CallBase. NFC
In some cases just delete an unneeded include.
2020-04-21 23:29:36 -07:00
Qiu Chaofan
62ef3c111d [PowerPC] Exploit RLDIMI for OR with large immediates
This patch exploits rldimi instruction for patterns like
`or %a, 0b000011110000`, which saves number of instructions when the
operand has only one use, compared with `li-ori-sldi-or`.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D77850
2020-04-22 14:16:52 +08:00
Craig Topper
d86a492ae3 [CallSite removal][TargetTransformInfoImpl] Replace CallSite with CallBase. NFC 2020-04-21 22:49:30 -07:00
Igor Kudrin
5f88b99c30 [DebugInfo] Simplify DWARFUnit::determineStringOffsetsTableContribution(). NFC.
The method is called from only one place and the call is already guarded
by a condition which checks that IsDWO is false.

Differential Revision: https://reviews.llvm.org/D78482
2020-04-22 12:11:17 +07:00
Eli Friedman
c63956f575 [TargetPassConfig] Run MachineVerifier after more passes.
We were disabling verification for no reason in a bunch of places; just
turn it on.

At this point, there are two key places where we don't run verification:
during register allocation, and after addPreEmitPass.  Regalloc probably
isn't worth messing with; it has its own invariants, and verifying
afterwards is probably good enough.  For after addPreEmitPass, it's
probably worth investigating improvements.
2020-04-21 21:05:07 -07:00
Sameer Sahasrabuddhe
20f2dc251d FixIrreducible: don't crash when moving a child loop
Summary:
When an irreducible SCC is converted into a new natural loop, existing
loops included in that SCC now become children of the new loop. The
logic that moves these loops from the parent loop to the new loop
invoked undefined behaviour when it modified the container that it was
iterating over. Fixed this by first extracting all the loops that are
to be removed from the parent.

Fixes bug 45623.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D78544
2020-04-22 07:47:30 +05:30
Andrew Browne
0b9b4fd582 Make SmallVector assert if it cannot grow.
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.

Another alternative to 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 ~4GB.

Reviewers: echristo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77601
2020-04-21 17:53:39 -07:00
LLVM GN Syncbot
85fa188140 [gn build] Port 23609331472 2020-04-21 23:36:07 +00:00
Amy Huang
46a7f5a6dc Reland "Implement some functions in NativeSession." with fixes so that
the tests pass on Linux.

Summary:
This change implements readFromExe, and calculating VA and RVA, which
are some of the functionalities that will be used for native PDB reading
for llvm symbolizer.

bug: https://bugs.llvm.org/show_bug.cgi?id=41795
2020-04-21 16:35:27 -07:00
Mircea Trofin
9d8ecfe68b [llvm][NFC][CallSite] Remove CallSite from FunctionAttrs
Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78584
2020-04-21 16:16:00 -07:00
LLVM GN Syncbot
2fd1216c39 [gn build] Port 352fef3f11f 2020-04-21 21:22:08 +00:00
LLVM GN Syncbot
e202557326 [gn build] Port 060efd24c7f 2020-04-21 21:22:07 +00:00
Amy Huang
7487f3d198 Revert "Implement some NativeSession functions" along with some
followup fixes.

This reverts commits
a6d8a055e92eb4853805d1ad1be0b1a6523524ef
4927ae085807731eb4052e0a682443fe9399b512
1e1f5eb7c978da3b062daaf3c32c459704e65a55
2020-04-21 14:20:13 -07:00
Christopher Tetreault
47b07ad5b9 [SVE] Remove VectorType::getBitWidth()
Summary:
* VectorType::getBitWidth() is just an unsafe version of
getPrimitiveSizeInBits() that assumes all vectors are fixed width.

Reviewers: efriedma, sdesmalen, huntergr, craig.topper

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77833
2020-04-21 13:33:46 -07:00
Johannes Doerfert
6eb54478ab [Attributor] Remove dependence edges eagerly
If we have a dependence between an abstract attribute A to an abstract
attribute B such hat changes in A should trigger an update of B, we do
not need to keep the dependence around once the update was triggered. If
the dependence is still required the update will reinsert it into the
dependence map, if it is not we avoid triggering B in the future. This
replaces the "recompute interval" mechanism we used before to prune
stale dependences.

Number of required iterations is generally down, compile time for the
module pass (not really the CGSCC pass) is down quite a bit.

There is one test change which looks like an artifact in the undefined
behavior AA that needs to be looked at.
2020-04-21 15:22:10 -05:00
Johannes Doerfert
52b98ed84b [Attributor][NFC] Track the number of created AAs in the statistics 2020-04-21 15:22:10 -05:00
Johannes Doerfert
c4a52b9a17 [Attributor][PM] Introduce -attributor-enable={none,cgscc,module,all}
The old command line option `-attributor-disable` was too coarse grained
as we want to measure the effects of the module or cgscc pass without
the other as well.

Since `none` is the default there is no real functional change.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D78571
2020-04-21 15:22:10 -05:00
Johannes Doerfert
2ebd299e0e [Attributor][NFC] Remove obsolete option from tests
Since D76871 it is sufficient to run `opt -atributor` or
`-attributor-cgscc`.
2020-04-21 15:22:10 -05:00
Michael Liao
3102f5a0d5 Fix -Wpedantic warnings. NFC. 2020-04-21 16:09:17 -04:00
Amy Huang
c74fd0c180 [NativeSession] Fix unchecked Expected type
(followup to https://reviews.llvm.org/D78128)
2020-04-21 12:36:55 -07:00
Matt Arsenault
9d35bf6a9c AMDGPU: Use Register 2020-04-21 15:19:35 -04:00
Eli Friedman
6f59ec7d26 [ARM] Fix MIR tests with invalid live-ins.
A register can't be live if it isn't defined; fix issues in various
testcases.

Differential Revision: https://reviews.llvm.org/D78529
2020-04-21 12:13:35 -07:00
Eli Friedman
a8ca298c3c [AArch64] Fix MIR tests with invalid live-ins.
A register can't be live if it isn't defined; fix issues in various
testcases.

Differential Revision: https://reviews.llvm.org/D78531
2020-04-21 12:13:32 -07:00
Michael Liao
626ccbc573 Fix -Wparentheses warnings. NFC. 2020-04-21 15:02:59 -04:00
Fangrui Song
80f1762659 [XRay] xray_fn_idx: set SHF_WRITE to avoid text relocations
In a future change we should properly fix xray_fn_idx to use PC-relative
addresses as well, but for now let's keep absolute addresses until sled
addresses are all fixed.
2020-04-21 12:02:29 -07:00
Roman Lebedev
b6333cc946 [InstCombine] Negator - sink sinkable negations
Summary:
As we have discussed previously (e.g. in D63992 / D64090 / [[ https://bugs.llvm.org/show_bug.cgi?id=42457 | PR42457 ]]), `sub` instruction
can almost be considered non-canonical. While we do convert `sub %x, C` -> `add %x, -C`,
we sparsely do that for non-constants. But we should.

Here, i propose to interpret `sub %x, %y` as `add (sub 0, %y), %x` IFF the negation can be sinked into the `%y`

This has some potential to cause endless combine loops (either around PHI's, or if there are some opposite transforms).
For former there's `-instcombine-negator-max-depth` option to mitigate it, should this expose any such issues
For latter, if there are still any such opposing folds, we'd need to remove the colliding fold.
In any case, reproducers welcomed!

Reviewers: spatel, nikic, efriedma, xbolva00

Reviewed By: spatel

Subscribers: xbolva00, mgorny, hiraditya, reames, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68408
2020-04-21 22:00:23 +03:00
Michael Liao
45866e6621 Fix build. NFC. 2020-04-21 14:59:45 -04:00
Fangrui Song
312f303b26 [PDB] Change llvm/object/COFF.h to llvm/Object/COFF.h after D78128 2020-04-21 11:54:05 -07:00
Amy Huang
ae87806c29 Implement some functions in NativeSession.
Summary:
This change implements readFromExe, and calculating VA and RVA, which
are some of the functionalities that will be used for native PDB reading
for llvm symbolizer.

bug: https://bugs.llvm.org/show_bug.cgi?id=41795

Reviewers: hans, amccarth, rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78128
2020-04-21 11:48:40 -07:00
Benjamin Kramer
f0aed43927 Bit-pack some pairs. No functionlity change intended. 2020-04-21 20:40:20 +02:00
Fangrui Song
47ac02d8c8 [CallSite] Fix build breakage after D78538 2020-04-21 11:33:40 -07:00
Sanjay Patel
39ea45de0b [Analysis] recognize the 'null' pointer constant as not poison
Differential Revision: https://reviews.llvm.org/D78575
2020-04-21 14:23:06 -04:00
Sanjay Patel
e047599624 [InstCombine] add tests for logic-of-icmps; NFC 2020-04-21 14:23:05 -04:00
aartbik
4340698ffa [llvm] [X86] Fixed type bug in vselect for AVX masked load
Summary:
Bugzilla issue 45563
https://bugs.llvm.org/show_bug.cgi?id=45563

Reviewers: nicolasvasilache, mehdi_amini, craig.topper

Reviewed By: craig.topper

Subscribers: RKSimon, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78527
2020-04-21 11:11:35 -07:00
Mircea Trofin
f122c28571 [llvm][NFC][CallSite] Remove CallSite from DeadArgumentElimination
Summary: Also capitalized some induction variables, to match coding style.

Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78538
2020-04-21 10:48:38 -07:00
Simon Pilgrim
b5d13acb69 [Transforms] getOrEnforceKnownAlignment - fix MSVC result of 32-bit shift implicitly converted to 64 bits warning. NFCI
We don't overflow here so we can use a U64 shift directly.
2020-04-21 18:32:12 +01:00
Pavel Iliin
5403bb4617 [AArch64] FMLA/FMLS patterns improvement.
FMLA/FMLS f16 indexed patterns added.
Fixes https://bugs.llvm.org/show_bug.cgi?id=45467
Removed redundant v2f32 vector_extract indexed pattern since
Instruction Selection is able to match v4f32 instead.
2020-04-21 18:23:21 +01:00
Roman Lebedev
d54de329dc [NFC][InstCombine] sub-of-negatible.ll: some more test cases 2020-04-21 20:14:09 +03:00