Commit Graph

328271 Commits

Author SHA1 Message Date
Alexey Bataev 2df5f12ea1 [OPENMP50]Initial codegen for declare variant implementation vendor.
Initial implementation of global aliases emission for the declare
variant pragma with implementation vendor context selector set.

llvm-svn: 373387
2019-10-01 20:18:32 +00:00
Bardia Mahjour 91b62d5c89 [DDG] Data Dependence Graph - Root Node
Summary:
This patch adds Root Node to the DDG. The purpose of the root node is to create a single entry node that allows graph walk iterators to iterate through all nodes of the graph, making sure that no node is left unvisited during a graph walk (eg. SCC or DFS). Once the DDG is fully constructed it will have exactly one root node. Every node in the graph is reachable from the root. The algorithm for connecting the root node is based on depth-first-search that keeps track of visited nodes to try to avoid creating unnecessary edges.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

Tag: #llvm

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

llvm-svn: 373386
2019-10-01 19:32:42 +00:00
Louis Dionne bcab95182b [libc++] Re-apply workaround for D63883
In reality, this workaround is for the fact that LIBCXX_CXX_ABI=libcxxabi
can't be specified on Linux, since libc++abi isn't shipped with the system.
Since the build bots explicitly specify LIBCXX_CXX_ABI=libcxxabi, they fail
unless we apply the workaround.

llvm-svn: 373385
2019-10-01 19:27:38 +00:00
Louis Dionne 32f869e0ee [libc++] Remove workaround for D63883
I tried applying D63883 three times and could never get around to
making it work. I'm giving up on that for now, but soon this should
be irrelevant anyway since all builds will move to the monorepo
(where we're always using the in-tree libc++abi unless explicitly
specified otherwise).

llvm-svn: 373384
2019-10-01 19:13:52 +00:00
Alina Sbirlea 890090f7f5 [MemorySSA] Check for unreachable blocks when getting last definition.
If a single predecessor is found, still check if the block is
unreachable. The test that found this had a self loop unreachable block.
Resolves PR43493.

llvm-svn: 373383
2019-10-01 19:09:50 +00:00
Jakub Kuderski 7ed4fb389b Add a missing pass in ARM O3 pipeline
llvm-svn: 373382
2019-10-01 18:53:54 +00:00
Louis Dionne 04501a22a0 [libc++abi] Remove uses of C++ headers when possible
This reduces the (circular) dependency of libc++abi on a C++ standard
library. Outside of the demangler which uses fancier C++ features, the
only C++ headers now required by libc++abi are pretty much <new> and
<exception>, and that's because libc++abi defines some types that are
declared in those headers.

llvm-svn: 373381
2019-10-01 18:43:02 +00:00
Alina Sbirlea ae40dfc1e3 [MemorySSA] Update last_access_in_block check.
The check for "was there an access in this block" should be: is the last
access in this block and is it not a newly inserted phi.
Resolves new test in PR43438.

Also fix a typo when simplifying trivial Phis to match the comment.

llvm-svn: 373380
2019-10-01 18:34:39 +00:00
Louis Dionne 2cee0e2d97 [NFC][libc++abi] Remove trailing whitespace from sources
llvm-svn: 373379
2019-10-01 18:28:20 +00:00
Jakub Kuderski 856c1cd852 [Dominators][CodeGen] Don't mark MachineDominatorTree as preserved in MachineLICM
llvm-svn: 373378
2019-10-01 18:27:44 +00:00
Jakub Kuderski 5be08ee902 [Dominators][CodeGen] Fix MachineDominatorTree preservation in PHIElimination
Summary:
PHIElimination modifies CFG and marks MachineDominatorTree as preserved. Therefore, it the CFG changes it should also update the MDT, when available. This patch teaches PHIElimination to recalculate MDT when necessary.

This fixes the `tailmerging_in_mbp.ll` test failure discovered after switching to generic DomTree verification algorithm in MachineDominators in D67976.

Reviewers: arsenm, hliao, alex-t, rampitec, vpykhtin, grosser

Reviewed By: rampitec

Subscribers: MatzeB, wdng, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 373377
2019-10-01 18:27:17 +00:00
Jakub Kuderski 925c285f43 Reapply [Dominators][CodeGen] Clean up MachineDominators
This reverts r373117 (git commit 159ef37735)

Phabricator review: https://reviews.llvm.org/D67976.

llvm-svn: 373376
2019-10-01 18:27:14 +00:00
David Bolvansky 1f345cb05d [NFC] Updated tests after rL373371
Forgot to run check-clang-semacxx.

llvm-svn: 373375
2019-10-01 18:18:45 +00:00
Alexey Bataev b9b8ca2334 [OPENMP]Fix PR43330: OpenMP target: Mapping of partial arrays fails.
Fixed calculation the size of the array sections.

llvm-svn: 373374
2019-10-01 18:18:03 +00:00
Adrian Prantl f3d2158616 Make another attempt at fixing SymbolFilePDBTests.
llvm-svn: 373373
2019-10-01 18:15:22 +00:00
Louis Dionne a288695968 [libc++] Update link to Itanium C++ ABI documentation
llvm-svn: 373372
2019-10-01 18:14:27 +00:00
David Bolvansky 00d632e089 [Diagnostics] Make -Wenum-compare-conditional off by default
Too many false positives, eg. in Chromium.

llvm-svn: 373371
2019-10-01 18:12:13 +00:00
Teresa Johnson dca5b94e79 [ThinLTO] Enable index-only WPD from clang
Summary:
To trigger the index-only Whole Program Devirt support added to LLVM, we
need to be able to specify -fno-split-lto-unit in conjunction with
-fwhole-program-vtables. Keep the default for -fwhole-program-vtables as
-fsplit-lto-unit, but don't error on that option combination.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 373370
2019-10-01 18:08:29 +00:00
Rong Xu e0fa2689de [PGO] Fix typos from r359612. NFC.
llvm-svn: 373369
2019-10-01 18:06:50 +00:00
David Green a3ebcfe5a6 [ARM] Some MVE shuffle plus extend tests. NFC
llvm-svn: 373368
2019-10-01 18:04:02 +00:00
Vitaly Buka 3ee619c112 Revert "compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM"
Revert "compiler-rt: move all __GLIBC_PREREQ into own header file"

"move all __GLIBC_PREREQ" breaks build on some bots

This reverts commit 2d75ee9373.
This reverts commit 7a6461fcc2.

llvm-svn: 373367
2019-10-01 18:03:11 +00:00
Tom Stellard 004c79157e AMDGPU/SILoadStoreOptimizer: Add helper functions for working with CombineInfo
Summary:
This is a refactoring that will make future improvements to this pass easier.
This change should not change the behavior of the pass.

Reviewers: arsenm, pendingchaos, rampitec, nhaehnle, vpykhtin

Reviewed By: nhaehnle, vpykhtin

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373366
2019-10-01 17:56:59 +00:00
Louis Dionne 4ff35a8f0b [libc++abi] Remove redundant #include of <string.h>
<string.h> is always included, so we don't need the additional #include
only in the _WIN32 case.

llvm-svn: 373365
2019-10-01 17:53:17 +00:00
Roman Lebedev 053014f8f9 [InstCombine] Deal with -(trunc(X >>u 63)) -> trunc(X >>s 63)
Identical to it's trunc-less variant, just pretent-to hoist
trunc, and everything else still holds:
https://rise4fun.com/Alive/JRU

llvm-svn: 373364
2019-10-01 17:50:20 +00:00
Roman Lebedev 65144149d0 [InstCombine] Preserve 'exact' in -(X >>u 31) -> (X >>s 31) fold
https://rise4fun.com/Alive/yR4

llvm-svn: 373363
2019-10-01 17:50:09 +00:00
Roman Lebedev f273fc793a [NFC][InstCombine] (Better) tests for sign-bit-smearing pattern
https://rise4fun.com/Alive/JRU
https://rise4fun.com/Alive/yR4 <- we can preserve 'exact'

llvm-svn: 373362
2019-10-01 17:49:58 +00:00
Jonas Devlieghere e09adb400b [JSON] Use LLVM's library for argdumper
This patch replaces the LLDB's JSON implementation with the one from
LLVM in argdumper.

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

llvm-svn: 373361
2019-10-01 17:41:55 +00:00
Jonas Devlieghere 57b468820f [JSON] Use LLVM's library for decoding JSON in StructuredData
This patch replaces the hand-rolled JSON decoding in StructuredData with
LLVM's JSON library.

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

llvm-svn: 373360
2019-10-01 17:41:52 +00:00
Jonas Devlieghere 2783d81791 [JSON] Use LLVM's library for encoding JSON in StructuredData
This patch replaces the hand-rolled JSON emission in StructuredData with
LLVM's JSON library.

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

llvm-svn: 373359
2019-10-01 17:41:48 +00:00
David Green 9292983154 [llvm-mca] Add a -mattr flag
This adds a -mattr flag to llvm-mca, for cases where the -mcpu option does not
contain all optional features.

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

llvm-svn: 373358
2019-10-01 17:41:38 +00:00
Peter Collingbourne 42ec0b777f Add missing REQUIRES: arm.
llvm-svn: 373357
2019-10-01 17:35:56 +00:00
Vedant Kumar a1e7efaaa8 [ReleaseProcess] Document requirement to set MACOSX_DEPLOYMENT_TARGET
llvm-svn: 373356
2019-10-01 17:10:45 +00:00
Adrian Prantl dffe5dfa5c Fix a syntax error.
llvm-svn: 373355
2019-10-01 17:10:25 +00:00
Adrian Prantl ad08a5f0f1 Fix a condition-flip regression introduced in r373344.
llvm-svn: 373354
2019-10-01 17:08:44 +00:00
Adrian Prantl c7f19caaea Typo (NFC)
llvm-svn: 373353
2019-10-01 17:08:41 +00:00
Adrian Prantl 771d464f49 Simplify condition (NFC)
llvm-svn: 373352
2019-10-01 17:08:38 +00:00
Philip Reames 0200626f0b [IndVars] An implementation of loop predication without a need for speculation
This patch implements a variation of a well known techniques for JIT compilers - we have an implementation in tree as LoopPredication - but with an interesting twist. This version does not assume the ability to execute a path which wasn't taken in the original program (such as a guard or widenable.condition intrinsic). The benefit is that this works for arbitrary IR from any frontend (including C/C++/Fortran). The tradeoff is that it's restricted to read only loops without implicit exits.

This builds on SCEV, and can thus eliminate the loop varying portion of the any early exit where all exits are understandable by SCEV. A key advantage is that fixing deficiency exposed in SCEV - already found one while writing test cases - will also benefit all of full redundancy elimination (and most other loop transforms).

I haven't seen anything in the literature which quite matches this. Given that, I'm not entirely sure that keeping the name "loop predication" is helpful. Anyone have suggestions for a better name? This is analogous to partial redundancy elimination - since we remove the condition flowing around the backedge - and has some parallels to our existing transforms which try to make conditions invariant in loops.

Factoring wise, I chose to put this in IndVarSimplify since it's a generally applicable to all workloads. I could split this off into it's own pass, but we'd then probably want to add that new pass every place we use IndVars.  One solid argument for splitting it off into it's own pass is that this transform is "too good". It breaks a huge number of existing IndVars test cases as they tend to be simple read only loops.  At the moment, I've opted it off by default, but if we add this to IndVars and enable, we'll have to update around 20 test files to add side effects or disable this transform.

Near term plan is to fuzz this extensively while off by default, reflect and discuss on the factoring issue mentioned just above, and then enable by default.  I also need to give some though to supporting widenable conditions in this framing.

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

llvm-svn: 373351
2019-10-01 17:03:44 +00:00
Matt Arsenault 9dba603748 AMDGPU/GlobalISel: Increase max legal size to 1024
There are 1024 bit register classes defined for AGPRs. Additionally
OpenCL defines vectors up to 16 x i64, and this helps those tests
legalize.

llvm-svn: 373350
2019-10-01 16:35:06 +00:00
Craig Topper 105e82edde [X86] Add a VBROADCAST_LOAD ISD opcode representing a scalar load broadcasted to a vector.
Summary:
This adds the ISD opcode and a DAG combine to create it. There are
probably some places where we can directly create it, but I'll
leave that for future work.

This updates all of the isel patterns to look for this new node.
I had to add a few additional isel patterns for aligned extloads
which we should probably fix with a DAG combine or something. This
does mean that the broadcast load folding for avx512 can no
longer match a broadcasted aligned extload.

There's still some work to do here for combining a broadcast of
a broadcast_load. We also need to improve extractelement or
demanded vector elements of a broadcast_load. I'll try to get
those done before I submit this patch.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373349
2019-10-01 16:28:20 +00:00
Alexey Bataev 658ad4d4d2 [OPENMP]Fix PR43516: Compiler crash with collapse(2) on non-rectangular
loop.

Missed check if the condition is also dependent when building final
expressions for the collapsed loop directives.

llvm-svn: 373348
2019-10-01 16:19:10 +00:00
Peter Collingbourne 0bb825d208 ELF: Add .interp synthetic sections first in createSyntheticSections().
Our .interp section is not a SyntheticSection. As a result, it terminates the
loop in removeUnusedSyntheticSections(). This has at least two consequences:

- The synthetic .bss and .bss.rel.ro sections are always present in
  dynamically linked executables, even when they are not needed.
- The synthetic .ARM.exidx (and possibly other) sections are always present
  in partitions other than the last one, even when not needed.
  .ARM.exidx in particular is problematic because it assumes that its
  list of code sections is non-empty in getLinkOrderDep(), which can
  lead to a crash if the partition does not have any code sections.

Fix these problems by moving the creation of the .interp sections to the
top of createSyntheticSections(). While here, make the code a little less
error-prone by changing the add() lambdas to take a SyntheticSection instead
of an InputSectionBase.

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

llvm-svn: 373347
2019-10-01 16:10:13 +00:00
Jay Foad e536800022 [AMDGPU] Add VerifyScheduling support.
Summary:
This is cut and pasted from the corresponding GenericScheduler
functions.

Reviewers: arsenm, atrick, tstellar, vpykhtin

Subscribers: MatzeB, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 373346
2019-10-01 15:45:47 +00:00
David Bolvansky 362055d1fa [Diagnostics] Move warning into the subgroup (-Wenum-compare-conditional)
llvm-svn: 373345
2019-10-01 15:44:38 +00:00
Adrian Prantl bf9d84c014 Remove size_t return parameter from FindTypes
In r368345 I accidentally introduced a regression that would
over-report the number of matches found by FindTypes if the
DeclContext Filter was hit.

This patch simply removes the size_t return parameter altogether —
it's not that useful.

rdar://problem/55500457

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

llvm-svn: 373344
2019-10-01 15:40:41 +00:00
Simon Pilgrim 3c912c4abe [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)
This patch converts the DAGCombine isNegatibleForFree/GetNegatedExpression into overridable TLI hooks.

The intention is to let us extend existing FNEG combines to work more generally with negatible float ops, allowing it work with target specific combines and opcodes (e.g. X86's FMA variants).

Unlike the SimplifyDemandedBits, we can't just handle target nodes through a Target callback, we need to do this as an override to allow targets to handle generic opcodes as well. This does mean that the target implementations has to duplicate some checks (recursion depth etc.).

Partial reversion of rL372756 - I've identified the infinite loop issue inside the X86 override but haven't fixed it yet so I've only (re)committed the common TargetLowering refactoring part of the patch.

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

llvm-svn: 373343
2019-10-01 15:32:04 +00:00
Adrian Prantl 796cd312ac Update SymbolFilePDB for FindTypes API change.
This is untested, I don't have access to a Windows machine.

llvm-svn: 373342
2019-10-01 15:29:33 +00:00
Jakub Kuderski 56b52a207f [Dominators][CodeGen] Add MachinePostDominatorTree verification
Summary:
This patch implements Machine PostDominator Tree verification and ensures that the verification doesn't fail the in-tree tests.

MPDT verification can be enabled using `verify-machine-dom-info` -- the same flag used by Machine Dominator Tree verification.

Flipping the flag revealed that MachineSink falsely claimed to preserve CFG and MDT/MPDT. This patch fixes that.

Reviewers: arsenm, hliao, rampitec, vpykhtin, grosser

Reviewed By: hliao

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373341
2019-10-01 15:23:27 +00:00
Kadir Cetinkaya fd019ed54e [clang] Make handling of unnamed template params similar to function params
Summary:
Clang uses the location identifier should be inserted for declarator
decls when a decl is unnamed. But for type template and template template
paramaters it uses the location of "typename/class" keyword, which makes it hard
for tooling to insert/change parameter names.

This change tries to unify these two cases by making template parameter
parsing and sourcerange operations similar to function params/declarator decls.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 373340
2019-10-01 14:08:51 +00:00
Raphael Isemann b67c3b6cf0 [lldb][NFC] Mark ClangASTContext constructor as explicit
Given that we can implicitly construct a ClangASTContext from any string, we should
really mark this as explicit.

llvm-svn: 373339
2019-10-01 13:45:06 +00:00
Simon Pilgrim 9eb2bd6b8d Revert rL349624 : Let TableGen write output only if it changed, instead of doing so in cmake, attempt 2
Differential Revision: https://reviews.llvm.org/D55842
-----------------
As discussed on PR43385 this is causing Visual Studio msbuilds to perpetually rebuild all tablegen generated files

llvm-svn: 373338
2019-10-01 13:39:43 +00:00