Commit Graph

127128 Commits

Author SHA1 Message Date
Derek Schuff
27751b5287 [MC] Enable eip-relative addressing on x86-64 for X32 ABI
Summary:
Enables eip-based addressing, e.g.,

lea    constant(%eip), %rax
lea    constant(%eip), %eax

in MC, (used for the x32 ABI). EIP-base addressing is also valid in x86_64,
it is left enabled for that architecture as well.

Patch by João Porto

Differential Revision: http://reviews.llvm.org/D16581

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 17:20:04 +00:00
Chad Rosier
808a3d2826 [AArch64] Add a FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 15:22:55 +00:00
Chad Rosier
bba05d1386 [AArch64] Allocate the modified and used regs only once per function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 15:02:30 +00:00
JF Bastien
38cce322fb WebAssembly: update expected GCC torture test failures
The 3 programs used __attribute__((mode(?))) on enum, which clang r259497 fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 14:27:34 +00:00
Oliver Stannard
9ed9eb72f4 Refactor backend diagnostics for unsupported features
Re-commit of r258951 after fixing layering violation.

The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.

There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 13:52:43 +00:00
Simon Pilgrim
b5a988525a [X86][AVX512] Add support for AVX512 VMOVQ (load) shuffle decoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 13:32:56 +00:00
JF Bastien
7f5fe827a0 WebAssembly: add option to disable register coloring
Having this hidden option makes it easier to debug other issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 09:30:01 +00:00
Sjoerd Meijer
fc1e90c277 Removed FeatureVFPOnlySP from the Cortex-R7 processor model
description and changed the regression test accordingly.
The default configuration of a Cortex-R7 is to implement the
VFPv3-D16 architecture and the feature line as it was is too
restrictive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 09:28:20 +00:00
David Majnemer
a101dc9a9c [RegisterCoalescer] Better DebugLoc for reMaterializeTrivialDef
When rematerializing a computation by replacing the copy, use the copy's
location.  The location of the copy is more representative of the
original program.

This partially fixes PR10003.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 06:41:55 +00:00
Chandler Carruth
d3ec736574 [LCG] Build an edge abstraction for the LazyCallGraph and use it to
differentiate between indirect references to functions an direct calls.

This doesn't do a whole lot yet other than change the print out produced
by the analysis, but it lays the groundwork for a very major change I'm
working on next: teaching the call graph to actually be a call graph,
modeling *both* the indirect reference graph and the call graph
simultaneously. More details on that in the next patch though.

The rest of this is essentially a bunch of over-engineering that won't
be interesting until the next patch. But this also isolates essentially
all of the churn necessary to introduce the edge abstraction from the
very important behavior change necessary in order to separately model
the two graphs. So it should make review of the subsequent patch a bit
easier at the cost of making this patch seem poorly motivated. ;]

Differential Revision: http://reviews.llvm.org/D16038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 03:57:13 +00:00
Philip Reames
bf09bb7151 [LVI] Introduce an intersect operation on lattice values
LVI has several separate sources of facts - edge local conditions, recursive queries, assumes, and control independent value facts - which all apply to the same value at the same location. The existing implementation was very conservative about exploiting all of these facts at once.

This change introduces an "intersect" function specifically to abstract the action of picking a good set of facts from all of the separate facts given. At the moment, this function is relatively simple (i.e. mostly just reuses the bits which were already there), but even the minor additions reveal the inherent power. For example, JumpThreading is now capable of doing an inductive proof that a particular value is always positive and removing a half range check.

I'm currently only using the new intersect function in one place. If folks are happy with the direction of the work, I plan on making a series of small changes without review to replace mergeIn with intersect at all the appropriate places.

Differential Revision: http://reviews.llvm.org/D14476




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 03:15:40 +00:00
Kostya Serebryany
485551ecaf [libFuzzer] allow passing 1 or more files as individual inputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 03:03:47 +00:00
Matthias Braun
6aca1f7711 MachineVerifier: Use report_context() instead of ad-hoc messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 02:44:25 +00:00
Sanjoy Das
d1f5b8553b [X86] Fix a bug in getMemOpBaseRegImmOfs
Fix a crash in `getMemOpBaseRegImmOfs` that happens if the base of
`MemOp` is a frame index memory operand.  The fix is to have
`getMemOpBaseRegImmOfs` bail out in such cases.  We can possibly be more
clever here, if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 02:32:43 +00:00
Kostya Serebryany
05de8e95f6 [libFuzzer] fail if the corpus dir does not exist
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 02:07:26 +00:00
Ahmed Bougacha
ddad6c7a5d [X86][FastISel] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.
FastISel counterpart to r259448.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 01:44:03 +00:00
Ahmed Bougacha
b080ff471d [X86] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.
Officially, we don't acknowledge non-default configurations of MXCSR,
as getting there would require usage of the FENV_ACCESS pragma (at
least insofar as rounding mode is concerned).

We don't support the pragma, so we can assume that the default
rounding mode - round to nearest, ties to even - is always used.

However, it's inconsistent with the rest of the instruction set,
where MXCSR is always effective (unless otherwise specified).
Also, it's an unnecessary obstacle to the few brave souls that use
fenv.h with LLVM.

Avoid the hard-coded rounding mode for fp_to_f16; use MXCSR instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 01:32:50 +00:00
Anna Zaks
59203823d7 [safestack] Make sure the unsafe stack pointer is popped in all cases
The unsafe stack pointer is only popped in moveStaticAllocasToUnsafeStack so it won't happen if there are no static allocas.

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

Differential Revision: http://reviews.llvm.org/D16339

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 01:03:11 +00:00
Philip Reames
b4e775c587 [LVI] Fix a latent bug in getValueAt
This routine was returning Undefined for most queries.  This was utterly wrong.  Amusingly, we do not appear to have any callers of this which are actually trying to exploit unreachable code or this would have broken the world.

A better approach would be to explicit describe the intersection of facts.  That's blocked behind http://reviews.llvm.org/D14476 and I wanted to fix the current bug.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 00:45:30 +00:00
Sanjay Patel
c0e338f886 fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 23:53:35 +00:00
Philip Reames
1790b51617 [LVI] Missing test case from 259432
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 23:44:38 +00:00
Teresa Johnson
9ee303a931 Add test for PR26419 (stable function summary ordering)
Enhance an existing test to also check that the ordering of the function
summary entries is stable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259434 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 23:26:30 +00:00
Philip Reames
9d1fe7a916 [LVI] Remove overly tight assert from 259429
I'll submit a test case shortly which covers this, but it's causing clang self host problems in the builders so I wanted to get it removed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 23:21:11 +00:00
Simon Pilgrim
f939e55b79 [X86][AVX512] Add support for AVX512 VMOVD (load) shuffle decoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 23:04:05 +00:00
Philip Reames
2b06e7376a [LVI] Add select handling
Teach LVI to handle select instructions in the exact same way it handles PHI nodes.  This is useful since various parts of the optimizer convert PHI nodes into selects and we don't want these transformations to cause inferior optimization.  

Note that this patch does nothing to exploit the implied constraint on the inputs represented by the select condition itself.  That will be a later patch and is blocked on http://reviews.llvm.org/D14476



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:57:53 +00:00
Simon Pilgrim
62167016ad [X86][AVX512] Add support for AVX512 VMOVSD/VMOVSS shuffle decoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:26:28 +00:00
Sanjay Patel
7d0cdb4a10 function names start with a lowercase letter; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:23:39 +00:00
Sanjay Patel
633f0ac7dd [InstCombine] simplify masked scatter/gather intrinsics with zero masks
A masked scatter with a zero mask means there's no store.
A masked gather with a zero mask means the passthru arg is returned.

This is a continuation of:
http://reviews.llvm.org/rL259369
http://reviews.llvm.org/rL259392



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:10:26 +00:00
Simon Pilgrim
bf61370133 [X86][AVX512] Add support for AVX512 VINSERTPS shuffle decoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:05:50 +00:00
Matthias Braun
c2d3726c27 SmallSet/SmallPtrSet: Refuse huge Small numbers
These sets do linear searching in small mode; It is not a good idea to
use huge numbers as the small value here, save people from themselves by
adding a static_assert.

Differential Revision: http://reviews.llvm.org/D16706

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:05:16 +00:00
Simon Pilgrim
e4dee6b8a8 [X86][SSE] Regenerated load vector + element extraction tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 21:46:12 +00:00
Chad Rosier
0158ba6445 Move comments a bit closer to associated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 21:38:31 +00:00
Simon Pilgrim
4fa3b7eb6e [X86][SSE] Add AVX512 merge consecutive load tests
Add AVX512F/AVX512BW 512-bit tests.

Add AVX512F tests to existing 128/256-bit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 21:30:50 +00:00
Simon Pilgrim
542af83d53 Regenerate vector blend tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 21:06:32 +00:00
Simon Pilgrim
977381ecb5 Regenerate vector sext/zext constant folding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 21:01:29 +00:00
Jun Bum Lim
da7cbcd8d5 Avoid inlining call sites in unreachable-terminated block
Summary:
If the normal destination of the invoke or the parent block of the call site is unreachable-terminated, there is little point in inlining the call site unless there is literally zero cost. Unlike my previous change (D15289), this change specifically handle the call sites followed by unreachable in the same basic block for call or in the normal destination for the invoke. This change could be a reasonable first step to conservatively inline call sites leading to an unreachable-terminated block while BFI / BPI is not yet available in inliner.

Reviewers: manmanren, majnemer, hfinkel, davidxl, mcrosier, dblaikie, eraman

Subscribers: dblaikie, davidxl, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D16616

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 20:55:11 +00:00
Chad Rosier
540a1fb656 Remove extra semicolon. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 20:54:36 +00:00
Sanjoy Das
6702d23e3c [SCEV] Clean up isKnownPredicateViaConstantRanges; NFCI
- ScalarEvolution::isKnownPredicateViaConstantRanges duplicates some
   logic already present in ConstantRange, use ConstantRange for those
   bits.

 - In some cases ScalarEvolution::isKnownPredicateViaConstantRanges
   returns `false` to mean "definitely false" (e.g. see the
   `LHSRange.getSignedMin().sge(RHSRange.getSignedMax())` case for
   `ICmpInst::ICMP_SLT`), but for `isKnownPredicateViaConstantRanges`,
   `false` actually means "don't know".  Get rid of this extra bit of
   code to avoid confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 20:48:14 +00:00
Sanjoy Das
8a0b3d2eb9 [SCEV] Rename isKnownPredicateWithRanges; NFC
Make it obvious that it uses constant ranges, and use `Via` instead of
`With`, like other similar functions in SCEV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259400 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 20:48:10 +00:00
Rafael Espindola
74894f721a Fix infinite recursion in MCAsmStreamer::EmitValueImpl.
If a target can only emit 8-bits data, we would loop in EmitValueImpl
since it will try to split a 32-bits data in 1 chunk of 32-bits.

No test since all current targets can emit 32bits at a time.

Patch by Alexandru Guduleasa!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 20:36:49 +00:00
Teresa Johnson
59e213f5f1 [ThinLTO] Ensure function summary output order is stable
Iterate over the function list instead of a DenseMap of Function pointers
when emitting the function summary into the module.

This fixes PR26419.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 20:16:35 +00:00
Rafael Espindola
e361154a0d Add a test for r258362.
Thanks to Mehdi for finding it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 19:56:12 +00:00
Sanjay Patel
5db289a3a3 [InstCombine] simplify masked store intrinsics with all ones or zeros masks
A masked store with a zero mask means there's no store.
A masked store with an allOnes mask means it's a normal vector store.

This is a continuation of:
http://reviews.llvm.org/rL259369



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 19:39:52 +00:00
Davide Italiano
88b3e3ebd1 [llvm-nm] Simplify the code a bit. NFCI.
Fix a style violation while I'm here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 19:22:16 +00:00
Balaram Makam
60101204f1 AArch64: Implement missed conditional compare sequences.
Summary:
This is an extension to the existing implementation of r242436 which
restricts to only select inputs. This version fixes missed opportunities
in pr26084 by attempting to lower conditional compare sequences of
and/or trees with setcc leafs. This will additionaly handle the case
when a tree with select input is not a conjunction-disjunction tree
but some of the sub trees are conjunction-disjunction trees.

Reviewers: jmolloy, t.p.northover, mcrosier, MatzeB

Subscribers: mcrosier, llvm-commits, junbuml, haicheng, mssimpso, gberry

Differential Revision: http://reviews.llvm.org/D16291

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 19:13:07 +00:00
Matthew Simpson
7f7276a903 Add test case missing from r259357 (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 19:09:24 +00:00
Geoff Berry
72f115a782 [AArch64] Simplify prolog/epilog callee save/restore. NFC.
Summary:
Factor out common code for callee-save register pair calculation.  This
is intended to simplify follow-on changes that reduce the number of
registers saved/restored.

Depends on D16732

Reviewers: mcrosier, jmolloy, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D16734

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 19:07:06 +00:00
Ulrich Weigand
e35dc719bb [SystemZ] Fix wrong-code generation for certain always-false conditions
We've found another bug in the code generation logic conditions for a
certain class of always-false conditions, those of the form
   if ((a & 1) < 0)

These only reach the back end when compiling without optimization.

The bug was introduced by the choice of using TEST UNDER MASK
to implement a check for
   if ((a & MASK) < VAL)
as
   if ((a & MASK) == 0)

where VAL is less than the the lowest bit of MASK.  This is correct
in all cases except for VAL == 0, in which case the original
condition is always false, but the replacement isn't.

Fixed by excluding that particular case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 18:31:19 +00:00
Colin LeMahieu
83948c56bd [NFC] Referencing manual for reason why subregbit is checked
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 18:15:39 +00:00
Sanjay Patel
16d21f4524 fix broken check lines
Without the colon, it doesn't mean anything!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 17:46:18 +00:00