oota-llvm.git
11 years agoOptimize concat_vectors(X, undef) -> scalar_to_vector(X).
Nadav Rotem [Fri, 25 Oct 2013 06:41:18 +0000 (06:41 +0000)]
Optimize concat_vectors(X, undef) -> scalar_to_vector(X).
This optimization is not SSE specific so I am moving it to DAGco.
The new scalar_to_vector dag node exposed a missing pattern in the AArch64 target that I needed to add.

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

11 years agoFix ODR violation.
Richard Smith [Fri, 25 Oct 2013 03:29:42 +0000 (03:29 +0000)]
Fix ODR violation.

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

11 years agollvm-cov dump to dbgs() instead of outs().
Yuchen Wu [Fri, 25 Oct 2013 02:22:24 +0000 (02:22 +0000)]
llvm-cov dump to dbgs() instead of outs().

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

11 years agoSupport for reading program counts in llvm-cov.
Yuchen Wu [Fri, 25 Oct 2013 02:22:21 +0000 (02:22 +0000)]
Support for reading program counts in llvm-cov.

llvm-cov will now be able to read program counts from the GCDA file and
output it in the same format as gcov. The program summary tag was
identified from gcov-io.h as "\0\0\0\a3".

There is currently a bug in GCOVProfiling.cpp which does not generate
the
run- or program-counting IR, so this change was tested manually by
modifying the GCDA file and comparing the gcov and llvm-cov outputs.

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

11 years agoARM: Test r193381 a bit more thoroughly.
Jim Grosbach [Thu, 24 Oct 2013 23:11:05 +0000 (23:11 +0000)]
ARM: Test r193381 a bit more thoroughly.

Make sure we're predicating right based on CPU even if the triple is 'wrong'.

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

11 years agoARM: Tweak usage of '*vfp' compiler_rt functions.
Jim Grosbach [Thu, 24 Oct 2013 23:07:11 +0000 (23:07 +0000)]
ARM: Tweak usage of '*vfp' compiler_rt functions.

Only use them if the subtarget has ARM mode, as these routines are implemented
as ARM code.

rdar://15302004

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

11 years agoMCStreamer: Reimplement the virtual EmitRawText as a protected member, EmitRawTextImp...
David Blaikie [Thu, 24 Oct 2013 22:43:10 +0000 (22:43 +0000)]
MCStreamer: Reimplement the virtual EmitRawText as a protected member, EmitRawTextImpl, to avoid string literal ambiguities

Also improve the implementation of EmitRawText(Twine) so it doesn't
bother using the SmallString buffer if the Twine is a simple StringRef
anyway.

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

11 years agolto.h: Use lto_bool_t instead of int to restore the ABI
Reid Kleckner [Thu, 24 Oct 2013 22:26:04 +0000 (22:26 +0000)]
lto.h: Use lto_bool_t instead of int to restore the ABI

This reverts commit r193255 and instead creates an lto_bool_t typedef
that points to bool, _Bool, or unsigned char depending on what is
available.  Only recent versions of MSVC provide a stdbool.h header.

Reviewers: rafael.espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D2019

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

11 years agoDWARF emission: Remove unnecessary/redundant DIE reference code
David Blaikie [Thu, 24 Oct 2013 22:00:44 +0000 (22:00 +0000)]
DWARF emission: Remove unnecessary/redundant DIE reference code

The default case at the end of the switch handles this just fine.

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

11 years agoFix name of variable in comment.
Eric Christopher [Thu, 24 Oct 2013 21:54:58 +0000 (21:54 +0000)]
Fix name of variable in comment.

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

11 years agoGrammar.
Eric Christopher [Thu, 24 Oct 2013 21:20:23 +0000 (21:20 +0000)]
Grammar.

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

11 years agoUpdate misleading comment.
Eric Christopher [Thu, 24 Oct 2013 21:05:08 +0000 (21:05 +0000)]
Update misleading comment.

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

11 years agoFormatting and whitespace.
Eric Christopher [Thu, 24 Oct 2013 21:04:51 +0000 (21:04 +0000)]
Formatting and whitespace.

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

11 years agoDIEHash: Const correct and use references where non-null/non-rebound.
David Blaikie [Thu, 24 Oct 2013 18:29:03 +0000 (18:29 +0000)]
DIEHash: Const correct and use references where non-null/non-rebound.

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

11 years agoDIEHash: Do not use shallow type hashing for unnamed types
David Blaikie [Thu, 24 Oct 2013 17:53:58 +0000 (17:53 +0000)]
DIEHash: Do not use shallow type hashing for unnamed types

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

11 years agoDIEHash: Refactor ref attribute hashing into smaller functions
David Blaikie [Thu, 24 Oct 2013 17:51:43 +0000 (17:51 +0000)]
DIEHash: Refactor ref attribute hashing into smaller functions

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

11 years agoRemove unused debug-only member variable.
David Blaikie [Thu, 24 Oct 2013 17:10:13 +0000 (17:10 +0000)]
Remove unused debug-only member variable.

This may've been used at some point but the 'print' member function grew
an Indent parameter that entirely shadows this parameter.

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

11 years agoRemove class abstraction from ARM struct byval lowering
David Peixotto [Thu, 24 Oct 2013 16:39:36 +0000 (16:39 +0000)]
Remove class abstraction from ARM struct byval lowering

This commit changes the struct byval lowering for arm to use inline
checks for the subtarget instead of a class abstraction to represent
the differences. The class abstraction was judged to be too much
code for this task.

No intended functionality change.

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

11 years agoInliner: Handle readonly attribute per argument when adding memcpy
Tom Stellard [Thu, 24 Oct 2013 16:38:33 +0000 (16:38 +0000)]
Inliner: Handle readonly attribute per argument when adding memcpy

Patch by: Vincent Lejeune

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

11 years agoI had to move and remove
Renato Golin [Thu, 24 Oct 2013 16:31:43 +0000 (16:31 +0000)]
I had to move and remove

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

11 years agoARM: Mark double-precision instructions as such
Tim Northover [Thu, 24 Oct 2013 15:49:39 +0000 (15:49 +0000)]
ARM: Mark double-precision instructions as such

This prevents us from silently accepting invalid instructions on (for example)
Cortex-M4 with just single-precision VFP support.

No tests for the extra Pat Requires because they're essentially assertions: the
affected code should have been lowered to libcalls before ISel.

rdar://problem/15302004

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

11 years agoFix broken builds by moving test to x86 dir
Renato Golin [Thu, 24 Oct 2013 15:11:03 +0000 (15:11 +0000)]
Fix broken builds by moving test to x86 dir

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

11 years agoReverting my r193344 checkin due to build breakage.
John Thompson [Thu, 24 Oct 2013 14:52:56 +0000 (14:52 +0000)]
Reverting my r193344 checkin due to build breakage.

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

11 years agoMark vector loops as already vectorized
Renato Golin [Thu, 24 Oct 2013 14:50:51 +0000 (14:50 +0000)]
Mark vector loops as already vectorized

Make sure we mark all loops (scalar and vector) when vectorizing,
so that we don't try to vectorize them anymore. Also, set unroll
to 1, since this is what we check for on early exit.

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

11 years agoAdded std::string as a built-in type for mapping.
John Thompson [Thu, 24 Oct 2013 13:36:58 +0000 (13:36 +0000)]
Added std::string as a built-in type for mapping.

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

11 years agoARM: add a couple more NEON predicates.
Tim Northover [Thu, 24 Oct 2013 12:48:05 +0000 (12:48 +0000)]
ARM: add a couple more NEON predicates.

The fused multiply instructions were added in VFPv4 but are still NEON
instructions, in particular they shouldn't be available on a Cortex-M4 not
matter how floaty it is.

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

11 years agoARM: mark various aliases with their architecture requirements.
Tim Northover [Thu, 24 Oct 2013 12:22:58 +0000 (12:22 +0000)]
ARM: mark various aliases with their architecture requirements.

If an alias inherits directly from InstAlias then it doesn't get any default
"Requires" values, so llvm-mc will allow it even on architectures that don't
support the underlying instruction.

This tidies up the obvious VFP and NEON cases I found.

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

11 years agoAdded tests for microMIPS relocations 1.
Zoran Jovanovic [Thu, 24 Oct 2013 10:55:00 +0000 (10:55 +0000)]
Added tests for microMIPS relocations 1.

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

11 years agoARM: Use non-VFP softcalls on embedded Darwinish targets
Tim Northover [Thu, 24 Oct 2013 10:37:09 +0000 (10:37 +0000)]
ARM: Use non-VFP softcalls on embedded Darwinish targets

The compiler-rt functions __adddf3vfp and so on exist purely to allow Thumb1
code to make use of VFP instructions by switching back to ARM mode, they make
no sense for M-class processors which don't even have an ARM mode.

Given that justification, in practice this is a platform ABI decision so the
actual check is based on that rather than CPU features.

rdar://problem/15302004

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

11 years agoReplaced non-ASCII character.
Yaron Keren [Thu, 24 Oct 2013 10:04:47 +0000 (10:04 +0000)]
Replaced non-ASCII character.

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

11 years agoRevert part of r193291, restoring the deletion of loaded objects.
Chandler Carruth [Thu, 24 Oct 2013 09:52:56 +0000 (09:52 +0000)]
Revert part of r193291, restoring the deletion of loaded objects.
Without this, customers of the MCJIT were leaking memory like crazy.

It's not really clear what the *right* memory management is here, so I'm
not trying to add lots of tests or other logic, just trying to get us
back to a better baseline. I'll follow up on the original commit to
figure out the right path forward.

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

11 years agoARM: fix assert on unpredictable POP instruction.
Tim Northover [Thu, 24 Oct 2013 09:37:18 +0000 (09:37 +0000)]
ARM: fix assert on unpredictable POP instruction.

POP instructions are aliased to the ARM LDM variants but have different syntax.
This caused two problems: we tried to access a non-existent operand to annotate
the '!', and the error message didn't make much sense.

With some vigorous hand-waving in the error message both problems can be
fixed.

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

11 years agoAdded test for -elf configuration, to see that _alloca call is properly
Yaron Keren [Thu, 24 Oct 2013 09:36:08 +0000 (09:36 +0000)]
Added test for -elf configuration, to see that _alloca call is properly
generated. See:

http://llvm.org/viewvc/llvm-project?view=revision&revision=193289

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

11 years agoMake sure SP is always aligned on a 2 byte boundary
Job Noorman [Thu, 24 Oct 2013 09:32:31 +0000 (09:32 +0000)]
Make sure SP is always aligned on a 2 byte boundary

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

11 years agofix PR17635: false positive with packed structures
Nuno Lopes [Thu, 24 Oct 2013 09:17:24 +0000 (09:17 +0000)]
fix PR17635: false positive with packed structures
LLVM optimizers may widen accesses to packed structures that overflow the structure itself, but should be in bounds up to the alignment of the object

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

11 years ago[AArch64] Fix NZCV reg live-in bug in F128CSEL codegen.
Amara Emerson [Thu, 24 Oct 2013 08:28:24 +0000 (08:28 +0000)]
[AArch64] Fix NZCV reg live-in bug in F128CSEL codegen.

When generating the IfTrue basic block during the F128CSEL pseudo-instruction
handling, the NZCV live-in for the newly created BB wasn't being added. This
caused a fault during MI-sched/live range calculation when the predecessor
for the fall-through BB didn't have a live-in for phys-reg as expected.

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

11 years agoInclude missing Compiler.h for using LLVM_ENUM_INT_TYPE.
Zonr Chang [Thu, 24 Oct 2013 08:17:39 +0000 (08:17 +0000)]
Include missing Compiler.h for using LLVM_ENUM_INT_TYPE.

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

11 years agoAVX-512: added VCVTPH2PS, VCVTPS2PH with intrinsics
Elena Demikhovsky [Thu, 24 Oct 2013 07:16:35 +0000 (07:16 +0000)]
AVX-512: added VCVTPH2PS, VCVTPS2PH with intrinsics

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

11 years agoReplace sse41/sse42 with sse4.1/sse4.2 in test command lines to fix bots.
Craig Topper [Thu, 24 Oct 2013 07:00:06 +0000 (07:00 +0000)]
Replace sse41/sse42 with sse4.1/sse4.2 in test command lines to fix bots.

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

11 years agoAdd non-AVX tests for AES intrinsics.
Craig Topper [Thu, 24 Oct 2013 06:50:17 +0000 (06:50 +0000)]
Add non-AVX tests for AES intrinsics.

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

11 years agoAdd tests for SSE intrinsics in non-avx mode by copying from the AVX test cases....
Craig Topper [Thu, 24 Oct 2013 06:45:13 +0000 (06:45 +0000)]
Add tests for SSE intrinsics in non-avx mode by copying from the AVX test cases. Some of these may have been tested by other tests, but most weren't. Patch by Cameron McInally.

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

11 years agoFix a bug in LinearFunctionTestReplace that created invalid loop exit checks.
Juergen Ributzka [Thu, 24 Oct 2013 05:29:56 +0000 (05:29 +0000)]
Fix a bug in LinearFunctionTestReplace that created invalid loop exit checks.

Reviewed by Andy

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

11 years agoFixed llvm-cov to count edges instead of blocks.
Yuchen Wu [Thu, 24 Oct 2013 01:51:04 +0000 (01:51 +0000)]
Fixed llvm-cov to count edges instead of blocks.

This was a fundamental flaw in llvm-cov where it treated the values in
the GCDA files as block counts instead of edge counts. This created
incorrect line counts when branching was present. Instead, the edge
counts should be summed to obtain the correct block count.

The fix was tested using custom test files as well as single source
files from the test-suite directory. The behaviour can be verified by
reading the GCOV documentation that describes the GCDA spec ("ARC_COUNTS
gives the counter values for those arcs that are instrumented") and the
header description provided by GCOVProfiling.cpp ("instruments the code
that runs to records (sic) the edges between blocks that run and emit a
complementary "gcda" file on exit").

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

11 years agoClarify comments in genLoopLimit.
Andrew Trick [Thu, 24 Oct 2013 00:43:38 +0000 (00:43 +0000)]
Clarify comments in genLoopLimit.

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

11 years agoOptimizing MCJIT module state tracking
Andrew Kaylor [Thu, 24 Oct 2013 00:19:14 +0000 (00:19 +0000)]
Optimizing MCJIT module state tracking

Patch co-developed with Yaron Keren.

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

11 years ago(this is a corrected patch)
Yaron Keren [Wed, 23 Oct 2013 23:37:01 +0000 (23:37 +0000)]
(this is a corrected patch)

Calling _chkstk is required on ELF as well as COFF on Windows. Without
_chkstk, functions requiring large stack crash in initialization code.

Previous code tested for COFF format but not Mach-O and this patch modifies
the code to test for Windows OS (both Windows target and MingW target)
but not Mach-O object format: Looks like macho environment was used to
build some EFI code.

Credits to Andrew MacPherson.

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

11 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 23:05:28 +0000 (23:05 +0000)]
Debug Info: code clean up.

Since we never insert DIE for DITemplateTypeParameter to a map, there is no need
to call getDIE in getOrCreateTemplateTypeParameterDIE. It is also renamed to
constructTemplateTypeParameterDIE to match with other construct functions
in CompileUnit.

Same applies to getOrCreateTemplateValueParameterDIE.

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

11 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 23:00:44 +0000 (23:00 +0000)]
Debug Info: code clean up.

Rename createMemberDIE to constructMemberDIE to match other construct functions
in CompileUnit.

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

11 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 22:57:12 +0000 (22:57 +0000)]
Debug Info: code clean up.

Remove the unneeded return values from createMemberDIE, constructEnumTypeDIE,
getOrCreateTemplateTypeParameterDIE, and getOrCreateTemplateValueParameterDIE.

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

11 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 22:52:22 +0000 (22:52 +0000)]
Debug Info: code clean up.

Unifying the argument ordering of private construct functions in CompileUnit to
follow constructTypeDIE(DIE &, DIBasicType),
constructTypeDIE(DIE &, DIDerivedType), constructTypeDIE(DIE &, DICompositeType),
constructSubrangeDIE and constructArrayTypeDIE.

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

11 years agoActually switch the default to use multiprocessing
Rafael Espindola [Wed, 23 Oct 2013 22:32:53 +0000 (22:32 +0000)]
Actually switch the default to use multiprocessing

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

11 years ago[lit] Stop hacking the GIL check interval.
Daniel Dunbar [Wed, 23 Oct 2013 22:19:32 +0000 (22:19 +0000)]
[lit] Stop hacking the GIL check interval.

 - This was never a big win, and is irrelevant now that we commonly use
   multiprocessing based parallelism.

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

11 years ago[lit] Use multiprocessing based parallelism by default, on Unix.
Daniel Dunbar [Wed, 23 Oct 2013 22:19:07 +0000 (22:19 +0000)]
[lit] Use multiprocessing based parallelism by default, on Unix.

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

11 years agoRemove {} from one-line block.
Manman Ren [Wed, 23 Oct 2013 22:12:26 +0000 (22:12 +0000)]
Remove {} from one-line block.

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

11 years agoRevert "Calling _chkstk is required on ELF as well as COFF on Windows. Without _chkst...
Rafael Espindola [Wed, 23 Oct 2013 21:45:09 +0000 (21:45 +0000)]
Revert "Calling _chkstk is required on ELF as well as COFF on Windows. Without _chkstk functions requiring large stack crash in initialization code. Previous code tested for COFF format but not Mach-O and this patch modifies the code to test for Windows."

This reverts commit r193263.

It is causing CodeGen/X86/mingw-alloca.ll to fail.

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

11 years agoFixed doxygen comment to match Module.cpp
Yuchen Wu [Wed, 23 Oct 2013 21:25:44 +0000 (21:25 +0000)]
Fixed doxygen comment to match Module.cpp

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

11 years agoReduce casting and use a fully covered switch.
Rafael Espindola [Wed, 23 Oct 2013 21:24:34 +0000 (21:24 +0000)]
Reduce casting and use a fully covered switch.

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

11 years agoX86: Custom lower sext v16i8 to v16i16, and the corresponding truncate.
Benjamin Kramer [Wed, 23 Oct 2013 21:06:07 +0000 (21:06 +0000)]
X86: Custom lower sext v16i8 to v16i16, and the corresponding truncate.

Also update the cost model.

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

11 years agoFixed comment typo in GCOVProfiling.cpp
Yuchen Wu [Wed, 23 Oct 2013 20:35:00 +0000 (20:35 +0000)]
Fixed comment typo in GCOVProfiling.cpp

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

11 years agoUse a map instead of vector to store line counts.
Yuchen Wu [Wed, 23 Oct 2013 19:45:03 +0000 (19:45 +0000)]
Use a map instead of vector to store line counts.

There are a few motivations for this:
- Using a map allows for checking if line is in map. This differentiates
  unexecutable lines (such as comments) from unexecuted logical lines of
  code. "#####" is now outputted in this case, in line with gcov.
- Source files are no longer read in twice: once when storing the line
  counts, and once when outputting the data.
- Greatly simplifies the function FileInfo::addLineCount().

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

11 years agoCalling _chkstk is required on ELF as well as COFF on Windows.
Yaron Keren [Wed, 23 Oct 2013 19:40:07 +0000 (19:40 +0000)]
Calling _chkstk is required on ELF as well as COFF on Windows.
Without _chkstk functions requiring large stack crash in
initialization code. Previous code tested for COFF format but
not Mach-O and this patch modifies the code to test for Windows.

Credits to Andrew MacPherson.

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

11 years agoX86: Custom lower zext v16i8 to v16i16.
Benjamin Kramer [Wed, 23 Oct 2013 19:19:04 +0000 (19:19 +0000)]
X86: Custom lower zext v16i8 to v16i16.

On sandy bridge (PR17654) we now get
vpxor %xmm1, %xmm1, %xmm1
vpunpckhbw %xmm1, %xmm0, %xmm2
vpunpcklbw %xmm1, %xmm0, %xmm0
vinsertf128 $1, %xmm2, %ymm0, %ymm0

On haswell it's a simple
vpmovzxbw %xmm0, %ymm0

There is a maze of duplicated and dead transforms and patterns in this
area. Remove the dead custom lowering of zext v8i16 to v8i32, that's
already handled by LowerAVXExtend.

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

11 years agoFix PR17631
Michael Liao [Wed, 23 Oct 2013 18:32:43 +0000 (18:32 +0000)]
Fix PR17631

- Skip instructions added in prolog. For specific targets, prolog may
  insert helper function calls (e.g. _chkstk will be called when
  there're more than 4K bytes allocated on stack). However, these
  helpers don't use/def YMM/XMM registers.

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

11 years agoAdd llvm-c-test to check-llvm.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:57:04 +0000 (17:57 +0000)]
Add llvm-c-test to check-llvm.

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

11 years agollvm/tools/llvm-c-test should be built also on msvc.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:59 +0000 (17:56 +0000)]
llvm/tools/llvm-c-test should be built also on msvc.

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

11 years agollvm-c/Target.h: Tweak "inline" for msvc to use __inline instead.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:52 +0000 (17:56 +0000)]
llvm-c/Target.h: Tweak "inline" for msvc to use __inline instead.

FIXME: I don't think it'd be smart.

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

11 years agollvm-c/lto.h: Avoid use of bool.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:46 +0000 (17:56 +0000)]
llvm-c/lto.h: Avoid use of bool.

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

11 years agollvm-c-test: Make them C89-compliant.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:37 +0000 (17:56 +0000)]
llvm-c-test: Make them C89-compliant.

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

11 years agoinclude/llvm-c: Whitespace.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:29 +0000 (17:56 +0000)]
include/llvm-c: Whitespace.

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

11 years agoX86: Make concat_vectors combine a bit more conservative.
Jim Grosbach [Wed, 23 Oct 2013 17:37:40 +0000 (17:37 +0000)]
X86: Make concat_vectors combine a bit more conservative.

Per Nadav's review comments for r192866.

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

11 years agoUse address-taken to disambiguate global variable and indirect memops.
Shuxin Yang [Wed, 23 Oct 2013 17:28:19 +0000 (17:28 +0000)]
Use address-taken to disambiguate global variable and indirect memops.

 Major steps include:
 1). introduces a not-addr-taken bit-field in GlobalVariable
 2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable
    dosen't have its address taken.
 3). AA use this info for disambiguation.

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

11 years agoMark zero-argument functions explicitly in C headers.
Benjamin Kramer [Wed, 23 Oct 2013 16:57:34 +0000 (16:57 +0000)]
Mark zero-argument functions explicitly in C headers.

Pacifies GCC's -Wstrict-prototypes.

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

11 years agoSupport for microMIPS relocations 1.
Zoran Jovanovic [Wed, 23 Oct 2013 16:14:44 +0000 (16:14 +0000)]
Support for microMIPS relocations 1.

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

11 years agoFix cmake dependency on llvm-c-test in test
Anders Waldenborg [Wed, 23 Oct 2013 15:01:23 +0000 (15:01 +0000)]
Fix cmake dependency on llvm-c-test in test

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

11 years ago[mips][msa] Direct Object Emission support for the LSA instruction.
Matheus Almeida [Wed, 23 Oct 2013 13:20:07 +0000 (13:20 +0000)]
[mips][msa] Direct Object Emission support for the LSA instruction.

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

11 years ago[mips][msa] Added support for matching fexp2 from normal IR (i.e. not intrinsics)
Daniel Sanders [Wed, 23 Oct 2013 10:36:52 +0000 (10:36 +0000)]
[mips][msa] Added support for matching fexp2 from normal IR (i.e. not intrinsics)

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

11 years agoMake ARM hint ranges consistent, and add tests for these ranges
Artyom Skrobov [Wed, 23 Oct 2013 10:14:40 +0000 (10:14 +0000)]
Make ARM hint ranges consistent, and add tests for these ranges

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

11 years agoFix check for supported targets in llvm-c lit.local.cfg
Anders Waldenborg [Wed, 23 Oct 2013 08:47:52 +0000 (08:47 +0000)]
Fix check for supported targets in llvm-c lit.local.cfg

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

11 years agoAdd llvm-c-test tool for testing llvm-c
Anders Waldenborg [Wed, 23 Oct 2013 08:10:20 +0000 (08:10 +0000)]
Add llvm-c-test tool for testing llvm-c

This provides rudimentary testing of the llvm-c api.

The following commands are implemented:

  * --module-dump
    Read bytecode from stdin - print ir

  * --module-list-functions
    Read bytecode from stdin - list summary of functions

  * --module-list-globals
    Read bytecode from stdin - list summary of globals

  * --targets-list
    List available targets

  * --object-list-sections
    Read object file from stdin - list sections

  * --object-list-symbols
    Read object file from stdin - list symbols (like nm)

  * --disassemble
    Read lines of triple, hex ascii machine code from stdin - print disassembly

  * --calc
    Read lines of name, rpn from stdin - print generated module ir

Differential-Revision: http://llvm-reviews.chandlerc.com/D1776

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

11 years agoR600/SI: Replace ffs(x) - 1 with countTrailingZeros(x)
Tom Stellard [Wed, 23 Oct 2013 03:50:25 +0000 (03:50 +0000)]
R600/SI: Replace ffs(x) - 1 with countTrailingZeros(x)

ffs(x) broke the mingw buildbot.

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

11 years agoTest commit. Added whitespace in GCOV.cpp.
Yuchen Wu [Wed, 23 Oct 2013 03:41:03 +0000 (03:41 +0000)]
Test commit. Added whitespace in GCOV.cpp.

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

11 years agoR600/SI: fix MIMG writemask adjustement
Tom Stellard [Wed, 23 Oct 2013 02:53:47 +0000 (02:53 +0000)]
R600/SI: fix MIMG writemask adjustement

This fixes piglit:
- shaders/glsl-fs-texture2d-masked
- shaders/glsl-fs-texture2d-masked-4

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193222 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Fix handling of vector kernel arguments
Tom Stellard [Wed, 23 Oct 2013 00:44:32 +0000 (00:44 +0000)]
R600: Fix handling of vector kernel arguments

The SelectionDAGBuilder was promoting vector kernel arguments to legal
types, but this won't work for R600 and SI since kernel arguments are
stored in memory and can't be promoted.  In order to handle vector
arguments correctly we need to look at the original types from the LLVM IR
function.

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

11 years agoSelectionDAG: Pass along the original argument/element type in ISD::InputArg
Tom Stellard [Wed, 23 Oct 2013 00:44:24 +0000 (00:44 +0000)]
SelectionDAG: Pass along the original argument/element type in ISD::InputArg

For some targets, it is useful to be able to look at the original
type of an argument without having to dig through the original IR.

This also fixes a bug in SelectionDAGBuilder where InputArg.PartOffset
was not taking into account the offset of structure elements.

Patch by: Justin Holewinski

Tom Stellard:
  - Changed the type of ArgVT to EVT, so it can store non-simple types
    like v3i32.

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

11 years agoR600/SI: Add support for i64 bitwise or
Tom Stellard [Wed, 23 Oct 2013 00:44:19 +0000 (00:44 +0000)]
R600/SI: Add support for i64 bitwise or

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

11 years agoR600/SI: Use S_LOAD_DWORD instructions for v8i32 and v16i32
Tom Stellard [Wed, 23 Oct 2013 00:44:12 +0000 (00:44 +0000)]
R600/SI: Use S_LOAD_DWORD instructions for v8i32 and v16i32

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

11 years agoMC: Support multiple sections with the same name in the same comdat group
David Blaikie [Tue, 22 Oct 2013 23:41:52 +0000 (23:41 +0000)]
MC: Support multiple sections with the same name in the same comdat group

Code review by Eric Christopher and Rafael Espindola.

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

11 years ago[X86][FastISel] Add a comment to help understanding changes made in r192636.
Quentin Colombet [Tue, 22 Oct 2013 21:29:08 +0000 (21:29 +0000)]
[X86][FastISel] Add a comment to help understanding changes made in r192636.

<rdar://problem/15192473>

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

11 years agoR600/SI: Don't assert on SCC usage
Matt Arsenault [Tue, 22 Oct 2013 21:11:31 +0000 (21:11 +0000)]
R600/SI: Don't assert on SCC usage

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

11 years agoDebug Info: code clean up.
Manman Ren [Tue, 22 Oct 2013 20:59:19 +0000 (20:59 +0000)]
Debug Info: code clean up.

Remove unnecessary creation of LexicalScope in collectDeadVariables.
The created LexicialScope was only used to get isAbstractScope, which
should be false from the creation:
"new LexicalScope(NULL, DIDescriptor(SP), NULL, false);".

We can also remove a DenseMap that holds the created LexicalScopes.

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

11 years agoWhitespace
David Blaikie [Tue, 22 Oct 2013 20:34:30 +0000 (20:34 +0000)]
Whitespace

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

11 years agoDIEHashing: Provide an assert for unreachable functionality regarding friends.
David Blaikie [Tue, 22 Oct 2013 20:28:55 +0000 (20:28 +0000)]
DIEHashing: Provide an assert for unreachable functionality regarding friends.

Since (as of r190716) Clang no longer emits debug info for C++ friend
declarations (and it seems GCC never has/does, which was the motivation
for the Clang change), there's no actual reachable case for implementing
the part of DWARF 4, Section 7.27 part 5 that pertains to friends.

Leave an assert here so that if/when we do have a client producing
friends and using type units, we can fill in the gap and add appropriate
(unit and feature) tests.

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

11 years agollvm-cov: Use uint32_t for loop variables to be more consistent.
Bob Wilson [Tue, 22 Oct 2013 20:02:36 +0000 (20:02 +0000)]
llvm-cov: Use uint32_t for loop variables to be more consistent.

The loop bounds here are uint32_t variables, so it makes sense for the
loop variables to have the same type.

Patch by Yuchen Wu!

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

11 years agollvm-cov: fix a typo and rename a variable.
Bob Wilson [Tue, 22 Oct 2013 19:54:32 +0000 (19:54 +0000)]
llvm-cov: fix a typo and rename a variable.

Rename Size to EndPos, which makes more sense because the variable
stores the last location of the blocks.

Patch by Yuchen Wu!

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

11 years agoARM: provide diagnostics on more writeback LDM/STM instructions
Tim Northover [Tue, 22 Oct 2013 19:00:39 +0000 (19:00 +0000)]
ARM: provide diagnostics on more writeback LDM/STM instructions

The set of circumstances where the writeback register is allowed to be in the
list of registers is rather baroque, but I think this implements them all on
the assembly parsing side.

For disassembly, we still warn about an ARM-mode LDM even if the architecture
revision is < v7 (the required architecture information isn't available). It's
a silly instruction anyway, so hopefully no-one will mind.

rdar://problem/15223374

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

11 years agoR600/SI: Use llvm_unreachable() for an always false assert
Tom Stellard [Tue, 22 Oct 2013 18:42:03 +0000 (18:42 +0000)]
R600/SI: Use llvm_unreachable() for an always false assert

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

11 years agoR600/SI: Fix warning on non-asserts build
Tom Stellard [Tue, 22 Oct 2013 18:31:45 +0000 (18:31 +0000)]
R600/SI: Fix warning on non-asserts build

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

11 years agoR600: Simplify handling of private address space
Tom Stellard [Tue, 22 Oct 2013 18:19:10 +0000 (18:19 +0000)]
R600: Simplify handling of private address space

The AMDGPUIndirectAddressing pass was previously responsible for
lowering private loads and stores to indirect addressing instructions.
However, this pass was buggy and way too complicated.  The only
advantage it had over the new simplified code was that it saved one
instruction per direct write to private memory.  This optimization
likely has a minimal impact on performance, and we may be able
to duplicate it using some other transformation.

For the private address space, we now:
1. Lower private loads/store to Register(Load|Store) instructions
2. Reserve part of the register file as 'private memory'
3. After regalloc lower the Register(Load|Store) instructions to
   MOV instructions that use indirect addressing.

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

11 years agoR600: Remove unused InstrInfo::getMovImmInstr() function
Tom Stellard [Tue, 22 Oct 2013 18:19:01 +0000 (18:19 +0000)]
R600: Remove unused InstrInfo::getMovImmInstr() function

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

11 years agoSimplify testing case (Thanks Rafael for the testing case).
Manman Ren [Tue, 22 Oct 2013 18:15:50 +0000 (18:15 +0000)]
Simplify testing case (Thanks Rafael for the testing case).

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