oota-llvm.git
9 years ago[TableGen] Use cast instead of dyn_cast where result isn't checked before being deref...
Craig Topper [Wed, 22 Apr 2015 02:09:42 +0000 (02:09 +0000)]
[TableGen] Use cast instead of dyn_cast where result isn't checked before being dereferenced.

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

9 years agoCleanup formatting for consistency with surrounding code.
Craig Topper [Wed, 22 Apr 2015 02:09:39 +0000 (02:09 +0000)]
Cleanup formatting for consistency with surrounding code.

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

9 years ago[x86] allow 64-bit extracted vector element integer stores on a 32-bit system
Sanjay Patel [Wed, 22 Apr 2015 00:24:30 +0000 (00:24 +0000)]
[x86] allow 64-bit extracted vector element integer stores on a 32-bit system

With SSE2, we can generate a 'movq' or other 64-bit store op on a 32-bit system
even though 64-bit integers are not legal types.

So instead of producing this:

  pshufd $229, %xmm0, %xmm1      ## xmm1 = xmm0[1,1,2,3]
  movd %xmm0, (%eax)
  movd %xmm1, 4(%eax)

We can do:

  movq %xmm0, (%eax)

This is a fix for the problem noted in D7296.

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

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

9 years ago[WinEH] Correctly handle inlined __finally blocks with captures
Reid Kleckner [Wed, 22 Apr 2015 00:07:52 +0000 (00:07 +0000)]
[WinEH] Correctly handle inlined __finally blocks with captures

We should also teach the inliner to collapse framerecover of
frameaddress of the current frame down to an alloca, but that can happen
later.

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

9 years ago[opaque pointer type] Avoid using PointerType::getElementType for a few cases of...
David Blaikie [Tue, 21 Apr 2015 23:26:57 +0000 (23:26 +0000)]
[opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst

Calls to llvm::Value::mutateType are becoming extra-sensitive now that
instructions have extra type information that will not be derived from
operands or result type (alloca, gep, load, call/invoke, etc... ). The
special-handling for mutateType will get more complicated as this work
continues - it might be worth making mutateType virtual & pushing the
complexity down into the classes that need special handling. But with
only two significant uses of mutateType (vectorization and linking) this
seems OK for now.

Totally open to ideas/suggestions/improvements, of course.

With this, and a bunch of exceptions, we can roundtrip an indirect call
site through bitcode and IR. (a direct call site is actually trickier...
I haven't figured out how to deal with the IR deserializer's lazy
construction of Function/GlobalVariable decl's based on the type of the
entity which means looking through the "pointer to T" type referring to
the global)

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

9 years agoRemove a zero-length file of llvm/test/Transforms/InstCombine/descale-zero.ll.
NAKAMURA Takumi [Tue, 21 Apr 2015 23:14:33 +0000 (23:14 +0000)]
Remove a zero-length file of llvm/test/Transforms/InstCombine/descale-zero.ll.

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

9 years agoLimiting gep merging to fix the performance problem described in
Wei Mi [Tue, 21 Apr 2015 23:02:15 +0000 (23:02 +0000)]
Limiting gep merging to fix the performance problem described in
https://llvm.org/bugs/show_bug.cgi?id=23163.

Gep merging sometimes behaves like a reverse CSE/LICM optimization,
which has negative impact on performance. In this patch we restrict
gep merging to happen only when the indexes to be merged are both consts,
which ensures such merge is always beneficial.

The patch makes gep merging only happen in very restrictive cases.
It is possible that some analysis/optimization passes rely on the merged
geps to get better result, and we havn't notice them yet. We will be ready
to further improve it once we see the cases.

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

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

9 years agoRevert r235451 since it is attached to a wrong Differential Revision. Sorry.
Wei Mi [Tue, 21 Apr 2015 22:56:09 +0000 (22:56 +0000)]
Revert r235451 since it is attached to a wrong Differential Revision. Sorry.

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

9 years agoLimiting gep merging to fix the performance problem described in
Wei Mi [Tue, 21 Apr 2015 22:37:09 +0000 (22:37 +0000)]
Limiting gep merging to fix the performance problem described in
https://llvm.org/bugs/show_bug.cgi?id=23163.

Gep merging sometimes behaves like a reverse CSE/LICM optimizations,
which has negative impact on performance. In this patch we restrict
gep merging to happen only when the indexes to be merged are both consts,
which ensures such merge is always beneficial.

The patch makes gep merging only happen in very restrictive cases.
It is possible that some analysis/optimization passes rely on the merged
geps to get better result, and we havn't notice them yet. We will be ready
to further improve it once we see the cases.

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

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

9 years agoSilence MSVC build alignment warnings
Andrew Kaylor [Tue, 21 Apr 2015 22:29:38 +0000 (22:29 +0000)]
Silence MSVC build alignment warnings

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

9 years ago[MemCpyOpt] Use the raw i8* dest when optimizing memset+memcpy.
Ahmed Bougacha [Tue, 21 Apr 2015 21:28:33 +0000 (21:28 +0000)]
[MemCpyOpt] Use the raw i8* dest when optimizing memset+memcpy.

MemIntrinsic::getDest() looks through pointer casts, and using it
directly when building the new GEP+memset results in stuff like:

  %0 = getelementptr i64* %p, i32 16
  %1 = bitcast i64* %0 to i8*
  call ..memset(i8* %1, ...)

instead of the correct:

  %0 = bitcast i64* %p to i8*
  %1 = getelementptr i8* %0, i32 16
  call ..memset(i8* %1, ...)

Instead, use getRawDest, which just gives you the i8* value.
While there, use the memcpy's dest, as it's live anyway.

In most cases, when the optimization triggers, the memset and memcpy
sizes are the same, so the built memset is 0-sized and eliminated.
The problem occurs when they're different.

Fixes a regression caused by r235232: PR23300.

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

9 years ago[Hexagon] Patterns for frame index with offset for isel
Krzysztof Parzyszek [Tue, 21 Apr 2015 21:28:03 +0000 (21:28 +0000)]
[Hexagon] Patterns for frame index with offset for isel

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

9 years agoUpdate comment. NFC.
Lang Hames [Tue, 21 Apr 2015 21:15:35 +0000 (21:15 +0000)]
Update comment. NFC.

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

9 years agoRevamp PredIteratorCache interface to be cleaner.
Daniel Berlin [Tue, 21 Apr 2015 21:11:50 +0000 (21:11 +0000)]
Revamp PredIteratorCache interface to be cleaner.

Summary:
This lets us use range based for loops.

Reviewers: chandlerc

Subscribers: llvm-commits

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

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

9 years ago[NVPTX] do not run DCE after SLSR and SeparateConstOffsetFromGEP
Jingyue Wu [Tue, 21 Apr 2015 20:47:15 +0000 (20:47 +0000)]
[NVPTX] do not run DCE after SLSR and SeparateConstOffsetFromGEP

Summary:
With D9096 and D9101, there's no need to run DCE after SLSR and
SeparateConstOffsetFromGEP.

Test Plan: no regression

Reviewers: jholewinski, meheff

Subscribers: jholewinski, llvm-commits

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

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

9 years ago[LSR][NFC] Remove a stale comment.
Sanjoy Das [Tue, 21 Apr 2015 20:42:50 +0000 (20:42 +0000)]
[LSR][NFC] Remove a stale comment.

The comment was made stale in r171735.

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

9 years agoDebugInfo: Remove DIArray and DITypeArray typedefs
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 20:07:38 +0000 (20:07 +0000)]
DebugInfo: Remove DIArray and DITypeArray typedefs

Remove the `DIArray` and `DITypeArray` typedefs, preferring the
underlying types (`DebugNodeArray` and `MDTypeRefArray`, respectively).

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

9 years ago[SLSR] garbage-collect unused instructions
Jingyue Wu [Tue, 21 Apr 2015 19:56:18 +0000 (19:56 +0000)]
[SLSR] garbage-collect unused instructions

Summary:
After we rewrite a candidate, the instructions used by the old form may
become unused. This patch cleans up these unused instructions so that we
needn't run DCE after SLSR.

Test Plan: removed -dce in all the SLSR tests

Reviewers: broune, meheff

Subscribers: llvm-commits

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

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

9 years ago[SeparateConstOffsetFromGEP] garbage-collect intermediate instructions
Jingyue Wu [Tue, 21 Apr 2015 19:53:18 +0000 (19:53 +0000)]
[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

9 years agoRemove FilesToRemove->push_back(Filename) from sys::DontRemoveFileOnSignal.
Yaron Keren [Tue, 21 Apr 2015 19:25:11 +0000 (19:25 +0000)]
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

9 years agoDebugInfo: Use MDType in DITypeIdentifierMap
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 19:17:20 +0000 (19:17 +0000)]
DebugInfo: Use MDType in DITypeIdentifierMap

Use `MDType*` instead of `MDNode*` in `DITypeIdentifierMap`, since all
the members should be types.

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

9 years agoMove IDF Calculation to a separate file, expose an interface to it.
Daniel Berlin [Tue, 21 Apr 2015 19:13:02 +0000 (19:13 +0000)]
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

9 years agoDebugInfo: Prune unnecessary forward declarations
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 19:00:26 +0000 (19:00 +0000)]
DebugInfo: Prune unnecessary forward declarations

Probably these forward declarations were once useful, but they certainly
don't belong here now.

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

9 years agoDebugInfo: Drop rest of DIDescriptor subclasses
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 18:44:06 +0000 (18:44 +0000)]
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

9 years agoDebugInfo: Assert dbg.declare/value insts are valid
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 18:24:23 +0000 (18:24 +0000)]
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

9 years agoRe-land r235154-r235156 under the existing -sehprepare flag
Reid Kleckner [Tue, 21 Apr 2015 18:23:57 +0000 (18:23 +0000)]
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

9 years agoX86: Match for X86ISD nodes in LowerBUILD_VECTOR instead of BUILD_VECTORCombine
Matthias Braun [Tue, 21 Apr 2015 17:21:36 +0000 (17:21 +0000)]
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

9 years agoMinor edits to the llvm-cov documentation.
Bob Wilson [Tue, 21 Apr 2015 16:32:02 +0000 (16:32 +0000)]
Minor edits to the llvm-cov documentation.

This just changes a few places to use a slightly more formal style.

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

9 years agos/NULL/nullptr/ in OrcTestCommon.h to silence -Wsentinel in clang-cl
Reid Kleckner [Tue, 21 Apr 2015 15:56:21 +0000 (15:56 +0000)]
s/NULL/nullptr/ in OrcTestCommon.h to silence -Wsentinel in clang-cl

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

9 years agoAVX-512: Added VPMOVx2M instructions for SKX,
Elena Demikhovsky [Tue, 21 Apr 2015 14:38:31 +0000 (14:38 +0000)]
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

9 years agoAVX-512: Added VPTESTM and VPTESTNM instructions for SKX
Elena Demikhovsky [Tue, 21 Apr 2015 13:13:46 +0000 (13:13 +0000)]
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

9 years ago[mips] [IAS] Implement the .asciiz directive.
Toma Tabacu [Tue, 21 Apr 2015 11:50:52 +0000 (11:50 +0000)]
[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

9 years ago[mips][microMIPSr6] Implement CACHE and PREF instructions
Jozef Kolek [Tue, 21 Apr 2015 11:17:25 +0000 (11:17 +0000)]
[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

9 years ago[mips] Cleanup old floating-point flag conditions definitions. NFC.
Vasileios Kalintiris [Tue, 21 Apr 2015 10:53:57 +0000 (10:53 +0000)]
[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

9 years ago[mips] Optimize code generation for 64-bit variable shift instructions.
Vasileios Kalintiris [Tue, 21 Apr 2015 10:49:03 +0000 (10:49 +0000)]
[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

9 years agoAVX-512: Added logical and arithmetic instructions for SKX
Elena Demikhovsky [Tue, 21 Apr 2015 10:27:40 +0000 (10:27 +0000)]
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

9 years ago[X86][SSE] Provide execution domains for scalar floating point operations
Simon Pilgrim [Tue, 21 Apr 2015 08:40:22 +0000 (08:40 +0000)]
[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

9 years agoCONCAT_VECTOR of BUILD_VECTOR - minor fix
Simon Pilgrim [Tue, 21 Apr 2015 08:05:43 +0000 (08:05 +0000)]
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

9 years agoFix generic shift expansion when shift amount is 0
Pawel Bylica [Tue, 21 Apr 2015 06:28:36 +0000 (06:28 +0000)]
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

9 years agoEnhanced vim support.
Matthias Braun [Tue, 21 Apr 2015 01:35:42 +0000 (01:35 +0000)]
Enhanced vim support.

This brings the utils/vim folder into a more vim-like format by moving
the syntax hightlighting files into a syntax subdirectory. It adds
some minimal settings that everyone should agree on to ftdetect/ftplugin and
features a new indentation plugin for .ll files.

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

9 years agoX86: Do not select X86 custom vector nodes if operand types don't match
Matthias Braun [Tue, 21 Apr 2015 01:13:41 +0000 (01:13 +0000)]
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

9 years agoTighten bundling section alignment test.
Derek Schuff [Tue, 21 Apr 2015 00:17:59 +0000 (00:17 +0000)]
Tighten bundling section alignment test.

Leftover comment from http://reviews.llvm.org/D9131

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

9 years ago[MC] When using bundle aligment, align sections to bundle size
Derek Schuff [Tue, 21 Apr 2015 00:14:25 +0000 (00:14 +0000)]
[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

9 years agoInstCombine: fold (sitofp (zext x)) to (uitofp x)
Fiona Glaser [Tue, 21 Apr 2015 00:05:41 +0000 (00:05 +0000)]
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

9 years agoFix flakiness in fp16-promote.ll
Pirama Arumuga Nainar [Mon, 20 Apr 2015 23:54:41 +0000 (23:54 +0000)]
Fix flakiness in fp16-promote.ll

Summary:
In the f16-promote test, make the checks for native conversion instructions
similar to the libcall checks:
- Remove hard coded register names
- Do not check exact instruction sequences.

This fixes test flakiness due to non-determinism in instruction
scheduling and register allocation.  I also fixed a few minor things in
the CHECK-LIBCALL checks.

I'll try to find a way to check that unnecessary loads, stores, or
conversions don't happen.

Reviewers: mzolotukhin, srhines, ab

Subscribers: llvm-commits

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

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

9 years agobugpoint Enhancement.
JF Bastien [Mon, 20 Apr 2015 23:42:22 +0000 (23:42 +0000)]
bugpoint Enhancement.

Summary:
This patch adds two flags to `bugpoint`: "-replace-funcs-with-null" and "-disable-pass-list-reduction".

When "-replace-funcs-with-null" is specified, bugpoint will, instead of simply deleting function bodies, replace all uses of functions and then will delete functions completely from the test module, correctly handling aliasing and @llvm.used && @llvm.compiler.used. This part was conceived while trying to debug the PNaCl IR simplification passes, which don't allow undefined functions (ie no declarations).

With "-disable-pass-list-reduction", bugpoint won't try to reduce the set of passes causing the "crash". This is needed in cases where one is trying to debug an issue inside the PNaCl IR simplification passes which is causing an PNaCl ABI verification error, for example.

Reviewers: jfb

Reviewed By: jfb

Subscribers: jfb, llvm-commits

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

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

9 years agouse update_llc_test_checks.py to tighten checking
Sanjay Patel [Mon, 20 Apr 2015 23:31:53 +0000 (23:31 +0000)]
use update_llc_test_checks.py to tighten checking

Also, replace win and linux runs with a generic run because that
makes no difference in what this test is checking.

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

9 years agoAdd myself as the Constant Folder owner.
David Majnemer [Mon, 20 Apr 2015 23:19:10 +0000 (23:19 +0000)]
Add myself as the Constant Folder owner.

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

9 years ago[WinEH] Fix problem with landing pad return values used in PHI nodes during outlining.
Andrew Kaylor [Mon, 20 Apr 2015 22:53:42 +0000 (22:53 +0000)]
[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

9 years agoDebugInfo: Delete subclasses of DIScope
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 22:10:08 +0000 (22:10 +0000)]
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

9 years ago[WinEH] Fix problem with mapping shared empty handler blocks.
Andrew Kaylor [Mon, 20 Apr 2015 22:04:09 +0000 (22:04 +0000)]
[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

9 years agoDebugInfo: Fix Kaleidoscope Ch. 8 after r235327
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:29:44 +0000 (21:29 +0000)]
DebugInfo: Fix Kaleidoscope Ch. 8 after r235327

Pretty sure the build was broken by r235327 (I updated it there, but
apparently didn't check if it compiled).

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

9 years agoDebugInfo: Delete old subclasses of DIType
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:17:32 +0000 (21:17 +0000)]
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

9 years agoDwarfUnit: Split MDSubroutineType version of constructTypeDIE()
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:04:33 +0000 (21:04 +0000)]
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

9 years ago[Orc] Make the makeStub function propagate argument attributes onto the call to
Lang Hames [Mon, 20 Apr 2015 20:41:45 +0000 (20:41 +0000)]
[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

9 years agoDwarfUnit: Cleanup comments
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 20:29:51 +0000 (20:29 +0000)]
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

9 years agoRefactoring and enhancement to FMA combine.
Olivier Sallenave [Mon, 20 Apr 2015 20:29:40 +0000 (20:29 +0000)]
Refactoring and enhancement to FMA combine.

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

9 years agoFixing line endings
Andrew Kaylor [Mon, 20 Apr 2015 20:27:28 +0000 (20:27 +0000)]
Fixing line endings

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

9 years ago[MIPS] OperationAction for FP_TO_FP16, FP16_TO_FP
Pirama Arumuga Nainar [Mon, 20 Apr 2015 20:15:36 +0000 (20:15 +0000)]
[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

9 years agoDAGCombine: Remove redundant NaN checks around ISD::FSQRT
Tom Stellard [Mon, 20 Apr 2015 19:38:27 +0000 (19:38 +0000)]
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

9 years agoIR: Add ConstantFP::getNaN()
Tom Stellard [Mon, 20 Apr 2015 19:38:24 +0000 (19:38 +0000)]
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

9 years agoDebugInfo: Remove DIType
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:52:06 +0000 (18:52 +0000)]
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

9 years ago[WinEH] Fix memory leak with catch-all mapping.
Andrew Kaylor [Mon, 20 Apr 2015 18:48:45 +0000 (18:48 +0000)]
[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

9 years agoDebugInfo: Remove DIScope
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:32:29 +0000 (18:32 +0000)]
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

9 years ago[Orc] Use the 64-bit versions of FXSAVE/FXRSTOR for JIT reentry.
Lang Hames [Mon, 20 Apr 2015 18:25:44 +0000 (18:25 +0000)]
[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

9 years agoAdd targets to cmake for specific target components.
Pete Cooper [Mon, 20 Apr 2015 18:22:05 +0000 (18:22 +0000)]
Add targets to cmake for specific target components.

This adds the following targets to cmake.  These can be used to build and link only specific parts of a backend, instead of having to link the whole backend.

- AllTargetsAsmPrinters, AllTargetsAsmParsers, AllTargetsDescs, AllTargetsDisassemblers, AllTargetsInfos

A typical use for these is instead of linking ${LLVM_TARGETS_TO_BUILD}.  This commit changes llvm-mc to show how to use the new targets.

Reviewed by Chris Bieneman.

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

9 years agoDebugInfo: Remove typedefs for DITypeRef, etc.
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:20:03 +0000 (18:20 +0000)]
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

9 years ago[mips][microMIPSr6] Implement BITSWAP instruction
Jozef Kolek [Mon, 20 Apr 2015 18:14:59 +0000 (18:14 +0000)]
[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

9 years ago[AArch64] LORID_EL1 register must be treated as read-only
Vladimir Sukharev [Mon, 20 Apr 2015 16:54:37 +0000 (16:54 +0000)]
[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

9 years ago[InlineFunction] Don't add lifetime markers for zero-sized allocas.
Akira Hatanaka [Mon, 20 Apr 2015 16:11:05 +0000 (16:11 +0000)]
[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

9 years agoRecognize n/1 in the SCEV divide function
Brendon Cahoon [Mon, 20 Apr 2015 16:03:28 +0000 (16:03 +0000)]
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

9 years ago[PowerPC] Flow oversized lines for r235309
Bill Schmidt [Mon, 20 Apr 2015 15:58:46 +0000 (15:58 +0000)]
[PowerPC] Flow oversized lines for r235309

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

9 years ago[PowerPC] Add future work for vector insert/extract to README_ALTIVEC.txt
Bill Schmidt [Mon, 20 Apr 2015 15:54:26 +0000 (15:54 +0000)]
[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

9 years ago[mips][microMIPSr6] Implement disassembler support
Jozef Kolek [Mon, 20 Apr 2015 14:40:38 +0000 (14:40 +0000)]
[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

9 years agoDon't allow pwrite to resize a stream.
Rafael Espindola [Mon, 20 Apr 2015 13:04:30 +0000 (13:04 +0000)]
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

9 years ago[mips][microMIPSr6] Implement BALC and BC instructions
Jozef Kolek [Mon, 20 Apr 2015 13:04:14 +0000 (13:04 +0000)]
[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

9 years agoLook past locals in comdats.
Rafael Espindola [Mon, 20 Apr 2015 12:44:06 +0000 (12:44 +0000)]
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

9 years ago[mips][microMIPSr6] Implement initial mapping support
Jozef Kolek [Mon, 20 Apr 2015 12:42:08 +0000 (12:42 +0000)]
[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

9 years ago[mips][microMIPSr6] Implement initial subtarget support
Jozef Kolek [Mon, 20 Apr 2015 12:23:06 +0000 (12:23 +0000)]
[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

9 years ago[X86][FastIsel] Fix assertion failure when selecting int-to-double conversion (PR23273).
Andrea Di Biagio [Mon, 20 Apr 2015 11:56:59 +0000 (11:56 +0000)]
[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

9 years agoFix buildbot failure on darwin from r235284.
Karthik Bhat [Mon, 20 Apr 2015 07:07:10 +0000 (07:07 +0000)]
Fix buildbot failure on darwin from r235284.

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

9 years ago[Mips] Support DT_MIPS_OPTIONS dynamic section tag in the llvm-readobj
Simon Atanasyan [Mon, 20 Apr 2015 05:34:48 +0000 (05:34 +0000)]
[Mips] Support DT_MIPS_OPTIONS dynamic section tag in the llvm-readobj

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

9 years ago[NFC] Refactor identification of reductions as common utility function.
Karthik Bhat [Mon, 20 Apr 2015 04:38:33 +0000 (04:38 +0000)]
[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

9 years ago[InlineAsm] Remove EarlyClobber on registers that are also inputs
Hal Finkel [Mon, 20 Apr 2015 00:01:30 +0000 (00:01 +0000)]
[InlineAsm] Remove EarlyClobber on registers that are also inputs

When an inline asm call has an output register marked as early-clobber, but
that same register is also an input operand, what should we do? GCC accepts
this, and is documented to accept this for read/write operands saying,
"Furthermore, if the earlyclobber operand is also a read/write operand, then
that operand is written only after it's used." For write-only operands, the
situation seems less clear, but I have at least one existing codebase that
assumes this will work, in part because it has syscall macros like this:

({                                                                         \
  register uint64_t r0 __asm__ ("r0") = (__NR_ ## name);                   \
  register uint64_t r3 __asm__ ("r3") = ((uint64_t) (arg0));               \
  register uint64_t r4 __asm__ ("r4") = ((uint64_t) (arg1));               \
  register uint64_t r5 __asm__ ("r5") = ((uint64_t) (arg2));               \
  __asm__ __volatile__                                                     \
  ("sc"                                                                    \
   : "=&r"(r0),"=&r"(r3),"=&r"(r4),"=&r"(r5)                               \
   :   "0"(r0),  "1"(r3),  "2"(r4),  "3"(r5)                               \
   : "r6","r7","r8","r9","r10","r11","r12","cr0","memory");                \
  r3;                                                                      \
})

Furthermore, with register aliases and subregister relationships that only the
backend knows about, rejecting this in the frontend seems like a difficult
proposition (if we wanted to do so). However, keeping the early-clobber flag on
the INLINEASM MI does not work for us, because it will cause the register's
live interval to end to soon (so it will not appear defined to be used as an
input).

Fortunately, fixing this does not seem hard: When forming the INLINEASM MI,
check to see if any of the early-clobber outputs are also inputs, and if so,
remove the early-clobber flag.

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

9 years ago[X86][SSE] Fix for getScalarValueForVectorElement to detect scalar sources requiring...
Simon Pilgrim [Sun, 19 Apr 2015 22:16:49 +0000 (22:16 +0000)]
[X86][SSE] Fix for getScalarValueForVectorElement to detect scalar sources requiring truncation.

The fix ensures that scalar sources inserted into a vector are the correct bit size.

Integer scalar sources from BUILD_VECTOR and SCALAR_TO_VECTOR nodes may require truncation that this function doesn't currently support.

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

9 years ago[X86][SSE] Extended copysign tests to include llvm intrinsic implementation and const...
Simon Pilgrim [Sun, 19 Apr 2015 21:34:57 +0000 (21:34 +0000)]
[X86][SSE] Extended copysign tests to include llvm intrinsic implementation and constant folding.

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

9 years ago[mips] Update MIPS relocations list
Simon Atanasyan [Sun, 19 Apr 2015 20:51:55 +0000 (20:51 +0000)]
[mips] Update MIPS relocations list

No functional changes.

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

9 years agoRemove the FCFI option from TargetOptions as it is currently unused.
Eric Christopher [Sun, 19 Apr 2015 03:21:08 +0000 (03:21 +0000)]
Remove the FCFI option from TargetOptions as it is currently unused.

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

9 years agoRemove CFIFuncName from TargetOptions as it is currently unused.
Eric Christopher [Sun, 19 Apr 2015 03:21:04 +0000 (03:21 +0000)]
Remove CFIFuncName from TargetOptions as it is currently unused.

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

9 years agoRemove the CFIEnforcing flag from TargetOptions as it is unused.
Eric Christopher [Sun, 19 Apr 2015 03:20:59 +0000 (03:20 +0000)]
Remove the CFIEnforcing flag from TargetOptions as it is unused.

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

9 years agoRemove the CFIType TargetOption as it is unused.
Eric Christopher [Sun, 19 Apr 2015 03:20:55 +0000 (03:20 +0000)]
Remove the CFIType TargetOption as it is unused.

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

9 years agoRemove the JITEmitDebugInfo TargetOptions as they're only set and
Eric Christopher [Sun, 19 Apr 2015 03:20:51 +0000 (03:20 +0000)]
Remove the JITEmitDebugInfo TargetOptions as they're only set and
not used anywhere in llvm.

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

9 years agoRemove unnecessary include and probably a layering violation.
Craig Topper [Sun, 19 Apr 2015 00:57:33 +0000 (00:57 +0000)]
Remove unnecessary include and probably a layering violation.

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

9 years ago[MemCpyOpt] Don't force i64 when promoting memset/memcpy sizes.
Ahmed Bougacha [Sat, 18 Apr 2015 23:06:04 +0000 (23:06 +0000)]
[MemCpyOpt] Don't force i64 when promoting memset/memcpy sizes.

Harden r235258 to support any integer bitwidth.  The quick glance at
the reference made me think only i32 and i64 were valid types, but
they're not special, so any overload is legal.

Thanks to David Majnemer for noticing!

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

9 years ago[X86][AVX2] Force execution domain on broadcast folding tests.
Simon Pilgrim [Sat, 18 Apr 2015 21:24:16 +0000 (21:24 +0000)]
[X86][AVX2] Force execution domain on broadcast folding tests.

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

9 years ago[X86][SSE] Force execution domain on float/double unpack shuffle tests.
Simon Pilgrim [Sat, 18 Apr 2015 18:50:55 +0000 (18:50 +0000)]
[X86][SSE] Force execution domain on float/double unpack shuffle tests.

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

9 years ago[MemCpyOpt] Promote both memset/memcpy sizes if differently typed.
Ahmed Bougacha [Sat, 18 Apr 2015 17:57:41 +0000 (17:57 +0000)]
[MemCpyOpt] Promote both memset/memcpy sizes if differently typed.

Followup to r235232, which caused PR23278.

We can't assume the memset and memcpy sizes have the same type, as
nothing in the language reference prevents that.
Instead, zext both to i64 if they disagree.

While there, robustify tests by using i8 %c rather than i8 0 for the
memset character.

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

9 years ago[InstCombine] Create zero constants on demand.
Benjamin Kramer [Sat, 18 Apr 2015 16:52:08 +0000 (16:52 +0000)]
[InstCombine] Create zero constants on demand.

No functional change intended.

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

9 years ago[InstCombine] (mul nsw 1, INT_MIN) != (shl nsw 1, 31)
David Majnemer [Sat, 18 Apr 2015 04:41:30 +0000 (04:41 +0000)]
[InstCombine] (mul nsw 1, INT_MIN) != (shl nsw 1, 31)

Multiplying INT_MIN by 1 doesn't trigger nsw.  However, shifting 1 into
the sign bit *does* trigger nsw.

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

9 years ago[GlobalMerge] Look at uses to create smaller global sets.
Ahmed Bougacha [Sat, 18 Apr 2015 01:21:58 +0000 (01:21 +0000)]
[GlobalMerge] Look at uses to create smaller global sets.

Instead of merging everything together, look at the users of
GlobalVariables, and try to group them by function, to create
sets of globals used "together".

Using that information, a less-aggressive alternative is to keep merging
everything together *except* globals that are only ever used alone, that
is, those for which it's clearly non-profitable to merge with others.

In my testing, grouping by Function is too aggressive, but grouping by
BasicBlock is too conservative.  Anything in-between isn't trivially
available, so stick with Function grouping for now.

cl::opts are added for testing; both enabled by default.

A few of the testcases aren't testing the merging proper, but just
various edge cases when merging does occur.  Update them to use the
previous grouping behavior. Also, one of the tests is unrelated to
GlobalMerge; change it accordingly.
While there, switch to r234666' flags rather than the brutal -O3.

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

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