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

203969 Commits

Author SHA1 Message Date
Hamilton Tobon Mosquera
178800adfb [OpenMPOpt] Refactored "issue" and "wait" declarations for data map runtime call.
Refactored __tgt_target_data_begin_mapper_<issue|wait> to receive the handle as an input/output argument.
This given the compiler warning of returning the handle as copy.

Differential Revision: https://reviews.llvm.org/D88029
2020-09-22 10:50:17 -05:00
Arthur Eubanks
6d75c366ed [DI][ASan][NewPM] Fix some DebugInfo ASan tests under NPM 2020-09-22 08:28:54 -07:00
Alexandre Ganea
09fd7108ad [ThinLTO] Re-order modules for optimal multi-threaded processing
Re-use an optimizition from the old LTO API (used by ld64).
This sorts modules in ascending order, based on bitcode size, so that larger modules are processed first. This allows for smaller modules to be process last, and better fill free threads 'slots', and thusly allow for better multi-thread load balancing.

In our case (on dual Intel Xeon Gold 6140, Windows 10 version 2004, two-stage build), this saves 15 sec when linking `clang.exe` with LLD & `-flto=thin`, `/opt:lldltojobs=all`, no ThinLTO cache, -DLLVM_INTEGRATED_CRT_ALLOC=d:\git\rpmalloc.

Before patch: 102 sec
After patch: 85 sec

Inspired by the work done by David Callahan in D60495.

Differential Revision: https://reviews.llvm.org/D87966
2020-09-22 11:25:59 -04:00
Arthur Eubanks
ac65fcae49 [GVNSink][NewPM] Add GVNSinkPass to PassRegistry.def 2020-09-22 08:24:09 -07:00
Florian Hahn
f248f61115 [VPlan] Add dump() helper to VPValue & VPRecipeBase.
This provides a convenient way to print VPValues and recipes in a
debugger. In particular it saves the user from instantiating
VPSlotTracker to print recipes or values.
2020-09-22 15:55:16 +01:00
Michael Liao
43a4d1cdda [PeepholeOptimizer] Enhance the redundant COPY elimination.
- Eliminate redundant COPYs from the same register & subregister pair.

Differential Revision: https://reviews.llvm.org/D87939
2020-09-22 10:11:37 -04:00
Simon Pilgrim
f0dc47fc06 [X86] Add missing namespace closure comments. NFCI.
Fixes some clang-tidy llvm-namespace-comment warnings.
2020-09-22 15:06:59 +01:00
Simon Pilgrim
f735dd1bec [X86] Cleanup/add namespace closure comments. NFCI.
Fixes some clang-tidy llvm-namespace-comment warnings.
2020-09-22 15:06:58 +01:00
Stefan Pintilie
12f9b13618 [PowerPC] Fix for compiler side issue in PCRelative Local Exec
Stop combining loads and stores with PPCISD::ADD_TLS before we can merge the
node with with TLS_LOCAL_EXEC_MAT_ADDR. The issue is that
TLS_LOCAL_EXEC_MAT_ADDR cannot be selected by itself and requires the previous
ADD_TLS node that goes with it. However, we sometimes try to combine ADD_TLS
with loads and stores that come after it. If this happens then the ADD_TLS is
removed and TLS_LOCAL_EXEC_MAT_ADDR cannot be selected.

While this bug fix will address the issue it my not be ideal from a performance
perspective as we may be able to add patterns to combine TLS_LOCAL_EXEC_MAT_ADDR
with ADD_TLS with the load and store that comes after it all in one. However,
this is beyond the scope of this patch.

Reviewed By: NeHuang

Differential Revision: https://reviews.llvm.org/D88030
2020-09-22 08:28:06 -05:00
Sanjay Patel
db9cccedfd [SLP] reduce code duplication for checking parent block; NFC 2020-09-22 09:21:20 -04:00
Sanjay Patel
87c6ed7e4f [SLP] move misplaced code comments; NFC 2020-09-22 09:21:20 -04:00
Sanjay Patel
207c01f738 [SLP] clean up code in gather(); NFC
1. Use range for-loop to avoid repeatedly accessing end index.
2. Better variable names.
2020-09-22 09:21:20 -04:00
Simon Pilgrim
85b5840339 [SLP] Merge null and dyn_cast<> checks into dyn_cast_or_null<>. NFCI. 2020-09-22 14:01:47 +01:00
Sam Parker
bd6fe01b0b [ARM] Trying to fix asan buildbot 2020-09-22 13:43:23 +01:00
Max Kazantsev
b9a5ef40c1 [SCEV] Handle less predicates for FoundPred = NE
Currently these predicates are ignored, yet their handling is
pretty simple. I could not find a single test where it would
actually change something, but it's only because isImpliedCondOperands
is not smart enough to prove it further on. Yet the situation when
we come there with `less` predicate is pretty common.

Differential Revision: https://reviews.llvm.org/D87890
Reviewed By: fhahn
2020-09-22 18:56:35 +07:00
Meera Nakrani
699846f1a5 [ARM][TTI] Prevents constants in a min(max) or max(min) pattern from being hoisted when in a loop
Changes TTI function getIntImmCostInst to take an additional Instruction parameter,
which enables us to be able to check it is part of a min(max())/max(min()) pattern that will match SSAT.
We can then mark the constant used as free to prevent it being hoisted so SSAT can still be generated.
Required minor changes in some non-ARM backends to allow for the optional parameter to be included.

Differential Revision: https://reviews.llvm.org/D87457
2020-09-22 11:54:10 +00:00
Simon Pilgrim
ce833bfec3 Revert rGf835779160ec303 "[APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI."
This reverts commit f835779160ec30340676918915526615a07e826e while I investigate some buildbot failures
2020-09-22 12:15:23 +01:00
Simon Pilgrim
5c56e1aa26 [APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.
We do this in all other cases.
2020-09-22 11:29:29 +01:00
Esme-Yi
c952b1959c [NFC][PowerPC]Add tests for multiply-by-constant. 2020-09-22 10:25:02 +00:00
Max Kazantsev
ddb177aa83 [SCEV] Support unsigned predicates in isKnownPredicateViaNoOverflow
SCEV should be able to prove facts like `x <u x+1<nuw>`.

Differential Revision: https://reviews.llvm.org/D88015
Reviewed By: lebedev.ri
2020-09-22 17:14:05 +07:00
Jay Foad
7c2e74eb51 [AMDGPU] More codegen patterns for v2i16/v2f16 build_vector
It's simpler to do this at codegen time than to do ad-hoc constant
folding of machine instructions in SIFoldOperands.

Differential Revision: https://reviews.llvm.org/D88028
2020-09-22 10:41:38 +01:00
Sam Parker
54df34cd65 [ARM] Improve VPT predicate tracking
The VPTBlock has been modified to track the 'global' state of the
VPR, as well as the state for each block. Each object now just holds
a list of instructions that makeup the block, while static structures
hold the predicate information. This enables global access for
querying how both a VPT block and individual instructions are
predicated. These changes now allow us, again, to handle more
complicated cases where multiple instructions build a predicate
and/or where the same predicate in used in multiple blocks.

It doesn't, however, get us back to before the tracking was 'fixed'
as some extra logic will be required to properly handle VPT
instructions. Currently a VPT could be effectively predicated because
of it's inputs, but the existing logic will not detect that and so
will refuse to perform the transformation. This can be seen in
remat-vctp.ll test where we still don't perform the transform.

Differential Revision: https://reviews.llvm.org/D87681
2020-09-22 10:40:27 +01:00
Muhammad Omair Javaid
23a5ef2eb0 Revert "Reapply Revert "RegAllocFast: Rewrite and improve""
This reverts commit 55f9f87da2c2ad791b9e62cccb1c035e037444fa.

Breaks following buildbots:
http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/4306
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/9154
2020-09-22 14:40:06 +05:00
Georgii Rymar
b5638caa39 [llvm-readobj/elf] - Stop reporting invalid extended indexes in warnings for unnamed section symbols.
We have an issue with `getFullSymbolName`: it assumes that the symbol passed is
always in the `.symtab`, what is wrong. We might calculate and report a wrong index currently.
I've added a test case revealing that.

This patch adds the "symbol index" argument to `getFullSymbolName` signature,
what fixes the issue.

Differential revision: https://reviews.llvm.org/D87899
2020-09-22 11:55:15 +03:00
Sam Parker
25554e518b [ARM] Remove MVEDomain from VLDR/STR of P0
Remove the domain from the instructions and create a shouldInspect
helper for LowOverheadLoops which queries it or a vpr operand.

Differential Revision: https://reviews.llvm.org/D87900
2020-09-22 09:05:50 +01:00
Sam Parker
93fb87e9fa [ARM] VPT validForTailPredication
Mark all VPT instructions as valid.

Differential Revision: https://reviews.llvm.org/D87759
2020-09-22 08:58:37 +01:00
Martin Storsjö
acf3c1586e Reapply: [clang-cl] Always interpret the LIB env var as separated with semicolons
When cross compiling with clang-cl, clang splits the INCLUDE env
variable around semicolons (clang/lib/Driver/ToolChains/MSVC.cpp,
MSVCToolChain::AddClangSystemIncludeArgs) and lld splits the
LIB variable similarly (lld/COFF/Driver.cpp,
LinkerDriver::addLibSearchPaths). Therefore, the consensus for
cross compilation with clang-cl and lld-link seems to be to use
semicolons, despite path lists normally being separated by colons
on unix and EnvPathSeparator being set to that.

Therefore, handle the LIB variable similarly in Clang, when
handling lib file arguments when driving linking via Clang.

This fixes commands like "clang-cl test.c -Fetest.exe kernel32.lib" in
a cross compilation setting. Normally, most users call (lld-)link
directly, but meson happens to use this command syntax for
has_function() tests.

Reapply: Change Program.h to define procid_t as ::pid_t. When included
in lldb/unittests/Host/NativeProcessProtocolTest.cpp, it is included
after an lldb namespace containing an lldb::pid_t typedef, followed
later by a "using namespace lldb;". Previously, Program.h wasn't
included in this translation unit, but now it ends up included
transitively from Process.h.

Differential Revision: https://reviews.llvm.org/D88002
2020-09-22 10:51:25 +03:00
Petr Hosek
eb228cdeb6 Revert "[CMake] Use find_dependency in LLVMConfig.cmake"
This reverts commit 247c4fc50720ed48db2464bbe59839eedbe16794 as it
broke the runtime build.
2020-09-22 00:24:15 -07:00
LLVM GN Syncbot
b039eded77 [gn build] Port af582c9b0f3 2020-09-22 06:47:54 +00:00
Petr Hosek
a5cf3ea613 [CMake] Use append for CMAKE_REQUIRED_* variables
This ensures that required includes and libraries such as -lm that
were added earlier aren't overwritten.

Differential Revision: https://reviews.llvm.org/D88068
2020-09-21 23:39:56 -07:00
Petr Hosek
48dbca491d [CMake] Use find_dependency in LLVMConfig.cmake
This prefered over find_package as find_dependency forwards the correct
parameters for QUIET and REQUIRED to find_package.

Differential Revision: https://reviews.llvm.org/D88069
2020-09-21 23:39:01 -07:00
Arthur Eubanks
8627066bb0 [AlwaysInliner] Emit optimization remarks
To match the normal inliner in preparation for https://reviews.llvm.org/D86988.

Also change a FIXME to an assert.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D88067
2020-09-21 22:09:28 -07:00
Dominic Chen
d7a47f201a [WebAssembly][MC] Fix computation of relative symbol offset
For relative symbols, add its offset when computing relocation value.
Also, warn on unsupported absolute symbols.

Differential Revision: https://reviews.llvm.org/D87407
2020-09-22 00:53:23 -04:00
Serguei Katkov
bfb520c840 [LoopUnswitch] Trivial simplification: remove trivial dead condition after unswitch
Non trivial loop unswitch can keep the dead condition instruction.
CL adds trivial dead code elimination for unused condition.

Reviewers: asbirlea, aqjune, fhahn, DaniilSuchkov, reames
Reviewed By: asbirlea
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D88014
2020-09-22 09:04:59 +07:00
Arthur Eubanks
c45e8c1554 [UnifyLoopExits] Pin tests with -unify-loop-exits to legacy PM
The pass is not used in tree, so no reason to port it.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D88058
2020-09-21 18:08:58 -07:00
Arthur Eubanks
9eb1a32643 [Delinearization][NewPM] Port delinearization to NPM
Also make tests in Analysis/Delinearization work under NPM.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87741
2020-09-21 17:59:08 -07:00
Arthur Eubanks
c5c94111c8 [NewPM] Pin -lazy-branch-prob and -lazy-block-freq tests to legacy PM
NPM passes just use the normal versions of these analyses instead.
Also pin any tests with -analyze to legacy PM.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87857
2020-09-21 17:51:46 -07:00
Fangrui Song
adddf2a5ad Revert D71539 "Recommit "[SCEV] Look through single value PHIs.""
This reverts commit 11dccf8d3aa5d55210f8b886fb21926c7a8353ca.

A bootstrapped clang crashes (due to ArrayRef::front called on an empty
ArrayRef) when compiling some files.  Very strangely, this only reproduces with
modules.

```
13 0x0000564d3349e968 llvm::ArrayRef<llvm::BasicBlock*>::front() const /proc/self/cwd/llvm/include/llvm/ADT/ArrayRef.h:160:7
14 0x0000564d3349e896 llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getHeader() const /proc/self/cwd/llvm/include/llvm/Analysis/LoopInfo.h:104:50
15 0x0000564d3349fd9d llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getLoopLatch() const /proc/self/cwd/llvm/include/llvm/Analysis/LoopInfoImpl.h:210:11
16 0x0000564d33593c8a llvm::ScalarEvolution::computeBackedgeTakenCount(llvm::Loop const*, bool) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:6933:15
17 0x0000564d33592ebc llvm::ScalarEvolution::getBackedgeTakenInfo(llvm::Loop const*) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:0:30
18 0x0000564d33593a54 llvm::ScalarEvolution::getBackedgeTakenCount(llvm::Loop const*, llvm::ScalarEvolution::ExitCountKind) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:6487:36
19 0x0000564d32be2402 llvm::ScalarEvolution::getConstantMaxBackedgeTakenCount(llvm::Loop const*) /proc/self/cwd/llvm/include/llvm/Analysis/ScalarEvolution.h:768:5
20 0x0000564d33590807 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:5495:19
21 0x0000564d320abab7 llvm::ScalarEvolution::getSignedRange(llvm::SCEV const*) /proc/self/cwd/llvm/include/llvm/Analysis/ScalarEvolution.h:840:12
22 0x0000564d335a03aa llvm::ScalarEvolution::isKnownPredicateViaConstantRanges(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:9239:60
23 0x0000564d33586a80 llvm::ScalarEvolution::isKnownViaNonRecursiveReasoning(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:10284:60
```
2020-09-21 17:21:43 -07:00
antonio-cortes-perez
0eca672f50 [docs] Update ExtendingLLVM.rst
Updated file paths and function signatures in section
"Adding a new type".

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D88049
2020-09-21 16:49:48 -07:00
Krzysztof Parzyszek
1e5b66c0d5 [EarlyCSE] Handle masked loads and stores
Extend the handling of memory intrinsics to also include non-
target-specific intrinsics, in particular masked loads and stores.

Invent "isHandledNonTargetIntrinsic" to distinguish between intrin-
sics that should be handled natively from intrinsics that can be
passed to TTI.

Add code that handles masked loads and stores and update the
testcase to reflect the results.

Differential Revision: https://reviews.llvm.org/D87340
2020-09-21 18:47:10 -05:00
Arthur Eubanks
a6e667da4b [NewPM] Support -disable-simplify-libcall/-disable-builtin in NPM opt
Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87932
2020-09-21 16:38:37 -07:00
Arthur Eubanks
842b9ba66b [SimplifyCFG] Override options in default constructor
SimplifyCFG's options should always be overridden by command line flags,
but they mistakenly weren't in the default constructor.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D87718
2020-09-21 16:33:01 -07:00
Evandro Menezes
fe13cb66f6 [RISCV] Do not mandate scheduling for CSR instructions
Scheduling information is of little value when they may disrupt the
pipeline.  This patch allows omitting the scheduling information for CSR
instructions while still setting `SchedMachineModel::CompleteModel`.  For
specific cases, any scheduling information added will be used by the
scheduler.

Differential revision: https://reviews.llvm.org/D85366
2020-09-21 18:24:53 -05:00
Kazu Hirata
50278ccf30 [llvm] Fix comment typos. NFC. 2020-09-21 16:23:49 -07:00
Kazu Hirata
fe77e45bf0 Fix comment typos. NFC. 2020-09-21 16:12:56 -07:00
Amara Emerson
56e14355d6 [AArch64][GlobalISel] Merge selection of vector-vector G_ASHR/G_LSHR and support more cases.
The vector-immediate cases are handled elsewhere in an earlier commit.
2020-09-21 16:04:52 -07:00
Amara Emerson
eaf34219d1 [AArch64][GlobalISel] Add a post-legalize combine for lowering vector-immediate G_ASHR/G_LSHR.
In order to select the immediate forms using the imported patterns, we need to
lower them into new G_VASHR/G_VLSHR target generic ops. Add a combine to do this
matching build_vector of constant operands.

With this, we get selection for free.
2020-09-21 16:04:52 -07:00
Amara Emerson
736b33df71 [AArch64][GlobalISel] Make <4 x s16> G_ASHR and G_LSHR legal.
Selection support for these is coming up.
2020-09-21 15:32:48 -07:00
Mircea Trofin
9523c5d4bd [NFC][regalloc] Use reverse iterator ranges for improved readability
Differential Revision: https://reviews.llvm.org/D88047
2020-09-21 14:58:37 -07:00
Martin Storsjö
2f6b19c19e Revert "[clang-cl] Always interpret the LIB env var as separated with semicolons"
This reverts commit 4d85444b317a00a3e15da63cdb693d272c99a0cc.

This commit broke building lldb's NativeProcessProtocolTest.cpp,
with errors like these:

In file included from include/llvm/Support/Process.h:32:0,
                 from tools/lldb/unittests/Host/NativeProcessProtocolTest.cpp:12:
include/llvm/Support/Program.h:39:11: error: reference to ‘pid_t’ is ambiguous
   typedef pid_t procid_t;

/usr/include/sched.h:38:17: note: candidates are: typedef __pid_t pid_t
 typedef __pid_t pid_t;

tools/lldb/include/lldb/lldb-types.h:85:18: note: typedef uint64_t lldb::pid_t
 typedef uint64_t pid_t;
2020-09-22 00:14:45 +03:00