]> granicus.if.org Git - llvm/log
llvm
5 years agoRemove an unnecessary cast. NFC.
Jay Foad [Wed, 2 Oct 2019 08:56:33 +0000 (08:56 +0000)]
Remove an unnecessary cast. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373434 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Make printf lowering faster when there are no printfs
Jay Foad [Wed, 2 Oct 2019 08:44:15 +0000 (08:44 +0000)]
[AMDGPU] Make printf lowering faster when there are no printfs

Summary:
Printf lowering unconditionally visited every instruction in the module.
To make it faster in the common case where there are no printfs, look up
the printf function (if any) and iterate over its users instead.

Reviewers: rampitec, kzhuravl, alex-t, arsenm

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373433 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.
Florian Hahn [Wed, 2 Oct 2019 08:32:25 +0000 (08:32 +0000)]
Revert [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.

This breaks http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52310

This reverts r373430 (git commit 70f70035484ba199a329f9f8d9bd67e37bc2b408)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373432 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSwitch lowering: omit range check for bit tests when default is unreachable (PR43129)
Hans Wennborg [Wed, 2 Oct 2019 08:32:15 +0000 (08:32 +0000)]
Switch lowering: omit range check for bit tests when default is unreachable (PR43129)

This is modeled after the same functionality for jump tables, which was
added in r357067.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373431 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.
Florian Hahn [Wed, 2 Oct 2019 08:15:31 +0000 (08:15 +0000)]
[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.

removeUnreachableBlocks knows how to preserve the DomTree, so make use
of it instead of re-computing the DT.

Reviewers: davide, kuhar, brzycki

Reviewed By: davide, kuhar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373430 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Local] Simplify function removeUnreachableBlocks() to avoid (re-)computation.
Florian Hahn [Wed, 2 Oct 2019 07:37:41 +0000 (07:37 +0000)]
[Local] Simplify function removeUnreachableBlocks() to avoid (re-)computation.

Two small changes in llvm::removeUnreachableBlocks() to avoid unnecessary (re-)computation.

First, replace the use of count() with find(), which has better time complexity.

Second, because we have already computed the set of dead blocks, replace the second loop over all basic blocks to a loop only over the already computed dead blocks. This simplifies the loop and avoids recomputation.

Patch by Rodrigo Caetano Rocha <rcor.cs@gmail.com>

Reviewers: efriedma, spatel, fhahn, xbolva00

Reviewed By: fhahn, xbolva00

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373429 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReland "[utils] Implement the llvm-locstats tool"
Djordje Todorovic [Wed, 2 Oct 2019 07:00:01 +0000 (07:00 +0000)]
Reland "[utils] Implement the llvm-locstats tool"

The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

The cause of the test failure was resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373427 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-lib] Detect duplicate input files
Rui Ueyama [Wed, 2 Oct 2019 06:41:52 +0000 (06:41 +0000)]
[llvm-lib] Detect duplicate input files

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373426 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-lib] Correctly handle .lib input files
Rui Ueyama [Wed, 2 Oct 2019 05:24:24 +0000 (05:24 +0000)]
[llvm-lib] Correctly handle .lib input files

If archive files are passed as input files, llvm-lib needs to append
the members of the input archive files to the output file. This patch
implements that behavior.

This patch splits an existing function into smaller functions.
Effectively, the new code is only `if (Magic == file_magic::archive)
{ ... }` part.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32674

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373424 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add broadcast load folding patterns to the NoVLX compare patterns.
Craig Topper [Wed, 2 Oct 2019 04:45:02 +0000 (04:45 +0000)]
[X86] Add broadcast load folding patterns to the NoVLX compare patterns.

These patterns use zmm registers for 128/256-bit compares when
the VLX instructions aren't available. Previously we only
supported registers, but as PR36191 notes we can fold broadcast
loads, but not regular loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373423 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix GCC -Wreturn-type warnings. NFC.
Michael Liao [Wed, 2 Oct 2019 04:13:17 +0000 (04:13 +0000)]
Fix GCC -Wreturn-type warnings. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373422 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDebugInfo: Update support for detecting C++ language variants in debug info emission
David Blaikie [Wed, 2 Oct 2019 01:39:48 +0000 (01:39 +0000)]
DebugInfo: Update support for detecting C++ language variants in debug info emission

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373420 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: (manually) merge r373407
Nico Weber [Wed, 2 Oct 2019 01:26:46 +0000 (01:26 +0000)]
gn build: (manually) merge r373407

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373419 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Use getIntrinsicID helper
Matt Arsenault [Wed, 2 Oct 2019 01:02:27 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Use getIntrinsicID helper

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373417 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX
Matt Arsenault [Wed, 2 Oct 2019 01:02:24 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX

In principle this should behave as any other constant. However
eliminateFrameIndex currently assumes a VALU use and uses a vector
shift. Work around this by selecting to VGPR for now until
eliminateFrameIndex is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373415 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Private loads always use VGPRs
Matt Arsenault [Wed, 2 Oct 2019 01:02:21 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Private loads always use VGPRs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373414 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Legalize 1024-bit G_BUILD_VECTOR
Matt Arsenault [Wed, 2 Oct 2019 01:02:18 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Legalize 1024-bit G_BUILD_VECTOR

This will be needed to support AGPR operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373413 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix RegBankSelect for 1024-bit values
Matt Arsenault [Wed, 2 Oct 2019 01:02:14 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Fix RegBankSelect for 1024-bit values

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373412 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] separate accounting for agprs
Stanislav Mekhanoshin [Wed, 2 Oct 2019 00:26:58 +0000 (00:26 +0000)]
[AMDGPU] separate accounting for agprs

Account and report agprs separately on gfx908. Other targets
do not change the reporting.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373411 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add a DAG combine to shrink vXi64 gather/scatter indices that are constant...
Craig Topper [Tue, 1 Oct 2019 23:18:31 +0000 (23:18 +0000)]
[X86] Add a DAG combine to shrink vXi64 gather/scatter indices that are constant with sufficient sign bits to fit in vXi32

The gather/scatter instructions can implicitly sign extend the indices. If we're operating on 32-bit data, an v16i64 index can force a v16i32 gather to be split in two since the index needs 2 registers. If we can shrink the index to the i32 we can avoid the split. It should always be safe to shrink the index regardless of the number of elements. We have gather/scatter instructions that can use v2i32 index stored in a v4i32 register with v2i64 data size.

I've limited this to before legalize types to avoid creating a v2i32 after type legalization. We could check for it, but we'd also need testing. I'm also only handling build_vectors with no bitcasts to be sure the truncate will constant fold.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373408 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Fix an out of date assert in addressing FrameIndex
Changpeng Fang [Tue, 1 Oct 2019 23:07:14 +0000 (23:07 +0000)]
AMDGPU: Fix an out of date assert in addressing FrameIndex

Reviewers:
  arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373404 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r373172 "[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops."
Craig Topper [Tue, 1 Oct 2019 22:40:03 +0000 (22:40 +0000)]
Revert r373172 "[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops."

This seems to be causing some performance regresions that I'm
trying to investigate.

One thing that stands out is that this transform can increase
the live range of the operands of the earlier logic op. This
can be bad for register allocation. If there are two logic
op inputs we should really combine the one that is closest, but
SelectionDAG doesn't have a good way to do that. Maybe we need
to do this as a basic block transform in Machine IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373401 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] convertToThreeAddress, make sure second operand of SUB32ri is really an immedia...
Craig Topper [Tue, 1 Oct 2019 21:55:55 +0000 (21:55 +0000)]
[X86] convertToThreeAddress, make sure second operand of SUB32ri is really an immediate before calling getImm().

It might be a symbol instead. We can't fold those since we can't
negate them.

Similar for other SUB with immediates.

Fixes PR43529.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373397 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FileCheck] Move private interface to its own header
Thomas Preud'homme [Tue, 1 Oct 2019 21:37:55 +0000 (21:37 +0000)]
[FileCheck] Move private interface to its own header

Summary:
Most of the class definition in llvm/include/llvm/Support/FileCheck.h
are actually implementation details that should not be relied upon. This
commit moves all of it in a new header file under
llvm/lib/Support/FileCheck. It also takes advantage of the code movement
to put the code into a new llvm::filecheck namespace.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373395 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BypassSlowDivision][CodeGenPrepare] avoid crashing on unused code (PR43514)
Sanjay Patel [Tue, 1 Oct 2019 21:25:36 +0000 (21:25 +0000)]
[BypassSlowDivision][CodeGenPrepare] avoid crashing on unused code (PR43514)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373394 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r373392
GN Sync Bot [Tue, 1 Oct 2019 21:23:33 +0000 (21:23 +0000)]
gn build: Merge r373392

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373393 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASan][NFC] Address remaining comments for https://reviews.llvm.org/D68287
Leonard Chan [Tue, 1 Oct 2019 20:49:07 +0000 (20:49 +0000)]
[ASan][NFC] Address remaining comments for https://reviews.llvm.org/D68287

I submitted that patch after I got the LGTM, but the comments didn't
appear until after I submitted the change. This adds `const` to the
constructor argument and makes it a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373391 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASan] Make GlobalsMD member a const reference.
Leonard Chan [Tue, 1 Oct 2019 20:30:46 +0000 (20:30 +0000)]
[ASan] Make GlobalsMD member a const reference.

PR42924 points out that copying the GlobalsMetadata type during
construction of AddressSanitizer can result in exteremely lengthened
build times for translation units that have many globals. This can be addressed
by just making the GlobalsMD member in AddressSanitizer a reference to
avoid the copy. The GlobalsMetadata type is already passed to the
constructor as a reference anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373389 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DDG] Data Dependence Graph - Root Node
Bardia Mahjour [Tue, 1 Oct 2019 19:32:42 +0000 (19:32 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373386 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Check for unreachable blocks when getting last definition.
Alina Sbirlea [Tue, 1 Oct 2019 19:09:50 +0000 (19:09 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373383 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd a missing pass in ARM O3 pipeline
Jakub Kuderski [Tue, 1 Oct 2019 18:53:54 +0000 (18:53 +0000)]
Add a missing pass in ARM O3 pipeline

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373382 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Update last_access_in_block check.
Alina Sbirlea [Tue, 1 Oct 2019 18:34:39 +0000 (18:34 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373380 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Dominators][CodeGen] Don't mark MachineDominatorTree as preserved in MachineLICM
Jakub Kuderski [Tue, 1 Oct 2019 18:27:44 +0000 (18:27 +0000)]
[Dominators][CodeGen] Don't mark MachineDominatorTree as preserved in MachineLICM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373378 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Dominators][CodeGen] Fix MachineDominatorTree preservation in PHIElimination
Jakub Kuderski [Tue, 1 Oct 2019 18:27:17 +0000 (18:27 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373377 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply [Dominators][CodeGen] Clean up MachineDominators
Jakub Kuderski [Tue, 1 Oct 2019 18:27:14 +0000 (18:27 +0000)]
Reapply [Dominators][CodeGen] Clean up MachineDominators

This reverts r373117 (git commit 159ef37735f21ae373282e0c53cbd9b6af1e0dfd)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373376 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PGO] Fix typos from r359612. NFC.
Rong Xu [Tue, 1 Oct 2019 18:06:50 +0000 (18:06 +0000)]
[PGO] Fix typos from r359612. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373369 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Some MVE shuffle plus extend tests. NFC
David Green [Tue, 1 Oct 2019 18:04:02 +0000 (18:04 +0000)]
[ARM] Some MVE shuffle plus extend tests. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373368 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/SILoadStoreOptimizer: Add helper functions for working with CombineInfo
Tom Stellard [Tue, 1 Oct 2019 17:56:59 +0000 (17:56 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373366 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Deal with -(trunc(X >>u 63)) -> trunc(X >>s 63)
Roman Lebedev [Tue, 1 Oct 2019 17:50:20 +0000 (17:50 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373364 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Preserve 'exact' in -(X >>u 31) -> (X >>s 31) fold
Roman Lebedev [Tue, 1 Oct 2019 17:50:09 +0000 (17:50 +0000)]
[InstCombine] Preserve 'exact' in -(X >>u 31) -> (X >>s 31) fold

https://rise4fun.com/Alive/yR4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373363 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][InstCombine] (Better) tests for sign-bit-smearing pattern
Roman Lebedev [Tue, 1 Oct 2019 17:49:58 +0000 (17:49 +0000)]
[NFC][InstCombine] (Better) tests for sign-bit-smearing pattern

https://rise4fun.com/Alive/JRU
https://rise4fun.com/Alive/yR4 <- we can preserve 'exact'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373362 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-mca] Add a -mattr flag
David Green [Tue, 1 Oct 2019 17:41:38 +0000 (17:41 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373358 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ReleaseProcess] Document requirement to set MACOSX_DEPLOYMENT_TARGET
Vedant Kumar [Tue, 1 Oct 2019 17:10:45 +0000 (17:10 +0000)]
[ReleaseProcess] Document requirement to set MACOSX_DEPLOYMENT_TARGET

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373356 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IndVars] An implementation of loop predication without a need for speculation
Philip Reames [Tue, 1 Oct 2019 17:03:44 +0000 (17:03 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373351 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Increase max legal size to 1024
Matt Arsenault [Tue, 1 Oct 2019 16:35:06 +0000 (16:35 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373350 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add a VBROADCAST_LOAD ISD opcode representing a scalar load broadcasted to...
Craig Topper [Tue, 1 Oct 2019 16:28:20 +0000 (16:28 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373349 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Add VerifyScheduling support.
Jay Foad [Tue, 1 Oct 2019 15:45:47 +0000 (15:45 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373346 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)
Simon Pilgrim [Tue, 1 Oct 2019 15:32:04 +0000 (15:32 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373343 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Dominators][CodeGen] Add MachinePostDominatorTree verification
Jakub Kuderski [Tue, 1 Oct 2019 15:23:27 +0000 (15:23 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373341 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert rL349624 : Let TableGen write output only if it changed, instead of doing...
Simon Pilgrim [Tue, 1 Oct 2019 13:39:43 +0000 (13:39 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373338 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Reland "[utils] Implement the llvm-locstats tool""
Djordje Todorovic [Tue, 1 Oct 2019 13:21:15 +0000 (13:21 +0000)]
Revert "Reland "[utils] Implement the llvm-locstats tool""

This reverts commit rL373317 due to test failure on the
clang-s390x-linux build bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373336 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)
David Bolvansky [Tue, 1 Oct 2019 13:19:04 +0000 (13:19 +0000)]
Revert [InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)

Seems to be slower than memcpy + strlen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373335 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)
David Bolvansky [Tue, 1 Oct 2019 13:03:10 +0000 (13:03 +0000)]
[InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373333 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-exegesis/lib] Fix missing linkage to MCParser
Michal Gorny [Tue, 1 Oct 2019 13:02:48 +0000 (13:02 +0000)]
[llvm-exegesis/lib] Fix missing linkage to MCParser

Otherwise, shared-lib build fails with:

lib64/libLLVMExegesis.a(SnippetFile.cpp.o): In function `llvm::exegesis::readSnippets(llvm::exegesis::LLVMState const&, llvm::StringRef)':
SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x31f): undefined reference to `llvm::createMCAsmParser(llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo const&, unsigned int)'
SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x41c): undefined reference to `llvm::MCAsmParser::setTargetParser(llvm::MCTargetAsmParser&)'
collect2: error: ld returned 1 exit status

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373332 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][ARM][MVE] More tests
Sam Parker [Tue, 1 Oct 2019 13:02:14 +0000 (13:02 +0000)]
[NFC][ARM][MVE] More tests

Add some tail predication tests with fast math.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373331 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDIExpression::createFragmentExpression - silence static analyzer DIExpression* null...
Simon Pilgrim [Tue, 1 Oct 2019 11:25:38 +0000 (11:25 +0000)]
DIExpression::createFragmentExpression - silence static analyzer DIExpression* null dereference warning with an assertion. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373326 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoVirtualFileSystem - replace dyn_cast<>+assert with cast<> calls. NFCI.
Simon Pilgrim [Tue, 1 Oct 2019 11:25:29 +0000 (11:25 +0000)]
VirtualFileSystem - replace dyn_cast<>+assert with cast<> calls. NFCI.

Silences a number of clang static analyzer null dereference warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373325 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoObjectFile makeTriple - silence static analyzer dyn_cast<COFFObjectFile> null derefer...
Simon Pilgrim [Tue, 1 Oct 2019 11:25:17 +0000 (11:25 +0000)]
ObjectFile makeTriple - silence static analyzer dyn_cast<COFFObjectFile> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<COFFObjectFile> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373324 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInstrProf - avoid static analyzer dyn_cast<ConstantInt> null dereference warning.
Simon Pilgrim [Tue, 1 Oct 2019 10:38:30 +0000 (10:38 +0000)]
InstrProf - avoid static analyzer dyn_cast<ConstantInt> null dereference warning.

The static analyzer is warning about a potential null dereference, as we're already earlying-out for a null Constant pointer I've just folded this into a dyn_cast_or_null<ConstantInt>.

No test case, this is by inspection only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373322 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoConstantFold - ConstantFoldSelectInstruction - assume constant vector elements are...
Simon Pilgrim [Tue, 1 Oct 2019 10:22:01 +0000 (10:22 +0000)]
ConstantFold - ConstantFoldSelectInstruction - assume constant vector elements are constant. NFCI.

Goes a bit further than rL372743 which added the early out - elements should be Constant so use cast<Constant> instead (and rely on the assert if anything fails).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373321 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[obj2yaml] - Fix BB after r373315.
George Rimar [Tue, 1 Oct 2019 10:02:47 +0000 (10:02 +0000)]
[obj2yaml] - Fix BB after r373315.

The success return value for data extractor's cursor
should also be checked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373319 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReland "[utils] Implement the llvm-locstats tool"
Djordje Todorovic [Tue, 1 Oct 2019 09:59:15 +0000 (09:59 +0000)]
Reland "[utils] Implement the llvm-locstats tool"

The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373317 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj] - Allow specifying custom Link values for SHT_HASH section.
George Rimar [Tue, 1 Oct 2019 09:54:40 +0000 (09:54 +0000)]
[yaml2obj] - Allow specifying custom Link values for SHT_HASH section.

This allows setting any sh_link values for SHT_HASH sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373316 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj/obj2yaml] - Add support for SHT_HASH sections.
George Rimar [Tue, 1 Oct 2019 09:45:59 +0000 (09:45 +0000)]
[yaml2obj/obj2yaml] - Add support for SHT_HASH sections.

SHT_HASH specification is:
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash

In short the format is the following: it has 2 uint32 fields
in its header: nbucket and nchain followed by (nbucket + nchain)
uint32 values.

This patch allows dumping and parsing such sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373315 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFixup r373278: Move test to X86 directory
Diana Picus [Tue, 1 Oct 2019 09:27:20 +0000 (09:27 +0000)]
Fixup r373278: Move test to X86 directory

...since it's using an x86 triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373314 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-exegesis][NFC] Refactor X86 tests fixtures into a base class.
Clement Courbet [Tue, 1 Oct 2019 09:20:36 +0000 (09:20 +0000)]
[llvm-exegesis][NFC] Refactor X86 tests fixtures into a base class.

Reviewers: gchatelet, a.sidorin

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373313 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[OCaml] Handle nullptr in Llvm.global_initializer"
Dmitri Gribenko [Tue, 1 Oct 2019 08:29:07 +0000 (08:29 +0000)]
Revert "[OCaml] Handle nullptr in Llvm.global_initializer"

This reverts commit r373299. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18485

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373311 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "GlobalISel: Handle llvm.read_register"
Dmitri Gribenko [Tue, 1 Oct 2019 08:24:01 +0000 (08:24 +0000)]
Revert "GlobalISel: Handle llvm.read_register"

This reverts commit r373294. It broke Clang's
CodeGen/arm64-microsoft-status-reg.cpp:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18483

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373310 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][HardwareLoops] Update some iterators
Sam Parker [Tue, 1 Oct 2019 07:53:28 +0000 (07:53 +0000)]
[NFC][HardwareLoops] Update some iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373309 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Consider isCodeGenOnly in the EVEX2VEX pass to make VMAXPD/PS map to the non...
Craig Topper [Tue, 1 Oct 2019 07:10:09 +0000 (07:10 +0000)]
[X86] Consider isCodeGenOnly in the EVEX2VEX pass to make VMAXPD/PS map to the non-commutable VEX instruction. Use EVEX2VEX override to fix the scalar instructions.

Previously the match was ambiguous and VMAXPS/PD and VMAXCPS/PD
were mapped to the same VEX instruction. But we should keep
the commutableness when change the opcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373303 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Make sure EH pads are preferred in sorting
Heejin Ahn [Tue, 1 Oct 2019 06:53:28 +0000 (06:53 +0000)]
[WebAssembly] Make sure EH pads are preferred in sorting

Summary:
In CFGSort, we try to make EH pads have higher priorities as soon as
they are ready to be sorted, to prevent creation of unwind destination
mismatches in CFGStackify. We did that by making priority queues'
comparison function  prefer EH pads, but it was possible for an EH pad
to be popped from `Preferred` queue and then not sorted immediately and
enter `Ready` queue instead in a certain condition. This patch makes
sure that special condition does not consider EH pads as its candidates.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373302 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Unstackify regs after fixing unwinding mismatches
Heejin Ahn [Tue, 1 Oct 2019 06:21:53 +0000 (06:21 +0000)]
[WebAssembly] Unstackify regs after fixing unwinding mismatches

Summary:
Fixing unwind mismatches for exception handling can result in splicing
existing BBs and moving some of instructions to new BBs. In this case
some of stackified def registers in the original BB can be used in the
split BB. For example, we have this BB and suppose %r0 is a stackified
register.
```
bb.1:
  %r0 = call @foo
  ... use %r0 ...
```

After fixing unwind mismatches in CFGStackify, `bb.1` can be split and
some instructions can be moved to a newly created BB:
```
bb.1:
  %r0 = call @foo

bb.split (new):
  ... use %r0 ...
```

In this case we should make %r0 un-stackified, because its use is now in
another BB.

When spliting a BB, this CL unstackifies all def registers that have
uses in the new split BB.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373301 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OCaml] Handle nullptr in Llvm.global_initializer
Aditya Kumar [Tue, 1 Oct 2019 03:45:09 +0000 (03:45 +0000)]
[OCaml] Handle nullptr in Llvm.global_initializer

LLVMGetInitializer returns nullptr in case there is no
initializer. There is not much that can be done with nullptr in OCaml,
not even test if it is null. Also, there does not seem to be a C or
OCaml API to test if there is an initializer. So this diff changes
Llvm.global_initializer to return an option.

Differential Revision: https://reviews.llvm.org/D65195
Reviewed by: whitequark
Authored by: kren1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373299 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select s1 src G_SITOFP/G_UITOFP
Matt Arsenault [Tue, 1 Oct 2019 02:23:20 +0000 (02:23 +0000)]
AMDGPU/GlobalISel: Select s1 src G_SITOFP/G_UITOFP

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373298 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove a undefined constructor introduced by r373244.
Yuanfang Chen [Tue, 1 Oct 2019 02:08:14 +0000 (02:08 +0000)]
Remove a undefined constructor introduced by r373244.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373297 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Add support for init.exec intrinsics
Matt Arsenault [Tue, 1 Oct 2019 02:07:25 +0000 (02:07 +0000)]
AMDGPU/GlobalISel: Add support for init.exec intrinsics

TThe existing wave32 behavior seems broken and incomplete, but this
reproduces it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373296 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Allow scc/vcc alternative mappings for s1 constants
Matt Arsenault [Tue, 1 Oct 2019 02:07:19 +0000 (02:07 +0000)]
AMDGPU/GlobalISel: Allow scc/vcc alternative mappings for s1 constants

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373295 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Handle llvm.read_register
Matt Arsenault [Tue, 1 Oct 2019 02:07:16 +0000 (02:07 +0000)]
GlobalISel: Handle llvm.read_register

SelectionDAG has a bunch of machinery to defer this to selection time
for some reason. Just directly emit a copy during IRTranslator. The
x86 usage does somewhat questionably check hasFP, which could depend
on the whole function being at minimum translated.

This does lose the convergent bit if the callsite had it, which may be
a problem. We also lose that in general for intrinsics, which may also
be a problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373294 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Avoid creating shift of 0 in arg lowering
Matt Arsenault [Tue, 1 Oct 2019 01:44:46 +0000 (01:44 +0000)]
AMDGPU/GlobalISel: Avoid creating shift of 0 in arg lowering

This is sort of papering over the fact that we don't run a combiner
anywhere, but avoiding creating 2 instructions in the first place is
easy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373293 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTLI: Remove DAG argument from getRegisterByName
Matt Arsenault [Tue, 1 Oct 2019 01:44:39 +0000 (01:44 +0000)]
TLI: Remove DAG argument from getRegisterByName

Replace with the MachineFunction. X86 is the only user, and only uses
it for the function. This removes one obstacle from using this in
GlobalISel. The other is the more tolerable EVT argument.

The X86 use of the function seems questionable to me. It checks hasFP,
before frame lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373292 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)
Fangrui Song [Tue, 1 Oct 2019 01:31:15 +0000 (01:31 +0000)]
[llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)

D68110 added --arch-specific (supported by GNU readelf) and made
--arm-attributes an alias for it. The tests were later migrated to use
--arch-specific.

Note, llvm-readelf --arch-specific currently just uses llvm-readobj
style output for ARM attributes. The readelf-style output is not
implemented.

Reviewed By: compnerd, kongyi, rupprecht

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373291 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add test case to show missed opportunity to shrink a constant index to a gather...
Craig Topper [Tue, 1 Oct 2019 01:27:52 +0000 (01:27 +0000)]
[X86] Add test case to show missed opportunity to shrink a constant index to a gather in order to avoid splitting.

Also add a test case for an index that could be shrunk, but
would create a narrow type. We can go ahead and do it we just
need to be before type legalization.

Similar test cases for scatter as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373290 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select G_UADDO/G_USUBO
Matt Arsenault [Tue, 1 Oct 2019 01:23:13 +0000 (01:23 +0000)]
AMDGPU/GlobalISel: Select G_UADDO/G_USUBO

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373288 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Implement widenScalar for G_SITOFP/G_UITOFP sources
Matt Arsenault [Tue, 1 Oct 2019 01:06:48 +0000 (01:06 +0000)]
GlobalISel: Implement widenScalar for G_SITOFP/G_UITOFP sources

Legalize 16-bit G_SITOFP/G_UITOFP for AMDGPU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373287 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Legalize G_GLOBAL_VALUE
Matt Arsenault [Tue, 1 Oct 2019 01:06:43 +0000 (01:06 +0000)]
AMDGPU/GlobalISel: Legalize G_GLOBAL_VALUE

Handle other cases besides LDS. Mostly a straight port of the existing
handling, without the intermediate custom nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373286 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDebugInfo: Add parsing support for debug_loc base address specifiers
David Blaikie [Tue, 1 Oct 2019 00:29:13 +0000 (00:29 +0000)]
DebugInfo: Add parsing support for debug_loc base address specifiers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373278 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyLibCalls] Define the value of the Euler number
Evandro Menezes [Mon, 30 Sep 2019 23:21:02 +0000 (23:21 +0000)]
[SimplifyLibCalls] Define the value of the Euler number

This patch fixes the build break on Windows hosts.

There must be a better way of accessing the equivalent POSIX math constant
`M_E`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373274 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDebugInfo: Simplify section label caching/usage
David Blaikie [Mon, 30 Sep 2019 23:19:10 +0000 (23:19 +0000)]
DebugInfo: Simplify section label caching/usage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373273 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd partial bswap test to the X86 backend. NFC
Amaury Sechet [Mon, 30 Sep 2019 22:52:28 +0000 (22:52 +0000)]
Add partial bswap test to the X86 backend. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373271 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Clang format MatchRotate. NFC
Amaury Sechet [Mon, 30 Sep 2019 21:41:52 +0000 (21:41 +0000)]
[DAGCombiner] Clang format MatchRotate. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373269 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove else-after-return
David Blaikie [Mon, 30 Sep 2019 21:02:06 +0000 (21:02 +0000)]
Remove else-after-return

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373266 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[bugpoint] Update runPasses to take ArrayRef instead of a pointer (NFC)
Florian Hahn [Mon, 30 Sep 2019 21:00:50 +0000 (21:00 +0000)]
[bugpoint] Update runPasses to take ArrayRef instead of a pointer (NFC)

This makes it slightly easier to pass extra arguments to runPasses
and simplifies the code slightly.

Reviewers: efriedma, bogner, dblaikie, diegotf, hiraditya

Reviewed By: dblaikie, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373265 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[globalisel][knownbits] Allow targets to call GISelKnownBits::computeKnownBitsImpl()
Daniel Sanders [Mon, 30 Sep 2019 20:55:53 +0000 (20:55 +0000)]
[globalisel][knownbits] Allow targets to call GISelKnownBits::computeKnownBitsImpl()

Summary:
It seems we missed that the target hook can't query the known-bits for the
inputs to a target instruction. Fix that oversight

Reviewers: aditya_nandakumar

Subscribers: rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373264 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ConstantFolding] Fold constant calls to log2()
Evandro Menezes [Mon, 30 Sep 2019 20:53:23 +0000 (20:53 +0000)]
[ConstantFolding] Fold constant calls to log2()

Somehow, folding calls to `log2()` with a constant was missing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373262 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Expand the simplification of log()
Evandro Menezes [Mon, 30 Sep 2019 20:52:21 +0000 (20:52 +0000)]
[InstCombine] Expand the simplification of log()

Expand the simplification of special cases of `log()` to include `log2()`
and `log10()` as well as intrinsics and more types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373261 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Update MatchRotate so that it returns an SDValue. NFC
Amaury Sechet [Mon, 30 Sep 2019 20:47:23 +0000 (20:47 +0000)]
[DAGCombiner] Update MatchRotate so that it returns an SDValue. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373260 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegacyPassManager] Deprecate the BasicBlockPass/Manager.
Alina Sbirlea [Mon, 30 Sep 2019 20:17:23 +0000 (20:17 +0000)]
[LegacyPassManager] Deprecate the BasicBlockPass/Manager.

Summary:
The BasicBlockManager is potentially broken and should not be used.
Replace all uses of the BasicBlockPass with a FunctionBlockPass+loop on
blocks.

Reviewers: chandlerc

Subscribers: jholewinski, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373254 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agobuild: serialise `LLVM_ENABLE_UNWIND_TABLES` into LLVMConfig
Saleem Abdulrasool [Mon, 30 Sep 2019 20:03:59 +0000 (20:03 +0000)]
build: serialise `LLVM_ENABLE_UNWIND_TABLES` into LLVMConfig

Serialize the value of the configuration option into the configuration so that
builds which integrate LLVM can identify the value of the flag that was used to
build the libraries.  This is intended to be used by Swift to control tests
which rely on the unwind information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373253 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FunctionAttrs] Added noalias for memccpy/mempcpy arguments
David Bolvansky [Mon, 30 Sep 2019 19:43:48 +0000 (19:43 +0000)]
[FunctionAttrs] Added noalias for memccpy/mempcpy arguments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373251 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine][NFC] visitShl(): call SimplifyQuery::getWithInstruction() once
Roman Lebedev [Mon, 30 Sep 2019 19:16:00 +0000 (19:16 +0000)]
[InstCombine][NFC] visitShl(): call SimplifyQuery::getWithInstruction() once

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373249 91177308-0d34-0410-b5e6-96231b3b80d8