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

207017 Commits

Author SHA1 Message Date
Nikita Popov
86fecd5fbf [BasicAA] Generalize base offset modulus handling
The GEP aliasing implementation currently has two pieces of code
that solve two different subsets of the same basic problem: If you
have GEPs with offsets 4*x + 0 and 4*y + 1 (assuming access size 1),
then they do not alias regardless of whether x and y are the same.

One implementation is in aliasSameBasePointerGEPs(), which looks at
this in a limited structural way. It requires both GEP base pointers
to be exactly the same, then (optionally) a number of equal indexes,
then an unknown index, then a non-equal index into a struct. This
set of limitations works, but it's overly restrictive and hides the
core property we're trying to exploit.

The second implementation is part of aliasGEP() itself and tries to
find a common modulus in the scales, so it can then check that the
constant offset doesn't overlap under modular arithmetic. The second
implementation has the right idea of what the general problem is,
but effectively only considers power of two factors in the scales
(while aliasSameBasePointerGEPs also works with non-pow2 struct sizes.)

What this patch does is to adjust the aliasGEP() implementation to
instead find the largest common factor in all the scales (i.e. the GCD)
and use that as the modulus.

Differential Revision: https://reviews.llvm.org/D91027
2020-11-18 21:48:49 +01:00
Arthur Eubanks
cae85631c4 [test] Fix eliminate-callsite-inline.ll under NPM
The NPM inliner does not remove arbitrary unused internal functions, and
that is not the point of this test.
2020-11-18 12:39:39 -08:00
Arthur Eubanks
90c9229761 [test] Fix remaining GVN tests under NPM
Some used analyses are optional but were relied upon in tests, the
legacy PM runs them in a different order than the NPM.
2020-11-18 12:35:32 -08:00
Jamie Schmeiser
c75ab9daaf Revert "Revert "Expand existing loopsink testing to also test loopsinking using new pass manager and fix LICM bug.""
This reverts commit 562addba652e8bdabe49f9123fd92c21b7a0d640.

Reverted change too quickly, the failing test cases passed on the next build.
So reverting revert (to include the changes).
2020-11-18 15:33:02 -05:00
Florian Hahn
8799552d28 [ConstraintElimination] Decompose add nuw/sub nuw.
Make use of the more flexible constraint handling added in
a8a79c90699a7ae9dee07daf7281cbbd592bf6ea to decompose add nuw/sub nuw.
2020-11-18 20:29:30 +00:00
Joseph Huber
93f603ff82 [OpenMP] Add Passing in Original Declaration Names To Mapper API
Summary:
This patch adds support for passing in the original delcaration name in the source file to the libomptarget runtime. This will allow the runtime to provide more intelligent debugging messages. This patch takes the original expression parsed from the OpenMP map / update clause and provides a textual representation if it was explicitly mapped, otherwise it takes the name of the variable declaration as a fallback. The information in passed to the runtime in a global array of strings that matches the existing ident_t source location strings using ";name;filename;column;row;;"

Reviewers: jdoerfert

Differential Revision: https://reviews.llvm.org/D89802
2020-11-18 15:28:39 -05:00
Nikita Popov
4436338d6f [Inline] Fix incorrectly dropped noalias metadata
This is the same fix as 23aeadb89df38406dc4d929d08286f7ce31040eb,
just for CloneScopedAliasMetadata rather than PropagateCallSiteMetadata.

In this case the previous outcome was incorrectly dropped metadata,
as it was not part of the computed metadata map.

The real change in the test is that the first load now retains
metadata, the rest of the changes are due to changes in metadata
numbering.
2020-11-18 21:22:50 +01:00
Nikita Popov
bf413bfc75 [Inline] Expand test to show dropped metadata (NFC)
The metadata from the %c load gets dropped.
2020-11-18 21:22:50 +01:00
Jamie Schmeiser
0d517a7834 Revert "Expand existing loopsink testing to also test loopsinking using new pass manager and fix LICM bug."
This reverts commit d4ba28bddc89a14885218b9eaa4fbf6654c2a5bd.
2020-11-18 15:17:53 -05:00
Nikita Popov
3912b90160 [Inline] Fix incorrect noalias metadata application (PR48209)
The VMap also contains a mapping from Argument => Instruction,
where the instruction is part of the original function, not the
inlined one. The code was assuming that all the instructions in
the VMap were inlined.

This was a pre-existing problem for the loop access metadata, but
was extended to the more common noalias metadata by
27f647d117087ca11959e232e6443f4aee31e966, thus causing miscompiles.

There is a similar assumption inside CloneAliasScopeMetadata(), so
that one likely needs to be fixed as well.
2020-11-18 20:52:58 +01:00
Nikita Popov
16c81c015e [Inline] Add test for PR48209 (NFC)
The test shows noalias metadata being incorrectly applied to the
instruction producing the argument for the call.
2020-11-18 20:52:58 +01:00
Jamie Schmeiser
00f5bd854a Expand existing loopsink testing to also test loopsinking using new pass manager and fix LICM bug.
Summary:
Expand existing loopsink testing to also test loopsinking using new pass
manager.  Enable memoryssa for loopsink with new pass manager.  This
combination exposed a bug that was previously fixed for loopsink
without memoryssa.  When sinking an instruction into a loop, the source
block may not be part of the loop but still needs to be checked for
pointer invalidation.  This is the fix for bugzilla #39695 (PR 54659)
expanded to also work with memoryssa.

Respond to review comments.  Enable Memory SSA in legacy Loop Sink pass
under EnableMSSALoopDependency option control.  Update tests accordingly.

Respond to review comments.  Add options controlling whether memoryssa is
used for loop sink, defaulting to off.  Expand testing based on these
options.

Respond to review comments.  Properly indicated preserved analyses.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: asbirlea (Alina Sbirlea)
Differential Revision: https://reviews.llvm.org/D90249
2020-11-18 14:08:42 -05:00
Nikita Popov
4d1322fde5 [BasicAA] Remove assert in AA evaluator
As reported in https://reviews.llvm.org/D91383#2401825, this
assert breaks external -aa-eval tests. We'll have to fix this
case before re-enabling it.
2020-11-18 20:04:38 +01:00
serge-sans-paille
be3f7186d3 Revert "[build] normalize components dependencies"
This reverts commit c6ef6e1690d517b3401ea06b1fe46871eb67434d.

Basically, publicly linked libraries have a different semantic than components,
which link libraries privately.

Differential Revision: https://reviews.llvm.org/D91461
2020-11-18 19:23:11 +01:00
Roman Lebedev
4874abfaf5 [NFC][LoopIdiom] Left-shift-until-bittest: revisit test coverage 2020-11-18 21:22:27 +03:00
Simon Moll
fbd7b71546 [VP] Non-signalling llvm.vp.* intrinsics are speculatable
This is specifically required by the upcoming ExpandVectorPredication
pass (D78203) to recognize llvm.vp.* intrinsics that may ignore their
predicates.
2020-11-18 18:46:09 +01:00
Sebastian Neubauer
b2e2c9e859 [AMDGPU] Fix v3f16 interaction with image store workaround
In some cases, the wrong amount of registers was reserved.

Also enable more v3f16 tests.

Differential Revision: https://reviews.llvm.org/D90847
2020-11-18 18:21:04 +01:00
Simon Pilgrim
2010e696b2 HazardRecognizer - Fix definition/declaration argument name mismatches. NFCI.
Consistently use SUnit *SU (or drop the argname entirely if not used like the other HazardRecognizer methods).

Silences cppcheck warnings.
2020-11-18 16:50:52 +00:00
Nico Weber
a121181074 lld: Make tests depend on llvm-symbolizer after bc98034040
Fixes test failures when building just `check-lld` in a clean build dir.
2020-11-18 11:43:44 -05:00
Mikhail Goncharov
0bee7df5c5 [llvm] fix global_downgraded_to_static test
after 9aa789820027 https://reviews.llvm.org/D90930
2020-11-18 17:22:02 +01:00
Gaurav Jain
025b28cffd [NFC] Use [MC]Register for Hexagon target
Differential Revision: https://reviews.llvm.org/D91160
2020-11-18 08:17:07 -08:00
Piotr Sobczak
ae308bcfcd SpeculativeExecution: Allow speculating more instruction types
Support more instructions in SpeculativeExecution pass:
- ExtractValue
- InsertValue
- Trunc
- Freeze

Differential Revision: https://reviews.llvm.org/D91688
2020-11-18 17:00:19 +01:00
Simon Pilgrim
12f6cd08c5 [DAGCombiner] Precommit Sext Tests for D91589
Patch by: @laytonio (Layton Kifer)

Differential Revision: https://reviews.llvm.org/D91671
2020-11-18 15:56:16 +00:00
Jay Foad
8e997b3d9b [AMDGPU] Fix and extend vccz workarounds
We have workarounds for two different cases where vccz can get out of
sync with the value in vcc. This fixes them in two ways:

1. Fix the case where the def of vcc was in a previous basic block, by
pessimistically assuming that vccz might be incorrect at a basic block
boundary.

2. Fix the handling of pre-existing waitcnt instructions by calling
generateWaitcntInstBefore before examining ScoreBrackets to determine
whether there's an outstanding smem read operation.

Differential Revision: https://reviews.llvm.org/D91636
2020-11-18 15:26:06 +00:00
Roman Lebedev
d8e91e816b [Reassociate] Don't convert add-like-or's into add's if they appear to be part of load-combining idiom
As Wei Mi is reporting in post-commit review
  https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201116/853479.html
teaching -reassociate about add-like-or's (70472f3) results in breaking apart
load widening patterns, and reassociating them.

For now, simply exclude any such `or` that appears to be a root of
load widening idiom from the or->add transformation.

Note that the heuristic is greedy, it doesn't ensure that loads
can *actually* be widened into a single load.
2020-11-18 17:55:02 +03:00
Roman Lebedev
9730124eff [NFC][Reassociate] Add patterns where or is part of load reduction idiom
As Wei Mi is reporting in post-commit review:
  https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201116/853479.html
teaching -reassociate about add-like-or's (70472f3) results in breaking apart
load widening patterns, and reassociating them.

While that's great, it prevents the actual load widening in backend,
and that is not good. We should have load widening in middle-end,
but for now we should at least not regress the naive patterns..
2020-11-18 17:55:01 +03:00
Simon Pilgrim
77c3e7b9c4 [X86] Add broadcast merge test case for PR48215 2020-11-18 14:20:02 +00:00
Mikhail Goncharov
b485969c23 Fix unused variables in release build
Differential Revision: https://reviews.llvm.org/D91705
2020-11-18 15:18:31 +01:00
Jay Foad
e94baf4512 [AMDGPU] Rename pseudo S_WAITCNT_IDLE to S_WAIT_IDLE. NFC. 2020-11-18 14:03:43 +00:00
Florian Hahn
1c51c89888 [ConstraintElimination] Refactor constraint extraction (NFC).
This patch generalizes the extraction of a constraint for a given
condition. It allows decompose to return a vector of c * X pairs, which
allows de-composing multiple instructions in the future.

It also adds more clarifying comments.
2020-11-18 13:59:18 +00:00
Jonas Paulsson
50b75f3de0 [SystemZ] Use ISD::ABS opcode during isel.
The SystemZISD::IABS node is no longer needed since ISD::ABS can be used
instead.

Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D91697
2020-11-18 14:43:55 +01:00
Sam Tebbs
7da19ba615 [ARM][LowOverheadLoops] Merge VCMP and VPST across VPT blocks
This patch adds support for combining a VPST with a dangling VCMP from a
previous VPT block.

Differential Revision: https://reviews.llvm.org/D90935
2020-11-18 12:54:16 +00:00
Benjamin Kramer
73b0c526b6 [SLP] Use the minimum alignment of the load bundle when forming a masked.gather
Instead of the first load. That works when vectorizing contiguous loads,
but not for gathers.

Fixes a miscompile introduced in fcad8d3635cff61a2749dcef94c0d51fa1e3e413.
2020-11-18 12:53:39 +01:00
Max Kazantsev
839adf44ed [IndVars] Support different types of ExitCount when optimizing exit conds
In some cases we can handle IV and iter count of different types. It's a typical situation
after IV have been widened. This patch adds support for such cases, when legal.

Differential Revision: https://reviews.llvm.org/D88528
Reviewed By: skatkov
2020-11-18 18:20:05 +07:00
Jan Svoboda
896eefbaeb [clang][cli] Remove NormalizerRetTy and use the decltype of the KeyPath instead
Depends on D83315

Reviewed By: Bigcheese

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D83406
2020-11-18 11:31:13 +01:00
Esme-Yi
548ee2937f [NFC][POwerPC] Added testcases of constant-i64. 2020-11-18 10:13:16 +00:00
Andrzej Warzynski
1a679fd432 [NFC] Add missing dependency in the IR unittests
This missing dependency has caused build failures when
`BUILD_SHARED_LIBS` is set to `ON`. The breaking change was introduced
here:
  * https://reviews.llvm.org/D91324

Failing buildbot:
  * http://lab.llvm.org:8011/#/builders/66/builds/555
2020-11-18 10:10:44 +00:00
Georgii Rymar
53a457743b Reland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types." (https://reviews.llvm.org/D90930).
This reverts reverting commit fc40a03323a4b265ccbed34a07e281b13c5e8367
and fixes LLD (MachO/wasm) tests that failed previously.
2020-11-18 13:08:46 +03:00
Simon Pilgrim
8697e9b92e [Analysis] CGSCCPassManager.cpp - fix Wshadow warnings. NFCI. 2020-11-18 09:59:31 +00:00
Jan Svoboda
e8d6a91523 [clang][cli] Turn arcmt-* options into a single option
- The new option, -arcmt-action, is a simple enum based option.
- The driver is modified to translate the existing -ccc-acmt-* options accordingly
Depends on D83298

Reviewed By: Bigcheese

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D83315
2020-11-18 10:53:41 +01:00
Georgii Rymar
dfc8211870 Revert "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types."
This reverts commit 65fd17c241e22e1671e81efdb683687369c2feb3.

It breaks LLD/MachO tests that seems use obj2yaml the check the output.
2020-11-18 11:55:03 +03:00
Piotr Sobczak
5a0d2d0e6d SpeculativeExecution: Allow speculating more instruction types
Support more instructions in SpeculativeExecution pass:
- ExtractElement
- InsertElement
- ShuffleVector

Differential Revision: https://reviews.llvm.org/D91633
2020-11-18 09:46:43 +01:00
Georgii Rymar
564d64a6ed [lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types.
When we produce an YAML output, we also print leading zeroes currently.
An output might look like this:

```
- Name:    .dynsym
  Type:    SHT_DYNSYM
  Address: 0x0000000000001000
  EntSize: 0x0000000000000018
```

There are probably no reason to print leading zeroes.
It just makes harder to read values. This patch stops printing them.
The output becomes like:

```
- Name:    .dynsym
  Type:    SHT_DYNSYM
  Address: 0x1000
  EntSize: 0x18
```

This affects obj2yaml mostly, but also dsymutil and llvm-xray tools output.

Differential revision: https://reviews.llvm.org/D90930
2020-11-18 11:31:00 +03:00
Arthur Eubanks
f88bce6fce [test] Make scc-pass-printer.ll work with NPM
Pin some legacy PM specific RUN lines to legacy PM.
2020-11-17 23:53:47 -08:00
Craig Topper
ce7901a517 [X86] Use GF2P8AFFINEQB to implement vector bitreverse.
We can use GF2P8AFFINEQB to reverse bits in a byte. Shuffles are needed to reverse the bytes in elements larger than i8. LegalizeVectorOps takes care of inserting the shuffle for the larger element size.

We already have Custom lowering for v16i8 with SSSE3, v32i8 with AVX, and v64i8 with AVX512BW.

I think we might be able to use this for scalars too by moving into a vector and back. But I'll save that for a follow up as its a little more involved.

Reviewed By: RKSimon, pengfei

Differential Revision: https://reviews.llvm.org/D91515
2020-11-17 23:49:06 -08:00
Arthur Eubanks
03da6635e1 [test] Pin size-remarks.ll to legacy PM
This tests legacy PM specific stuff.
2020-11-17 23:47:49 -08:00
Arthur Eubanks
7b22dbd090 [JumpThreading] Make -print-lvi-after-jump-threading work with NPM 2020-11-17 23:15:20 -08:00
Duncan P. N. Exon Smith
d59bc177d6 ADT: Share an implementation for single-element insert in SmallVector, NFC
Factor out `SmallVectorImple::insert_one_impl`, a common implementation
for `insert(iterator, T&&)` and `insert(iterator, T const&)`. This is
just a clean up and has no functionality change.

Differential Revision: https://reviews.llvm.org/D91674
2020-11-17 21:20:51 -08:00
Arthur Eubanks
8aa150edd0 [DCE] Always get TargetLibraryInfo
I don't see any reason not to unconditionally retrieve TLI, it's fairly
cheap.

Fixes calls-errno.ll under NPM.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D91476
2020-11-17 20:41:05 -08:00
LLVM GN Syncbot
78ab48c03d [gn build] Port 6a89cb8136f 2020-11-18 03:04:01 +00:00