131821 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
d54aa7c3b5 [Hexagon] Expand VSelect pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 19:16:02 +00:00
Vedant Kumar
85a1b73993 [unittests] Use coveragemap_error in CoverageMappingReaderMock (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 19:01:11 +00:00
Davide Italiano
d3e47ace50 [PM] Make LowerAtomic a FunctionPass.
Differential Revision: http://reviews.llvm.org/D20025

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 18:49:32 +00:00
Michael Kuperstein
9a04420034 [LoopVectorizer] LoopVectorBody doesn't need to be a vector. NFC.
LoopVectorBody was changed from a single pointer to a SmallVector when
store predication was introduced in r200270. Since r247139, store predication
no longer splits the vector loop body in-place, so we can go back to having
a single LoopVectorBody block.

This reverts the no-longer-needed changes from r200270.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 18:44:51 +00:00
Chris Bieneman
d6f6aaf5e7 [yaml2macho] Handle mach_header_64 reserved field
I've added the reserved field as an "optional" in YAML, but I've added asserts in the yaml2macho code to enforce that the field is present in mach_header_64, but not in mach_header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 18:21:09 +00:00
Chris Bieneman
891a32ccca [yaml2macho] Use memset instead of bzero
This should fix the bots I broke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 18:02:13 +00:00
Chris Bieneman
8413a15520 [ObjectYAML] filetype is a required field in MachO headers
Not sure how I managed to copy-pasta this wrong, but I did.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:53:01 +00:00
Zachary Turner
c86d47d6a3 Get rid of CVLeafTypes.def and combine with TypeRecords.def
This merges the functionality of the macros in `CVLeafTypes.def` and the
macros in `TypeRecords.def` into a single set of macros.

Differential Revision: http://reviews.llvm.org/D20190
Reviewed By: rnk, amccarth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:45:51 +00:00
Zachary Turner
4f4637e6d1 Make CodeView record serialization more generic.
This introduces a variadic template and some helper macros to
safely and correctly deserialize many types of common record
fields while maintaining error checking.

Differential Revision: http://reviews.llvm.org/D20183
Reviewed By: rnk, amccarth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:45:44 +00:00
Chris Bieneman
ed0b17172e [yaml2obj] Support for dumping mach_header from yaml
With this change obj2yaml and yaml2obj can now round-trip mach_headers.

This change also adds ObjectYAML/MachO tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:44:48 +00:00
Chris Bieneman
dfa9a6bd95 [obj2yaml] Include all mach_header fields in yaml
Since we want to be able to use yaml to describe degenerate object files as well as valid ones, we need to be explicit of some fields in your yaml definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:44:43 +00:00
Krzysztof Parzyszek
9c350c822f [Hexagon] Properly handle instruction selection of vsplat intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:21:40 +00:00
Xinliang David Li
c8239a02c0 minor test clean up /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 16:41:27 +00:00
Xinliang David Li
8f15084d2a Fix option description /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 16:39:02 +00:00
Chris Bieneman
0e9948288b [macho2yaml] Add support for dumping mach_headers
This patch adds the ability to dump mach headers. For my local clang binary the macho2yaml output is now:

--- !mach-o
FileHeader:
  cputype:         0x01000007
  cpusubtype:      0x80000003
  filetype:        0x00000002
  ncmds:           19
  flags:           0x00A18085
...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 16:04:20 +00:00
Chris Bieneman
7455ed8edf [ObjectYAML] Support Thin MachO headers to YAML
This patch adds support to ObjectYAML for serializing mach_header structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 16:04:16 +00:00
Daniel Sanders
100018952c [mips][ias] Fix O32 .cprestore directive when inside .set noat region and offset is in range.
Summary:
This expands on r269179 to fix an additional case that was not covered by our
tests. The assembler temporary is not needed when the .cprestore offset fits
inside a simm16 and it is not an error to use it inside a '.set noat' in this
case.

Reviewers: emaste, seanbruno, sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 14:01:50 +00:00
Daniel Sanders
d89f32c83d [mips][ias] Work around incorrect another microMIPS relocation evaluation exposed by r268900
As explained in r269196, microMIPS has a special case that is not correctly
implemented in LLVM. If we have a symbol 'foo' which is equivalent to
'.text+0x10'. The value of an R_MICROMIPS_LO16 relocation using 'foo' is
'foo+0x11' and not 'foo+0x10'. The in-place addend should therefore be 0x11.

This commit reverts a little more of the effect of r268900 by keeping the
symbol when the STO_MIPS_MICROMIPS flag is set for R_MIPS_GPREL32 relocations.
This fixes SingleSource/UnitTests/2003-08-11-VaListArg, and
SingleSource/UnitTests/2003-05-07-VarArgs for microMIPS.

I believe there are additional relocations that have the same issue (e.g.
R_MIPS_64, and R_MIPS_GPREL16) but for now I'm focusing on restoring our
internal buildbots back to the green state we had in r268899.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 13:39:13 +00:00
Chad Rosier
443898c3e6 [AArch64] Remove command-line option use for testing.
The EXTR combine has been in tree for over 2 years without complain, so go ahead
and remove the option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 13:27:24 +00:00
Simon Pilgrim
d836fe6b93 [SelectionDAG] Attempt to split BITREVERSE vector legalization into BSWAP and BITREVERSE stages
For BITREVERSE, bit shifting/masking every bit in a vector element is a very lengthy procedure.

If the input vector type is a whole multiple of bytes wide then we can split this into a BSWAP shuffle stage (to reverse at the byte level) and then a BITREVERSE stage applied to each byte. Most vector capable targets can efficiently BSWAP using shuffles resulting in a considerable reduction in instructions.

With this patch targets would only need to implement a target specific vXi8 BITREVERSE implementation to efficiently reverse most legal vector types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 13:09:49 +00:00
Hrvoje Varga
6c8d6522ab Revert "[mips][microMIPS] Implement CFC*, CTC* and LDC* instructions"
This reverts commit r269176 as it caused test-suite failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 12:46:06 +00:00
Rafael Espindola
26020e6ce8 Refactor duplicated code. NFC.
Linkage is always followed by visibility and dll storage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 12:37:52 +00:00
Renato Golin
5c224e802b [scan-build] fix warnings emitted on LLVM ARM code base
Fix "Logic error" warnings of the type "Called C++ object pointer is
null" reported by Clang Static Analyzer.

Patch by Apelete Seketeli.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 12:33:33 +00:00
Daniel Sanders
b58361c4a0 [mips][ias] Correct ELF eflags when Octeon is the target.
Reviewers: sdardis

Subscribers: petarj, mpf, dsanders, spetrovic, llvm-commits, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 11:31:19 +00:00
Daniel Sanders
f6248f5f78 [mips][ias] Handle N64 compound relocations and R_MIPS_SUB in needsRelocateWithSymbol()
Summary:
This eliminates the default case for N64 that was left out of r269047.

The change to R_MIPS_SUB is needed in this patch to make this testable since
%lo(%neg(%gp_rel(foo))) and %hi(%neg(%gp_rel(foo))) remain the only ways to get
a compound relocation from the assembler.

Reviewers: sdardis, rafael

Subscribers: dsanders, llvm-commits, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 10:55:00 +00:00
Dan Gohman
ca8feb05bb [WebAssembly] Fast-isel support for calls, arguments, and selects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 04:19:09 +00:00
Hal Finkel
db6adcba1e [PowerPC] Fix a DAG replacement bug in PPCTargetLowering::DAGCombineExtBoolTrunc
While promoting nodes in PPCTargetLowering::DAGCombineExtBoolTrunc, it is
possible for one of the nodes to be replaced by another. To make sure we do not
visit the deleted nodes, and to make sure we visit the replacement nodes, use a
list of HandleSDNodes to track the to-be-promoted nodes during the promotion
process.

The same fix has been applied to the analogous code in
PPCTargetLowering::DAGCombineTruncBoolExt.

Fixes PR26985.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 04:00:56 +00:00
David Majnemer
b0f9f5bfc7 [SCCP] Resolve shifts beyond the bitwidth to undef
Shifts beyond the bitwidth are undef but SCCP resolved them to zero.
Instead, DTRT and resolve them to undef.

This reimplements the transform which caused PR27712.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 03:07:40 +00:00
Matt Arsenault
b381ae290d AMDGPU: Fix getIntegerAttribute type and error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 02:45:18 +00:00
Xinliang David Li
f058cfd499 [Layout] Add a new test case for optimal rotation
Enabled by -force-precise-rotation-cost option


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 02:19:16 +00:00
Xinliang David Li
d4e30eacd2 [Layout] Add a new option (NFC)
Currently cost based loop rotation algo can only be turned on with
two conditions: the function has real profile data, and -precise-rotation-cost
flag is turned on. This is not convenient for developers to experiment
when profile is not available. Add a new option to force the new
rotation algorithm -force-precise-rotation-cost




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 02:04:41 +00:00
Matt Arsenault
8adf4ebcf3 AMDGPU: Fix breaking IR on instructions with multiple pointer operands
The promote alloca pass would attempt to promote an alloca with
a select, icmp, or phi user, even though the other operand was
from a non-promotable source, producing a select on two different
pointer types.

Only do this if we know that both operands derive from the same
alloca. In the future we should be able to relax this to an alloca
which will also be promoted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 01:58:58 +00:00
Chris Bieneman
eb3d76315f [obj2yaml] Adding Error/Expected to macho2yaml
I figure if I'm adding Mach support I may as well use the new fancy Error model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 01:52:33 +00:00
Chad Rosier
dd7a9752c2 [AArch64] Add support for unscaled narrow stores in getUsefulBitsForUse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 01:42:01 +00:00
Sanjoy Das
d54aac1ae1 Appease MSVC with curly braces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 01:38:08 +00:00
Sanjoy Das
d2e75bd7aa All llvm.deoptimize declarations must use the same calling convention
This new verifier rule lets us unambigously pick a calling convention
when creating a new declaration for
`@llvm.experimental.deoptimize.<ty>`.  It is also congruent with our
lowering strategy -- since all calls to `@llvm.experimental.deoptimize`
are lowered to calls to `__llvm_deoptimize`, it is reasonable to enforce
a unique calling convention.

Some of the tests that were breaking this verifier rule have had to be
split up into different .ll files.

The inliner was violating this rule as well, and has been fixed to avoid
producing invalid IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269261 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 01:17:38 +00:00
Chad Rosier
f600385f77 [AArch64] Remove floating-point narrow stores from getUsefulBitsForUse.
While not impossible, it's unlikely we'd be performing bitwise operations on FP
values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 01:04:15 +00:00
Justin Bogner
830e803141 SDAG: Implement Select instead of SelectImpl in ARMDAGToDAGISel
This is a large change, but it's pretty mechanical:
- Where we were returning a node before, call ReplaceNode instead.
- Where we would return null to fall back to another selector, rename
  the method to try* and return a bool for success.
- Where we were calling SelectNodeTo, just return afterwards.

Part of llvm.org/pr26808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 00:31:09 +00:00
Justin Bogner
0d359b1e28 SDAG: Clean up dangling nodes in ARMISelDAGToDAG::SelectImpl
When we convert to the void Select interface, leaving unreferenced
nodes around won't be allowed anymore.

Part of llvm.org/pr26808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 00:20:19 +00:00
Xinliang David Li
b7f191181c [profile] profile writing cleanup
Do not precompute value counts for all sites. This 
eliminates one more use of dynamic allocation 
in profiler writer.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 23:21:12 +00:00
Davide Italiano
e5b9c737be Revert "[SCCP] Partially propagate informations when the input is not fully defined."
This reverts commit r269105 as it caused PR27712.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 23:06:10 +00:00
Teresa Johnson
a8330647b2 [ThinLTO] Don't re-analyze callee at same threshold unnecessarily
This should just be a compile-time change. Correct the check for whether
we have already analyzed the callee when making summary based decisions.
There is no need to reprocess one at the same threshold as when it was
last processed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 22:56:19 +00:00
Wei Mi
825e5aadeb Fix a bug when hoist spill to a BB with landingpad successor.
This is to fix the bug in https://llvm.org/bugs/show_bug.cgi?id=27612.

When spill is hoisted to a BB with landingpad successor, and if the VNI
of the spill reg lives into the landingpad successor, the spill should be
inserted before the call which may throw exception. InsertPointAnalysis
is used to compute the safe insert point.

http://reviews.llvm.org/D20027 is a preparing patch for this patch.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 22:37:43 +00:00
Wei Mi
723d45a0c7 [NFC] Extract LastSplitPoint computation from SplitAnalysis to a new class
InsertPointAnalysis.

Because both split and spill hoisting want to use LastSplitPoint computation
result, extract the LastSplitPoint computation from SplitAnalysis class which
also contains a bunch of other analysises only related to split.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 22:28:29 +00:00
Justin Bogner
9ad2a7e5c0 SDAG: Use ReplaceNode here, not ReplaceUses
This was a typo in an earlier commit - there's no point in keeping the
old node around here.

Noticed by Meador Inge. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 22:21:50 +00:00
Chris Bieneman
e05aeff019 Initial add for MachO support for yaml2obj
Adding the initial files for adding MachO support to yaml2obj. Passing a MachO file will result in an error.

I will be implementing obj2yaml and yaml2obj for MachO in parallel so that one can be used to test the other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 22:07:48 +00:00
Chris Bieneman
bf924c1084 Initial add for MachO support for obj2yaml
Adding the initial files for adding MachO support to obj2yaml. Passing a MachO file will result in a new not_implemented error.

I will be implementing obj2yaml and yaml2obj for MachO in parallel so that one can be used to test the other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 22:07:45 +00:00
Sanjay Patel
0dc2e08e23 regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 21:51:28 +00:00
Matthias Braun
1e2567525e MachineVerifier: Fix error reporting.
Do not use getVRegDef() to print "the definition" of a vreg. If there
are multiple or none the function will fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 21:31:39 +00:00
Xinliang David Li
b723fcf640 cleanup: do not recompute size for preallocated buffer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 21:17:10 +00:00