1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

200003 Commits

Author SHA1 Message Date
Ayal Zaks
d95ae6ff42 [LV] Fixing versioning-for-unit-stide of loops with small trip count
This patch fixes D81345 and PR46652.

If a loop with a small trip count is compiled w/o -Os/-Oz, Loop Access Analysis
still generates runtime checks for unit strides that will version the loop.

In such cases, the loop vectorizer should either re-run the analysis or bail-out
from vectorizing the loop, as done prior to D81345. The latter is applied for
now as the former requires refactoring.

Differential Revision: https://reviews.llvm.org/D83470
2020-07-12 19:51:47 +03:00
Yonghong Song
6a24cf643b BPF: permit .maps section variables with typedef type
Currently, llvm when see a global variable in .maps section,
it ensures its type must be a struct type. Then pointee
will be further evaluated for the structure members.
In normal cases, the pointee type will be skipped.

Although this is what current all bpf programs are doing,
but it is a little bit restrictive. For example, it is legitimate
for users to have:
typedef struct { int key_size; int value_size; } __map_t;
__map_t map __attribute__((section(".maps")));

This patch lifts this restriction and typedef of
a struct type is also allowed for .maps section variables.
To avoid create unnecessary fixup entries when traversal
started with typedef/struct type, the new implementation
first traverse all map struct members and then traverse
the typedef/struct type. This way, in internal BTFDebug
implementation, no fixup entries are generated.

Two new unit tests are added for typedef and const
struct in .maps section. Also tested with kernel bpf selftests.

Differential Revision: https://reviews.llvm.org/D83638
2020-07-12 09:42:25 -07:00
Nikita Popov
efae740eca [SCCP] Extend nonnull metadata test (NFC) 2020-07-12 17:48:32 +02:00
Fangrui Song
976154adb1 [AVRInstPrinter] printOperand: support llvm-objdump --print-imm-hex
Differential Revision: https://reviews.llvm.org/D83634
2020-07-12 08:14:52 -07:00
Sanjay Patel
9bc8c780ab [DAGCombiner] tighten fast-math constraints for fma fold
fadd (fma A, B, (fmul C, D)), E --> fma A, B, (fma C, D, E)

This is only allowed when "reassoc" is present on the fadd.

As discussed in D80801, this transform goes beyond
what is allowed by "contract" FMF (-ffp-contract=fast).
That is because we are fusing the trailing add of 'E' with a
multiply, but without "reassoc", the code mandates that the
products A*B and C*D are added together before adding in 'E'.

I've added this example to the LangRef to try to clarify the
meaning of "contract". If that seems reasonable, we should
probably do something similar for the clang docs because
there does not appear to be any formal spec for the behavior
of -ffp-contract=fast.

Differential Revision: https://reviews.llvm.org/D82499
2020-07-12 08:51:49 -04:00
Nikita Popov
55e235a8c2 [SCCP] Add test for predicate info condition handling (NFC) 2020-07-12 10:13:10 +02:00
Zequan Wu
9ad013cc26 [COFF] Fix endianness of .llvm.call-graph-profile section data 2020-07-11 20:49:26 -07:00
Fangrui Song
53847710af [llvm-objdump][test] Move tests after dc4a6f5db4f0178bae43ef615cc8902c759d6195
Move RISCV/ to ELF/RISCV/ as well.
2020-07-11 16:45:05 -07:00
kuter
17613f4737 [Attributor] Introudce attribute seed allow list. 2020-07-12 02:25:33 +03:00
Nikita Popov
4dec471cb4 [NewGVN] Regenerate test checks (NFC) 2020-07-11 22:51:49 +02:00
Craig Topper
600c534edd [X86] Add test cases for missed opportunities to use vpternlog due to a bitcast between the logic ops.
These test cases fail to use vpternlog because the AND was converted
to a blend shuffle and then converted back to AND during shuffle lowering.
This results in the AND having a different type than it started with.
This prevents our custom matching logic from seeing the two logic ops.
2020-07-11 12:54:52 -07:00
Stephen Neuendorffer
83b719e51a [examples] fix ExceptionDemo
Code didn't compile in a release build.  Guard debug output with
ifndef NDEBUG.

Differential Revision: https://reviews.llvm.org/D83628
2020-07-11 12:38:27 -07:00
clementval
dbcd329511 [openmp] Remove unused variable in DirectiveEmitter 2020-07-11 12:59:52 -04:00
Valentin Clement
948efbf02a [flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.

Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert

Reviewed By: DavidTruby, ichoyjx

Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83326
2020-07-11 12:45:12 -04:00
Michael Liao
4a408fa6df Fix -Wunused-variable warnings. NFC. 2020-07-11 10:09:44 -04:00
Michael Liao
45cca1d233 [fix-irreducible] Skip unreachable predecessors.
Summary:
- Skip unreachable predecessors during header detection in SCC. Those
  unreachable blocks would be generated in the switch lowering pass in
  the corner cases or other frontends. Even though they could be removed
  through the CFG simplification, we should skip them during header
  detection.

Reviewers: sameerds

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83562
2020-07-11 10:08:44 -04:00
sstefan1
caec1590a9 [Attributor][NFC] Add more debug output for deleted functions 2020-07-11 14:26:08 +02:00
Christudasan Devadasan
db7117ba2f [AMDGPU] Move LowerSwitch pass to CodeGenPrepare.
It is possible that LowerSwitch pass leaves certain blocks
unreachable from the entry. If not removed, these dead blocks
can cause undefined behavior in the subsequent passes.
It caused a crash in the AMDGPU backend after the instruction
selection when a PHI node has its incoming values coming from
these unreachable blocks.

In the AMDGPU pass flow, the last invocation of UnreachableBlockElim
precedes where LowerSwitch is currently placed and eventually
missed out on the opportunity to get these blocks eliminated.
This patch ensures that LowerSwitch pass get inserted earlier
to make use of the existing unreachable block elimination pass.

Reviewed By: sameerds, arsenm

Differential Revision: https://reviews.llvm.org/D83584
2020-07-11 16:33:38 +05:30
Alexey Lapshin
41bc04e972 [TRE] allow TRE for non-capturing calls.
The current implementation of Tail Recursion Elimination has a very restricted
pre-requisite: AllCallsAreTailCalls. i.e. it requires that no function
call receives a pointer to local stack. Generally, function calls that
receive a pointer to local stack but do not capture it - should not
break TRE. This fix allows us to do TRE if it is proved that no pointer
to the local stack is escaped.

Reviewed by: efriedma

Differential Revision: https://reviews.llvm.org/D82085
2020-07-11 14:01:48 +03:00
Roman Lebedev
1cdc1c81a0 Revert "Reland "[InstCombine] Lower infinite combine loop detection thresholds"""
And there's a new hit: https://bugs.llvm.org/show_bug.cgi?id=46680
This reverts commit 7103c87596efccd532e9fe04a6ba6a200fed8481.
2020-07-11 13:53:24 +03:00
Nico Weber
4ae0689f8c [gn build] (manually) merge 943660fd15f193 2020-07-11 06:44:28 -04:00
Nathan James
de6c03fab8 Reland Fix gn build after 943660f 2020-07-11 11:42:05 +01:00
Nathan James
599f7977e5 Revert "Fix gn builds after 943660fd1"
This reverts commit 4abdcdb45ee22d77dd64a71cb41e967d35361280.
2020-07-11 10:45:17 +01:00
Nathan James
23b5813b04 Fix gn builds after 943660fd1 2020-07-11 10:42:57 +01:00
Johannes Doerfert
702a5efb08 [OpenMP][FIX] remove unused variable and long if-else chain
MSVC throws an error if you use "too many" if-else in a row:
  `Frontend/OpenMP/OMPKinds.def(570): fatal error C1061: compiler limit:
    blocks nested too deeply`
We work around it now...
2020-07-11 02:37:57 -05:00
Mehdi Amini
c61125c80f Remove unused variable KMPC_KERNEL_PARALLEL_WORK_FN_PTR_ARG_NO (NFC)
This fixes a compiler warning.
2020-07-11 07:17:28 +00:00
Johannes Doerfert
ffc35aabd8 [OpenMP] Replace function pointer uses in GPU state machine
In non-SPMD mode we create a state machine like code to identify the
parallel region the GPU worker threads should execute next. The
identification uses the parallel region function pointer as that allows
it to work even if the kernel (=target region) and the parallel region
are in separate TUs. However, taking the address of a function comes
with various downsides. With this patch we will identify the most common
situation and replace the function pointer use with a dummy global
symbol (for identification purposes only). That means, if the parallel
region is only called from a single target region (or kernel), we do not
use the function pointer of the parallel region to identify it but a new
global symbol.

Fixes PR46450.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D83271
2020-07-11 01:44:00 -05:00
Johannes Doerfert
adecc61a3b [OpenMP] Compute a proper module slice for the CGSCCC pass
The module slice describes which functions we can analyze and transform
while working on an SCC as part of the CGSCC OpenMPOpt pass. So far, we
simply restricted it to the SCC. In a follow up we will need to have a
bigger scope which is why this patch introduces a proper identification
of the module slice. In short, everything that has a transitive
reference to a function in the SCC or is transitively referenced by one
is fair game.

Reviewed By: sstefan1

Differential Revision: https://reviews.llvm.org/D83270
2020-07-11 01:44:00 -05:00
Johannes Doerfert
352427d848 [OpenMP] Identify GPU kernels (aka. OpenMP target regions)
We now identify GPU kernels, that is entry points into the GPU code.
These kernels (can) correspond to OpenMP target regions. With this patch
we identify and on request print them via remarks.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D83269
2020-07-11 01:44:00 -05:00
Johannes Doerfert
e94fa3f52a [OpenMP][NFC] Add convenient helper and early exit check 2020-07-11 00:51:51 -05:00
Johannes Doerfert
88791ed7cc [OpenMP][NFC] Fix some typos 2020-07-11 00:51:51 -05:00
Johannes Doerfert
1cd25fd17a [OpenMP][NFC] Remove unused (always fixed) arguments
There are various runtime calls in the device runtime with unused, or
always fixed, arguments. This is bad for all sorts of reasons. Clean up
two before as we match them in OpenMPOpt now.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D83268
2020-07-11 00:51:51 -05:00
Wang, Pengfei
87a74f65a7 [X86][MMX] Optimize MMX shift intrinsics.
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D83534
2020-07-11 11:16:23 +08:00
Jinsong Ji
6ef62dfa4a [PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel
P9 is the only one with InstrSchedModel, but we may have more in the
future, we should not hardcoded it to P9, check hasInstrSchedModel
instead.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D83590
2020-07-11 02:24:12 +00:00
Ben Shi
62ed5d949d [RISCV][test] Add a test for (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2) transformation
Reviewed By: lenary, MaskRay

Differential Revision: https://reviews.llvm.org/D83159
2020-07-10 18:33:12 -07:00
Thomas Lively
de452e6c93 [WebAssembly] Prefer v128.const for constant splats
In BUILD_VECTOR lowering, we used to generally prefer using splats
over v128.const instructions because v128.const has a very large
encoding. However, in d5b7a4e2e8 we switched to preferring consts
because they are expected to be more efficient in engines. This patch
updates the ISel patterns to match this current preference.

Differential Revision: https://reviews.llvm.org/D83581
2020-07-10 18:27:52 -07:00
Valentin Clement
bd935d0ccb [openmp] Fix warning in generated OMP.cpp 2020-07-10 21:13:12 -04:00
sstefan1
50ffa1ab38 Reland "[OpenMPOpt] ICV Tracking"
This reverts commit 1d542f0ca83fa1411d6501a8d088450d83abd5b8.

`recollectUses()` is added to prevent looking at dead uses after
Attributor run.

This is the first and most basic ICV Tracking implementation. For this
first version, we only support deduplication within the same BB.

Reviewers: jdoerfert, JonChesterfield, hamax97, jhuber6, uenoku,
baziotis, lebedev.ri

Differential Revision: https://reviews.llvm.org/D81788
2020-07-11 02:25:57 +02:00
Sanjay Patel
363c09f98d [InstSimplify] add tests for maxnum (PR46627); NFC 2020-07-10 20:20:38 -04:00
Valentin Clement
c8e18392c8 [openmp] Remove OMPConstants.cpp and replace it by OMP.cpp generated by tablegen
Summary:
Diff D83176 moved the last piece of code from OMPConstants.cpp and now this file was only
useful to include the tablegen generated file. This patch replace OMPConstants.cpp with OMP.cpp
generated by tablegen.

Reviewers: sstefan1, jdoerfert, jdenny

Reviewed By: sstefan1

Subscribers: mgorny, yaxunl, hiraditya, guansong, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83583
2020-07-10 20:11:57 -04:00
Zequan Wu
3601df5ad2 [COFF] Add cg_profile directive and .llvm.call-graph-profile section
Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83597
2020-07-10 17:07:30 -07:00
Teresa Johnson
048d5c03ed [BPI] Compile time improvement when erasing blocks (NFC)
Summary:
eraseBlock is trying to erase all probability info for the given BB.
This info is stored in a DenseMap organized like so:
   using Edge = std::pair<const BasicBlock *, unsigned>;
   DenseMap<Edge, BranchProbability> Probs;
where the unsigned in the Edge key is the successor id.

It was walking through every single map entry, checking if the BB in the
key's pair matched the given BB. Much more efficient is to do what
another method (getEdgeProbability) was already doing, which is to walk
the successors of the BB, and simply do a map lookup on the key formed
from each <BB, successor id> pair.

Doing this dropped the overall compile time for a file containing a
very large function by around 32%.

Reviewers: davidxl, xur

Subscribers: llvm-commits, hiraditya

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83596
2020-07-10 16:55:54 -07:00
Alexandre Ganea
705079ab21 Revert "Re-land [CodeView] Add full repro to LF_BUILDINFO record"
This reverts commit add59ecb34e3003311b7e2318b16a0ef10c76d79 and 41d2813a5faea1c18b7d329109e0287c5cd9ffea.
2020-07-10 19:46:16 -04:00
David Blaikie
5518644f63 Remove unnecessary/erroneous "static" from function templates in headers
This risks ODR violations in inline functions that call these functions
(if they remain static) & otherwise just causes some object size
increase, potentially, by these functions not being deduplicated by the
linker.
2020-07-10 16:23:33 -07:00
JF Bastien
eeaec0b209 [docs] LLVM Security Group and Process
Summary:
See the corresponding RFC on llvm-dev for a discussion of this proposal.
  http://lists.llvm.org/pipermail/llvm-dev/2019-November/136839.html

Subscribers: jkorous, dexonsmith, arphaman, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70326
2020-07-10 15:24:02 -07:00
Eric Christopher
206e1bb811 Temporarily revert "[NFC] Separate bitcode reading for FUNC_CODE_INST_CMPXCHG(_OLD)"
as it wasn't NFC and is causing issues with thinlto bitcode reading.

I've followed up offline with reproduction instructions and testcases.

This reverts commit 30582457b47004dec8a78144abc919a13ccbd08c.
2020-07-10 15:21:00 -07:00
Matt Arsenault
e36234a636 AMDGPU: Remove .value_type from kernel metadata
This doesn't appear used for anything, and is emitted incorrectly
based on the description. This also depends on the IR type, and
pointee element type.
2020-07-10 18:16:31 -04:00
Craig Topper
109a838777 [X86] Add isel patterns for matching broadcast vpternlog if the ternlog and the broadcast have different types. 2020-07-10 15:15:02 -07:00
Joel E. Denny
45343bf20f [FileCheck] Fix up -dump-input* docs
In FileCheck.rst, add `-dump-input-context` and `-dump-input-filter`,
and fix some `-dump-input` documentation.

In `FileCheck -help`, `cl::value_desc("kind")` is being ignored for
`-dump-input-filter`, so just drop it.

Extend `-dump-input=help` to mention FILECHECK_OPTS.
2020-07-10 17:21:01 -04:00
Arthur Eubanks
7de3fd6948 Reland [NFC] Derive from PassInfoMixin for no-op/printing passes
PassInfoMixin should be used for all NPM passes, rater than a custom
`name()`.

This caused ambiguous references in LegacyPassManager.cpp, so had to
remove "using namespace llvm::legacy" and move some things around.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D83498
2020-07-10 12:51:28 -07:00