Commit Graph

116614 Commits

Author SHA1 Message Date
Craig Topper
bdd6973671 [TableGen] Remove some deletes that violate ownership semantics. These don't seem to execute in our codebase today and date back to a time when there was an allocation in this function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235481 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 05:27:11 +00:00
Yaron Keren
cfe24ac62f Revert r235219, it's not needed after r235450.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235480 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 05:06:57 +00:00
David Blaikie
bc9eee72cf Replace std::auto_ptr with std::unique_ptr
std::auto_ptr is deprecated in GCC 5.0, and we are already using
std::unique_ptr all over the place.

Patch by Xan López.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235479 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:39:13 +00:00
David Blaikie
337b35ae29 Fix up Exception demo from recent opaque pointer type changes to GEP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235478 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:24:43 +00:00
Craig Topper
459448abcc [TableGen] Make BitRecTy::baseClassOf return true when RHS is an IntRecTy.
Previously the code was accidentally checking if 'this' was an IntRecTy which it can't be since 'this' is a BitRecTy. Looking back at the history it appears it was intended to check RHS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235477 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:18:32 +00:00
Craig Topper
aee08e5bac Don't use 'nullptr' in comment. Just use 'null'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235476 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:18:27 +00:00
David Blaikie
5bd65c73d7 [opaque pointer types] Serialize the value type for atomic store instructions
Without pointee types the space optimization of storing only the pointer
type and not the value type won't be viable - so add the extra type
information that would be missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235475 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:14:46 +00:00
David Blaikie
5db5cae26f [opaque pointer types] Serialize the value type for store instructions
Without pointee types the space optimization of storing only the pointer
type and not the value type won't be viable - so add the extra type
information that would be missing.

Storeatomic coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:14:42 +00:00
Duncan P. N. Exon Smith
fae374b95e Linker: Add flag to override linkage rules
Add a flag to lib/Linker (and `llvm-link`) to override linkage rules.
When set, the functions in the source module *always* replace those in
the destination module.

The `llvm-link` option is `-override=abc.ll`.  All the "regular" modules
are loaded and linked first, followed by the `-override` modules.  This
is useful for debugging workflows where some subset of the module (e.g.,
a single function) is extracted into a separate file where it's
optimized differently, before being merged back in.

Patch by Luqman Aden!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:11:00 +00:00
Duncan P. N. Exon Smith
d9443d717d llvm-link: Factor out loop over input files, NFC
Factor the loop for linking input files together into a combined module
into a separate function.  This is in preparation for an upcoming patch
that runs the logic twice.

Patch by Luqman Aden!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:08:22 +00:00
Craig Topper
0b67fe7293 Revert "[TableGen] Use cast instead of dyn_cast where result isn't checked before being dereferenced."
Turns out I misread the parentheses. Though I'm pretty sure its always a RecordRecTy and non of the callers really seem to expect null. But until I'm completely sure I'm going to revert this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:59:06 +00:00
Craig Topper
fe6b36788e Fix stale comment that mentioned 0 instead of nullptr. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:59:03 +00:00
Craig Topper
458ad3e2cb [TableGen] Remove Pool helper class and just use unique_ptr in the maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:20:44 +00:00
Craig Topper
5def98eaee [TableGen] Use StringRecTy::get() instead of allocating (and leaking) a StringRecTy object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:09:47 +00:00
Craig Topper
f8012eb826 [TableGen] Use 'isa' to identify UnsetInits rather than comparing with the singleton object created by UnsetInit::get(). Makes it more consistent with the other types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:09:45 +00:00
Craig Topper
87b4c04980 [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
2015-04-22 02:09:42 +00:00
Craig Topper
8bf10f85cd Cleanup formatting for consistency with surrounding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:09:39 +00:00
Sanjay Patel
2b2b3a87da [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
2015-04-22 00:24:30 +00:00
Reid Kleckner
8992ead662 [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
2015-04-22 00:07:52 +00:00
David Blaikie
d62a1e966c [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
2015-04-21 23:26:57 +00:00
NAKAMURA Takumi
bc4233f437 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
2015-04-21 23:14:33 +00:00
Wei Mi
ef67950b62 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
2015-04-21 23:02:15 +00:00
Wei Mi
480fc70c43 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
2015-04-21 22:56:09 +00:00
Wei Mi
73a5fa9ad6 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
2015-04-21 22:37:09 +00:00
Andrew Kaylor
550a1ca576 Silence MSVC build alignment warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 22:29:38 +00:00
Ahmed Bougacha
0f32a037ef [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
2015-04-21 21:28:33 +00:00
Krzysztof Parzyszek
a42f6b9a58 [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
2015-04-21 21:28:03 +00:00
Lang Hames
f3aa9e0fdd Update comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235417 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 21:15:35 +00:00
Daniel Berlin
13ba3ca69f 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
2015-04-21 21:11:50 +00:00
Jingyue Wu
0f710d7a5a [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
2015-04-21 20:47:15 +00:00
Sanjoy Das
86ab1ba559 [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
2015-04-21 20:42:50 +00:00
Duncan P. N. Exon Smith
1cacd28c3b 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
2015-04-21 20:07:38 +00:00
Jingyue Wu
423476d899 [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
2015-04-21 19:56:18 +00:00
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
Duncan P. N. Exon Smith
6238cb16f3 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
2015-04-21 19:17:20 +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
fb32d52116 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
2015-04-21 19:00:26 +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
Bob Wilson
0aa62dd53a 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
2015-04-21 16:32:02 +00:00
Reid Kleckner
4be4d30125 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
2015-04-21 15:56:21 +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