Commit Graph

78969 Commits

Author SHA1 Message Date
Jingyue Wu
412b6fc7b9 [SeparateConstOffsetFromGEP] garbage-collect intermediate instructions
Summary: so that we needn't run DCE after this pass.

Test Plan: removed -dce from the commandline in split-gep.ll and split-gep-and-gvn.ll

Reviewers: meheff

Subscribers: llvm-commits, HaoLiu, hfinkel, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235409 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 19:53:18 +00:00
Yaron Keren
dc96507f1f Remove FilesToRemove->push_back(Filename) from sys::DontRemoveFileOnSignal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235408 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 19:25:11 +00:00
Daniel Berlin
29dbbd73de Move IDF Calculation to a separate file, expose an interface to it.
Summary:
MemorySSA uses this algorithm as well, and this enables us to reuse the code in both places.

There are no actual algorithm or datastructure changes in here, just code movement.

Reviewers: qcolombet, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235406 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 19:13:02 +00:00
Duncan P. N. Exon Smith
7f892716df DebugInfo: Drop rest of DIDescriptor subclasses
Delete the remaining subclasses of (the already deleted) `DIDescriptor`.
Part of PR23080.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235404 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 18:44:06 +00:00
Duncan P. N. Exon Smith
43eab6bce0 DebugInfo: Assert dbg.declare/value insts are valid
Remove early returns for when `getVariable()` is null, and just assert
that it never happens.  The Verifier already confirms that there's a
valid variable on these intrinsics, so we should assume the debug info
isn't broken.  I also updated a check for a `!dbg` attachment, which the
Verifier similarly guarantees.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235400 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 18:24:23 +00:00
Reid Kleckner
405cc64eac Re-land r235154-r235156 under the existing -sehprepare flag
Keep the old SEH fan-in lowering on by default for now, since projects
rely on it.  This will make it easy to test this change with a simple
flag flip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 18:23:57 +00:00
Matthias Braun
9e0a1565b9 X86: Match for X86ISD nodes in LowerBUILD_VECTOR instead of BUILD_VECTORCombine
There doesn't seem to be a reason to perform this target ISD node matching
in an DAGCombine, moving it to lowering fixes PR23296.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235394 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 17:21:36 +00:00
Elena Demikhovsky
bf704ed348 AVX-512: Added VPMOVx2M instructions for SKX,
fixed encoding of VPMOVM2x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 14:38:31 +00:00
Elena Demikhovsky
695922de3d AVX-512: Added VPTESTM and VPTESTNM instructions for SKX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 13:13:46 +00:00
Toma Tabacu
203a9224ff [mips] [IAS] Implement the .asciiz directive.
Summary:
This directive is exactly the same as .asciz, except it's only used by MIPS.
It is used to store null terminated strings in object files.

Reviewers: rafael, dsanders, echristo

Reviewed By: dsanders, echristo

Subscribers: echristo, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235382 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 11:50:52 +00:00
Jozef Kolek
c589d1b3bc [mips][microMIPSr6] Implement CACHE and PREF instructions
Implement CACHE and PREF instructions using mapping.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235379 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 11:17:25 +00:00
Vasileios Kalintiris
6cd90d3b21 [mips] Cleanup old floating-point flag conditions definitions. NFC.
Reviewers: dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235377 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 10:53:57 +00:00
Vasileios Kalintiris
d72ba1af57 [mips] Optimize code generation for 64-bit variable shift instructions.
Summary:
The 64-bit version of the variable shift instructions uses the
shift_rotate_reg class which uses a GPR32Opnd to specify the variable
shift amount. With this patch we avoid the generation of a redundant
SLL instruction for the variable shift instructions in 64-bit targets.

Reviewers: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235376 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 10:49:03 +00:00
Elena Demikhovsky
a1fa0de258 AVX-512: Added logical and arithmetic instructions for SKX
by Asaf Badouh (asaf.badouh@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 10:27:40 +00:00
Simon Pilgrim
01eaaa72bf [X86][SSE] Provide execution domains for scalar floating point operations
This is an updated version of Chandler's patch D7402 that got accepted but never committed, and has bit-rotted a bit since.

I've updated the execution domain declarations to match the approach of the packed templates and also added some extra scalar unary tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235372 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 08:40:22 +00:00
Simon Pilgrim
d2f0700f15 CONCAT_VECTOR of BUILD_VECTOR - minor fix
Fixed issue with the combine of CONCAT_VECTOR of 2 BUILD_VECTOR nodes - the optimisation wasn't ensuring that the scalar operands of both nodes were the same type/size for implicit truncation.

Test case spotted by Patrik Hagglund

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235371 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 08:05:43 +00:00
Pawel Bylica
775c174b7b Fix generic shift expansion when shift amount is 0
Summary:
This fixes http://llvm.org/bugs/show_bug.cgi?id=16439. 

This is one possible way to approach this. The other would be to split InL>>(nbits-Amt) into (InL>>(nbits-1-Amt))>>1, which is also valid since since we only need to care about Amt up nbits-1. It's hard to tell which one is better since the shift might be expensive if this stage of expansion is not yet a legal machine integer, whereas comparisons with zero are relatively cheap at all sizes, but more expensive than a shift if the shift is on a legal machine type. 

Patch by Keno Fischer!

Test Plan: regression test from http://reviews.llvm.org/D7752

Reviewers: chfast, resistor

Reviewed By: chfast, resistor

Subscribers: sanjoy, resistor, chfast, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235370 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 06:28:36 +00:00
Matthias Braun
6fbedc4cfd X86: Do not select X86 custom vector nodes if operand types don't match
X86ISD::ADDSUB, X86ISD::(F)HADD, X86ISD::(F)HSUB should not be selected
if the operand types do not match the result type because vector type
legalization cannot deal with this for custom nodes.

Testcase X86ISD::ADDSUB is attached. I could not create a testcase for
the FHADD/FHSUB cases because of: https://llvm.org/bugs/show_bug.cgi?id=23296

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235367 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 01:13:41 +00:00
Derek Schuff
a49508cb92 [MC] When using bundle aligment, align sections to bundle size
Summary:
Bundle aligment requires that the functions always start at an aligned address.
Usually this is ensured by the compiler, but assembly code does not always
begin with a .align directive.

This change ensures that sections get the correct alignment if they contain
any instructions and bundling is enabled. (It also makes LLVM match the
behavior of GNU as).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 00:14:25 +00:00
Fiona Glaser
b5750565de InstCombine: fold (sitofp (zext x)) to (uitofp x)
This is okay because the zext guarantees the high bit is zero,
and so the value is unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 00:05:41 +00:00
Andrew Kaylor
e0b5195703 [WinEH] Fix problem with landing pad return values used in PHI nodes during outlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235358 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 22:53:42 +00:00
Duncan P. N. Exon Smith
d3c29ac587 DebugInfo: Delete subclasses of DIScope
Delete subclasses of (the already defunct) `DIScope`, updating users to
use the raw pointers from the `Metadata` hierarchy directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 22:10:08 +00:00
Andrew Kaylor
e0d6a5c90a [WinEH] Fix problem with mapping shared empty handler blocks.
Differential Revision: http://reviews.llvm.org/D9125



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 22:04:09 +00:00
Duncan P. N. Exon Smith
92b3bf95a1 DebugInfo: Delete old subclasses of DIType
Delete subclasses of (the already deleted) `DIType` in favour of
directly using pointers from the `Metadata` hierarchy.

While `DICompositeType` wraps `MDCompositeTypeBase` and `DIDerivedType`
wraps `MDDerivedTypeBase`, most uses of each really meant the more
specific `MDCompositeType` and `MDDerivedType`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 21:17:32 +00:00
Duncan P. N. Exon Smith
80608c5d42 DwarfUnit: Split MDSubroutineType version of constructTypeDIE()
The version of `constructTypeDIE()` for `MDSubroutineType` is unrelated
to (and has different callers than) the `MDCompositeType`.  Split the
two in half.

This simplifies an upcoming patch to delete `DICompositeType`.  There
shouldn't be any real functionality change here.  `createTypeDIE()` is
`cast<>`'ing where it didn't need to before, but that function in turn
is only called for true `MDCompositeType`s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235349 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 21:04:33 +00:00
Lang Hames
302f000bf4 [Orc] Make the makeStub function propagate argument attributes onto the call to
the function body.

This is necessary for correctness when lazily compiling.

Also, flesh out the Orc unit test infrastructure slightly, and add a unit test
for this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235347 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 20:41:45 +00:00
Duncan P. N. Exon Smith
878f959d7f DwarfUnit: Cleanup comments
Update comment style in `DwarfUnit`.

  - Drop duplicated comments at definition, and update the comments at
    the declaration where the definition comments looked newer or more
    complete.
  - Drop the `functionName -` prefix.
  - Add `\brief` in a few places.
  - Remove a few comments entirely that weren't adding value (just
    turned the function name and arguments into a sentence).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 20:29:51 +00:00
Olivier Sallenave
d153d3d8cc Refactoring and enhancement to FMA combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235344 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 20:29:40 +00:00
Pirama Arumuga Nainar
9d1b182f81 [MIPS] OperationAction for FP_TO_FP16, FP16_TO_FP
Summary:
Set operation action for FP16 conversion opcodes, so the Op legalizer
can choose the gnu_* libcalls for Mips.

Set LoadExtAction and TruncStoreAction for f16 scalars and vectors to
prevent (fpext (load )) and (store (fptrunc)) from getting combined into
unsupported operations.

Added test cases to test that these operations are handled correctly
for f16 scalars and vectors.  This patch depends on
http://reviews.llvm.org/D8755.

Reviewers: srhines

Subscribers: llvm-commits, ab

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 20:15:36 +00:00
Tom Stellard
4eccd9814f DAGCombine: Remove redundant NaN checks around ISD::FSQRT
This folds:

(select (setcc x, -0.0, *lt), NaN, (fsqrt x)) -> ( fsqrt x)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 19:38:27 +00:00
Tom Stellard
eb963a5f2a IR: Add ConstantFP::getNaN()
This is a wrapper around APFloat::getNaN().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 19:38:24 +00:00
Duncan P. N. Exon Smith
91ad62302f DebugInfo: Remove DIType
This is the last major parent class, so I'll probably start deleting
classes in batches now.  Looks like many of the references to the DI*
hierarchy were updated organically along the way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 18:52:06 +00:00
Andrew Kaylor
9cc1f32626 [WinEH] Fix memory leak with catch-all mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 18:48:45 +00:00
Duncan P. N. Exon Smith
b54df5252a DebugInfo: Remove DIScope
Replace uses of `DIScope` with `MDScope*`.  There was one spot where
I've left an `MDScope*` uninitialized (where `DIScope` would have been
default-initialized to `nullptr`) -- this is intentional, since the
if/else that follows should unconditional assign it to a value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 18:32:29 +00:00
Lang Hames
4943838e28 [Orc] Use the 64-bit versions of FXSAVE/FXRSTOR for JIT reentry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 18:25:44 +00:00
Duncan P. N. Exon Smith
59abfa10b7 DebugInfo: Remove typedefs for DITypeRef, etc.
Remove typedefs for type refs:

  - DITypeRef => MDTypeRef
  - DIScopeRef => MDScopeRef
  - DIDescriptorRef => DebugNodeRef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235323 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 18:20:03 +00:00
Jozef Kolek
382bee5224 [mips][microMIPSr6] Implement BITSWAP instruction
Implement BITSWAP instruction using mapping.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 18:14:59 +00:00
Vladimir Sukharev
d1e387b9e6 [AArch64] LORID_EL1 register must be treated as read-only
Patch by: John Brawn

Reviewers: jmolloy

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235314 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 16:54:37 +00:00
Akira Hatanaka
ca9313e65e [InlineFunction] Don't add lifetime markers for zero-sized allocas.
This commit fixes the code which adds lifetime markers in InlineFunction to skip
zero-sized allocas instead of asserting on them.

rdar://problem/20531155


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235312 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 16:11:05 +00:00
Brendon Cahoon
d9b36e1007 Recognize n/1 in the SCEV divide function
n/1 generates a quotient equal to n and a remainder of 0.
If this case is not recognized, then the SCEV divide() function
can return a remainder that is greater than or equal to the
denominator, which means the delinearized subscripts for the
test case will be incorrect.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 16:03:28 +00:00
Bill Schmidt
70273be423 [PowerPC] Flow oversized lines for r235309
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235310 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 15:58:46 +00:00
Bill Schmidt
54f902e367 [PowerPC] Add future work for vector insert/extract to README_ALTIVEC.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 15:54:26 +00:00
Jozef Kolek
fc4915076f [mips][microMIPSr6] Implement disassembler support
Implement disassembler support for microMIPS32r6.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235307 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 14:40:38 +00:00
Rafael Espindola
f30ac8f5ec Don't allow pwrite to resize a stream.
The current implementations could exhibit some behavior differences:

raw_fd_ostream: Whatever the underlying fd does with seek+write. In a normal
file, the write position would be back to the old offset.

raw_svector_ostream: The write position is always the end of the stream, so
after pwrite the write position would be the new end. This matches what OS_X
(all BSD?) do with a pwrite in a O_APPEND fd.

Given that we don't need that feature and don't use O_APPEND a lot in LLVM,
just disallow it.

I am open to suggestions on renaming pwrite to something else, but this fixes
the issue for now.

Thanks to Yaron Keren for reporting it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 13:04:30 +00:00
Jozef Kolek
dbef0175c3 [mips][microMIPSr6] Implement BALC and BC instructions
This patch implements BALC and BC instructions using mapping.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 13:04:14 +00:00
Rafael Espindola
ca3837369f Look past locals in comdats.
We have to avoid converting a reference to a global into a reference to a local,
but it is fine to look past a local.

Patch by Vasileios Kalintiris.

I just moved the comment and added thet test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 12:44:06 +00:00
Jozef Kolek
7ab9941632 [mips][microMIPSr6] Implement initial mapping support
Differential Revision: http://reviews.llvm.org/D8387


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235298 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 12:42:08 +00:00
Jozef Kolek
ec47ed84d2 [mips][microMIPSr6] Implement initial subtarget support
Differential Revision: http://reviews.llvm.org/D8386


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 12:23:06 +00:00
Andrea Di Biagio
14fc08301c [X86][FastIsel] Fix assertion failure when selecting int-to-double conversion (PR23273).
This fixes a regression introduced at revision 231243.
The target-independent selection algorithm in FastISel knows how to select
a SINT_TO_FP if the target is SSE but not AVX. That is because on X86, the
tablegen'd 'fastEmit' functions know how to select CVTSI2SSrr and CVTSI2SDrr.

Method X86FastISel::X86SelectSIToFP was therefore working under the
wrong assumption that the target was AVX. That assumption was incorrect since
we can have a target that is neither AVX nor SSE.

So, rather than asserting for the presence of AVX, we should have had an
early exit from 'X86SelectSIToFP' if the target was not AVX.
This patch fixes the issue replacing the invalid assertion with an early exit.

Thanks to Dimitry Andric for reporting this problem and for providing a small
reproducible testcase. Added test pr23273.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 11:56:59 +00:00
Karthik Bhat
b2fd516ed9 [NFC] Refactor identification of reductions as common utility function.
This patch refactors reduction identification code out of LoopVectorizer and
exposes them as common utilities.
No functional change.
Review: http://reviews.llvm.org/D9046



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 04:38:33 +00:00