139238 Commits

Author SHA1 Message Date
George Burgess IV
e602ff91e3 [MSSA] Allow unittests to use BasicAA when building.
We now build MemorySSA in its ctor, instead of waiting until the user
calls MemorySSA::getWalker. This silently changed our unittests, since
we add BasicAA to AAResults *after* constructing MemorySSA (...but
before calling MemorySSA::getWalker).

None of them broke because we do most of our "did this get optimized
correctly?" tests in .ll files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 23:12:35 +00:00
Dan Gohman
3f22f87fb5 [WebAssembly] Update to more stack-machine-oriented terminology.
WebAssembly has officially switched from being an AST to being a stack
machine. Update various bits of terminology and README.md entries
accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:43:53 +00:00
Dan Gohman
bafb9a4eed [WebAssemby] Clean up an obsolete comment.
The comment is present inside the body of GetVRegDef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:32:21 +00:00
Chris Bieneman
6eb10d97ee [lit] Use argparse instead of optparse
Summary:
optparse is deprecated in Python 2.7, which is the minimum version of
Python required to run the LLVM test suite. Replace its usage in lit
with argparse, optparse's 2.7 replacement module.

argparse has several benefits over optparse, but this commit does not
make use of those benefits yet. Instead, it simply uses the new API,
and attempts to keep the number of changes to a minimum.

Confirmed that lit's test suite, as well as LLVM's regression test suite,
still pass with these changes.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz, delcypher

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:12:42 +00:00
Matthias Braun
3d8b8c8458 TargetMachine: Make the win32-macho workaround more specific.
This is to avoid problems with win32 + ELF which surprisingly happens a
lot in practice: If a user just specifies -march on the commandline the
object format changes along with the architecture to ELF in many
instances while the OS stays with the default/host OS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:12:37 +00:00
Dan Gohman
1596f9b429 [WebAssembly] Delete an unused function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:06:28 +00:00
Matthias Braun
6b11127921 Set some tests to an unknown vendor and OS
This avoids llc using the hosts OS/vendor as defaults and triggering
unwanted behaviour in the tests. This should deal with the buildbot
breakages on windows after r283140.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:58:20 +00:00
Mehdi Amini
5c1bdf9245 [LTO] Fix test to not depend on the exact address of symbols, just their linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:40:50 +00:00
Dan Gohman
e2559a883e [WebAssembly] Fix indentation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:33:09 +00:00
Dan Gohman
e0c2ec2a7e [WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.
WebAssembly documentation consistently says "f32" rather than "fp32" to
describe 32-bit floating-point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:31:31 +00:00
Quentin Colombet
0a7ba882e5 [AArch64][RegisterBankInfo] Add getSameKindofOperandsMapping.
Refactor the code so that the same function can be used for all
instructions with all the same operands for up to 3 operands.

This is going to be useful for cast instructions.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:20:13 +00:00
Krzysztof Parzyszek
6f4042b831 [RDF] Fix liveness propagation through shadows
Each shadow only represents data flow that is restricted to its reaching
def. Propagating more than that could lead to spurious register liveness,
resulting in extra (incorrectly) block live-ins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:17:20 +00:00
Matthias Braun
f455558a9f AArch64Subtarget: Remove unused CPUString field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:17:02 +00:00
Matthias Braun
4f52404044 X86: Do not produce GOT relocations on windows
Windows has no GOT relocations the way elf/darwin has. Some people use
x86_64-pc-win32-macho to build EFI firmware; Do not produce GOT
relocations for this target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:11:24 +00:00
Zachary Turner
f378e2727f Add unit tests for StringSwitch.
Differential revision: https://reviews.llvm.org/D25205

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 19:56:50 +00:00
Sanjoy Das
dd99e950f7 [PruneEH] Be correct in the face IPO
This fixes one spot I had missed in r265762.  Credit goes to Philip
Reames for spotting this one!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 19:35:30 +00:00
Mike Aizatsky
aa36ef278b [sancov] using env for better portability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 19:22:05 +00:00
Dehao Chen
ba1158fa75 Refactor LICM pass in preparation for LoopSink pass.
Summary: LoopSink pass uses some common function in LICM. This patch refactor the LICM code to make it usable by LoopSink pass (https://reviews.llvm.org/D22778).

Reviewers: davidxl, danielcdh, hfinkel, chandlerc

Subscribers: hfinkel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283134 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:52:08 +00:00
Konstantin Zhuravlyov
49e7805871 [AMDGPU] Pass optimization level to SelectionDAGISel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:47:26 +00:00
Konstantin Zhuravlyov
1e8f5fd9f8 [AMDGPU] Sign extend AShr when promoting (instead of zero extending)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:29:01 +00:00
Hans Wennborg
61f013c7b7 Jump threading: avoid trying to split edge into landingpad block (PR27840)
Splitting the edge is nontrivial because of the landing pad, and we would
currently assert trying to do it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:18:04 +00:00
Zachary Turner
932630880c Rename Error -> ReportError.
Error conflicts with the llvm::Error datatype, creating
ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:17:18 +00:00
Rafael Espindola
ee3cdffe7e Revert "Use getSize instead of data().size(). NFC."
This reverts commit r283125.

lld needs to be updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:01:10 +00:00
Krzysztof Parzyszek
4fbe7c8ae1 [RDF] Further improve readability of the graph
Print target basic block for a branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 17:54:33 +00:00
Rafael Espindola
1c287c05a6 Use getSize instead of data().size(). NFC.
Also assert isFinalized in getSize(). This just reduces the noise from
another patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 17:49:19 +00:00
Lang Hames
420bc5679c [RTDyld] Fix a bug in RTDyldMemoryManager::deregisterEHFrames.
It should forward to deregisterEHFramesInProcess by default, not
registerEHFramesInProcess.

No test case: I haven't come up with a good way to unit test EH frame
registration yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 17:34:56 +00:00
Krzysztof Parzyszek
d1ed87a667 [RDF] Replace RegisterAliasInfo with target-independent code using lane masks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 17:14:48 +00:00
Sanjay Patel
7b05e5c94e [x86, SSE/AVX] allow 128/256-bit lowering for copysign vector intrinsics (PR30433)
This should fix:
https://llvm.org/bugs/show_bug.cgi?id=30433

There are a couple of open questions about the codegen:
1. Should we let scalar ops be scalars and avoid vector constant loads/splats?
2. Should we have a pass to combine constants such as the inverted pair that we have here?

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 16:38:27 +00:00
Rafael Espindola
da49ba4e37 Don't drop the llvm. prefix when renaming.
If the llvm. prefix is dropped other parts of llvm don't see this as
an intrinsic.  This means that the number of regular symbols depends
on the context the module is loaded into, which causes LTO to abort.

Fixes PR30509.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 15:51:42 +00:00
Sanjay Patel
097e03386e fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 15:18:36 +00:00
Nirav Dave
3e3a0a0307 Prevent out of order HashDirective lexing in AsmLexer.
Retrying after buildbot reset.

To lex hash directives we peek ahead to find component tokens, create a
unified token, and unlex the peeked tokens so the parser does not need
to parse the tokens then. Make sure we do not to lex another hash
directive during peek operation.

This fixes PR28921.

Reviewers: rnk, loladiro

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 13:48:27 +00:00
Matt Arsenault
510a4bca2e AMDGPU: Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 13:06:58 +00:00
Matt Arsenault
82f124302e AMDGPU: Fix missing -verify-machineinstrs in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 12:58:59 +00:00
Simon Pilgrim
d89ff9a37e [X86][SSE] Add PR30371 (shuffle constant folding) test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 12:16:39 +00:00
Volkan Keles
9920e54e99 Add new target hooks for LoadStoreVectorizer
Summary: Added 6 new target hooks for the vectorizer in order to filter types, handle size constraints and decide how to split chains.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, mzolotukhin, wdng, llvm-commits, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 10:31:34 +00:00
Sjoerd Meijer
ec44dc9079 [ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of a
library call to __aeabi_uidivmod. This is an improved implementation of
r280808, see also D24133, that got reverted because isel was stuck in a loop.
That was caused by the optimisation incorrectly triggering on i64 ints, which
shouldn't happen because there is no 64bit hwdiv support; that put isel's type
legalization and this optimisation in a loop. A native ARM compiler and testing
now shows that this is fixed.

Patch mostly by Pablo Barrio.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 10:12:32 +00:00
Alexey Bataev
6fd795dee8 [CodeGen] Adding a test showing the current state of poor code gen of
search loop, by Andrey Tischenko

PR27136 shows failure to hoist constant out of loop. This test is used
as start point to fix the failure: it shows the current state of codegen
and discovers what should be fixed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 07:47:01 +00:00
Chris Bieneman
1184da191c [lit] Throw in unimplemented method (NFC)
Summary:
lit's `OneCommandFileTest` class implements an abstract method that
raises if called. However, it raises by referencing an undefined
symbol. Instead, raise explicitly by throwing a `NotImplementedError`.
This is clearer, and appeases Python linters.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:48:22 +00:00
Chris Bieneman
245ab62a27 [lit] Remove unused imports (NFC)
Reviewers: ddunbar, echristo, beanz

Patch by Brian Gesiak!

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:48:18 +00:00
Chris Bieneman
47cdc1615e [lit] Compare to None using identity, not equality
Summary:
In Python, `None` is a singleton, so checking whether a variable is
`None` may be done with `is` or `is not`. This has a slight advantage
over equiality comparisons `== None` and `!= None`, since `__eq__` may
be overridden in Python to produce sometimes unexpected results.

Using `is None` and `is not None` is also recommended practice in
https://www.python.org/dev/peps/pep-0008:

> Comparisons to singletons like `None` should always be done with `is` or
> `is not`, never the equality operators.

Patch by Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:48:13 +00:00
Konstantin Zhuravlyov
4d2168214e [AMDGPU] Remove unused variables from SIOptimizeExecMasking
Differential Revision: https://reviews.llvm.org/D25110


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:43:22 +00:00
Hal Finkel
dd1b9ba7a3 [PowerPC] Account for the ELFv2 function prologue during branch selection
The PPC branch-selection pass, which performs branch relaxation, needs to
account for the padding that might be introduced to satisfy block alignment
requirements. We were assuming that the first block was at offset zero (i.e.
had the alignment of the function itself), but under the ELFv2 ABI, a global
entry function prologue is added to the first block, and it is a
two-instruction sequence (i.e. eight-bytes long). If the function has 16-byte
alignment, the fact that the first block is eight bytes offset from the start
of the function is relevant to calculating where padding will be added in
between later blocks.

Unfortunately, I don't have a small test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:06:44 +00:00
Craig Topper
8fd6969a8b [AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.
This was accidentally copy and pasted from other Pseudos in the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 02:22:33 +00:00
Craig Topper
7036cb8dbf [X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.
I don't know for sure that we truly needs this, but its the only vector load that isn't rematerializable. Making it consistent allows it to not be a special case in the td files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 02:00:29 +00:00
Simon Pilgrim
a96fb0875d [X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 21:07:58 +00:00
Sanjoy Das
4f64dd990d [SCEV] Rely on ConstantRange instead of custom logic; NFCI
This was first landed in rL283058 and subsequenlty reverted since a
change this depends on (rL283057) was buggy and had to be reverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283079 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 20:59:10 +00:00
Sanjoy Das
53936b83aa [ConstantRange] Make getEquivalentICmp smarter
This change teaches getEquivalentICmp to be smarter about generating
ICMP_NE and ICMP_EQ predicates.

An earlier version of this change was landed as rL283057 which had a
use-after-free bug.  This new version has a fix for that bug, and a (C++
unittests/) test case that would have triggered it rL283057.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 20:59:05 +00:00
Simon Pilgrim
630a87ab49 [X86][AVX2] Missed opportunities to combine to VPERMD/VPERMPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 20:43:02 +00:00
Simon Pilgrim
bb9190f8fa [X86][AVX2] Fix typo in test names
We are testing vpermps not vpermd

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 19:31:58 +00:00
Yaron Keren
c36f8001d2 Rangify for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283074 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 19:21:41 +00:00