Commit Graph

127100 Commits

Author SHA1 Message Date
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
David Majnemer
2291a38a78 [InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y)
This miscompile came about because we tried to use a transform which was
only appropriate for xor operators when addition was present.

This fixes PR26407.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 17:37:56 +00:00
Jun Bum Lim
d9e550023c [ValueTracking] Improve isKnownNonZero for PHI of non-zero constants
It is clear that a PHI is a non-zero if all incoming values are non-zero constants.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 17:00:10 +00:00
Geoff Berry
f4cc19cd22 [PrologEpilogInserter] Add some debug output for callee-save frame object allocation
Reviewers: mcrosier

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 16:47:51 +00:00
Geoff Berry
76392006f3 [AArch64] Simplify callee-save register save/restore. NFC.
Summary:
Simplify callee-save register save/restore code generation by
remembering the size of the callee-save area when it is computed so we
don't have to scan the prologue/epilogue instructions again later to
reconstruct it.

This is intended to simplify follow-on changes that reduce the number of
registers saved/restored.

Reviewers: mcrosier, jmolloy, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 16:29:19 +00:00
Matthew Simpson
54a309e4ea [LV] Rename RdxPHIsToFix to PHIsToFix (NFC)
In the future, we will vectorize recurrences other than reductions. This patch
renames a few variables and updates their associated comments to enable them to
be reused for non-reduction PHI nodes.

This change was requested in the review for D16197.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 16:07:01 +00:00
Asaf Badouh
5d45520a5a [X86][AVX512VBMI] add encoding and intrinsics for Multishift
Differential Revision: http://reviews.llvm.org/D16399



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 15:48:21 +00:00
Vasileios Kalintiris
971da99388 [mips] Split large test file into 3 smaller ones.
Remove the old select.ll file and use select-int.ll, select-flt.ll,
select-dbl.ll for testing selects on integers, floats & doubles respectivelly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259361 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 15:19:35 +00:00
Daniel Sanders
86c1c7c850 [mips] Range check uimm16 and fix several bugs this revealed.
Summary:
The bugs were:
* teq and similar take 4-bit unsigned immediates on microMIPS.
* teqi and similar have side-effects like teq do.
* shll_s.w and shra_r.w take 5-bit unsigned immediates.
* The various DSP ext* instructions take a 5-bit immediate.
* repl.qh takes an 8-bit unsigned immediate.
* repl.ph takes a 10-bit unsigned immediate.
* rddsp/wrdsp take a 10-bit unsigned immediate.
* teqi and similar take signed 16-bit immediates (10-bit for microMIPS).
* Out-of-range immediate macros for or/xor take a simm32/simm64 depending
  on architecture. I'll fix the simm64 case properly when I reach simm32.

lui is a bit more lenient than GAS and accepts signed immediates in addition
to unsigned. This is because MipsMCExpr can produce signed values when
constant folding and it currently lacks a way of knowing it should fold to
an unsigned value.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 15:13:31 +00:00
Amjad Aboud
71a555ed90 Improved macro emission in dwarf.
Changed emitting offset of macinfo entry into compiler unit DIE to use "addSectionLabel" method rather than explicitly calculating size/offset of macro entry.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 14:09:41 +00:00
Matthew Simpson
5c7e8a999b Reapply commit r258404 with fix.
The previous patch caused PR26364. The fix is to ensure that we don't enter a
cycle when iterating over use-def chains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 13:38:29 +00:00
JF Bastien
fff4c9ce47 WebAssembly NFC: simplify control flow
This should now be easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 10:46:16 +00:00
Ewan Crawford
75bd8f859d DWARF RenderScript vendor extension
Patch adds a DWARF language vendor extension for RenderScript.
We are already using this identifier in LLDB with a hard coded value, so it's preferable to use a LLVM generated enum instead.
The language is intended to be added to the next version of the standard.
See http://www.dwarfstd.org/ShowIssue.php?issue=150331.1

Reviewers:  dexonsmith, echristo
Subscribers: probinson domipheus, srhines, llvm-commits
Differential Revision: http://reviews.llvm.org/D16409


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 10:39:24 +00:00
Igor Breger
b45844b2a2 AVX512: fix mask handling for gather/scatter/prefetch intrinsics.
Differential Revision: http://reviews.llvm.org/D16755

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 09:57:15 +00:00
Simon Pilgrim
dbf62e3ecd [X86][SSE] Find source of the inserted element of INSERTPS
Minor patch to trace back through target shuffles to the source of the inserted element in a (V)INSERTPS shuffle.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 08:59:30 +00:00
Igor Breger
36ce38c0f5 AVX512 : Fix SETCCE lowering for KNL 32 bit.
Differential Revision: http://reviews.llvm.org/D16752

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 07:56:09 +00:00
Frederic Riss
870f3ff0d2 [dsymutil] Skip mach-o paired relocations
Noticed while working on scattered relocations.
I do not think these relocs can actually happen in the debug_info section,
but if they happen the code would mishandle them. Explicitely skip them
and warn if we encounter one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 04:43:14 +00:00
David Majnemer
8eacdc2001 [X86] Cleanup the WinEHState pass
Remove unnecessary includes and class state.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 04:28:59 +00:00
Frederic Riss
f768b25cef [dsymutil] Support scattered relocs.
Although it seems like clang will never emit scattered relocations in
the debug information (at least I couldn't find a way), we have too
support them for the benefit of other compilers.
As clang doesn't generate them, the included testcase was produced
from hacked up assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 03:44:22 +00:00
David Majnemer
25f74b9089 Revert r258580 and r258581.
Those commits created an artificial edge from a cleanup to a synthesized
catchswitch in order to get the MSVC personality routine to execute
cleanups which don't cleanupret and are not wrapped by a catchswitch.

This worked well enough but is not a complete solution in situations
where there the cleanup infinite loops.

However, the real deal breaker behind this approach comes about from a
degenerate case where the cleanup is post-dominated by unreachable *and*
throws an exception.  This ends poorly because the catchswitch will
inadvertently catch the exception.

Because of this we should go back to our previous behavior of not
executing certain cleanups (identical behavior with the Itanium ABI
implementation in clang, GCC and ICC).

N.B. I think this could be salvaged by making the catchpad rethrow the
exception and properly transforming throwing calls in the cleanup into
invokes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 03:29:38 +00:00
Craig Topper
3f0462d7e0 [TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accidentally copying to a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 01:33:42 +00:00
Frederic Riss
f87dc438fd [MCDwarf] Fix encoding of line tables with weird custom parameters
With poorly chosen custom parameters, the line table encoding logic would
sometimes end up generating a special opcode bigger than 255, which is wrong.
The set of default parameters that LLVM uses isn't subject to this bug.

When carefully chosing the line table parameters, it's impossible to fall into the
corner case that this patch fixes. The standard however doesn't require that these
parameters be carefully chosen. And even if it did, we shouldn't generate broken
encoding.

Add a unittest for this specific encoding bug, and while at it, create some unit
tests for the encoding logic using different sets of parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 22:06:35 +00:00
Craig Topper
de7763c85d Remove utostr_32 as it has no uses anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 20:00:26 +00:00
Craig Topper
78709b8c2e Replace usages of llvm::utostr_32 with just llvm::utostr. While this is less efficient, its unclear the few places that were using the _32 version were doing so for efficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 20:00:24 +00:00
Craig Topper
2b9504417f Merge utohex_buffer into utohexstr, it's only caller. Also change utohexstr to use the std::string constructor that takes a start and end pointer. This saves a call to strlen. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 20:00:22 +00:00
Sanjay Patel
8ae9283986 add helper function for minnum/maxnum ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:35:23 +00:00
Sanjay Patel
1b85558809 use range-based for loop; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:34:48 +00:00
Sanjay Patel
8f8429c590 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:34:11 +00:00