platform/upstream/llvm.git
9 years agoConverted back to Unix format (after my last commit 222632)
Elena Demikhovsky [Sun, 23 Nov 2014 15:21:53 +0000 (15:21 +0000)]
Converted back to Unix format (after my last commit 222632)

llvm-svn: 222636

9 years ago[X86] Fixes bug in build_vector v4x32 lowering
Michael Kuperstein [Sun, 23 Nov 2014 13:09:06 +0000 (13:09 +0000)]
[X86] Fixes bug in build_vector v4x32 lowering

r222375 made some improvements to build_vector lowering of v4x32 and v4xf32 into an insertps, but it missed a case where:

1. A single extracted element is used twice.
2. The lower of the two non-zero indexes should be preserved, and the higher should be used for the dest mask.

This caused a crash, since the source value for the insertps ends-up uninitialized.

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

llvm-svn: 222635

9 years agoAdd missing override keywords.
Craig Topper [Sun, 23 Nov 2014 09:40:13 +0000 (09:40 +0000)]
Add missing override keywords.

llvm-svn: 222634

9 years agoTablegen output formatting fixes.
Craig Topper [Sun, 23 Nov 2014 09:40:10 +0000 (09:40 +0000)]
Tablegen output formatting fixes.

llvm-svn: 222633

9 years agoMasked Vector Load and Store Intrinsics.
Elena Demikhovsky [Sun, 23 Nov 2014 08:07:43 +0000 (08:07 +0000)]
Masked Vector Load and Store Intrinsics.
Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional memory accesses by generating these intrinsics for existing targets AVX2 and AVX-512. The vectorizer asks the target about availability of masked vector loads and stores.
Added SDNodes for masked operations and lowering patterns for X86 code generator.
Examples:
<16 x i32> @llvm.masked.load.v16i32(i8* %addr, <16 x i32> %passthru, i32 4 /* align */, <16 x i1> %mask)
declare void @llvm.masked.store.v8f64(i8* %addr, <8 x double> %value, i32 4, <8 x i1> %mask)

Scalarizer for other targets (not AVX2/AVX-512) will be done in a separate patch.

http://reviews.llvm.org/D6191

llvm-svn: 222632

9 years agoR600: Fix extloads of i1 on R600/Evergreen
Matt Arsenault [Sun, 23 Nov 2014 02:57:54 +0000 (02:57 +0000)]
R600: Fix extloads of i1 on R600/Evergreen

llvm-svn: 222631

9 years agoR600: Fix assert on copy of an i1 on pre-SI
Matt Arsenault [Sun, 23 Nov 2014 02:57:52 +0000 (02:57 +0000)]
R600: Fix assert on copy of an i1 on pre-SI

i1 is not a legal type on Evergreen, so this combine proceeded
and tried to produce a bitcast between i1 and i8.

llvm-svn: 222630

9 years agoR600/SI: Add additional tests for i1 loads
Matt Arsenault [Sun, 23 Nov 2014 02:57:50 +0000 (02:57 +0000)]
R600/SI: Add additional tests for i1 loads

llvm-svn: 222629

9 years agoR600/SI: Fix broken check lines and modernize prefixes
Matt Arsenault [Sun, 23 Nov 2014 02:57:49 +0000 (02:57 +0000)]
R600/SI: Fix broken check lines and modernize prefixes

Use -LABEL and remove -CHECK

llvm-svn: 222628

9 years agoR600/SI: Fix missing -verify-machineinstrs on a test
Matt Arsenault [Sun, 23 Nov 2014 02:57:47 +0000 (02:57 +0000)]
R600/SI: Fix missing -verify-machineinstrs on a test

llvm-svn: 222627

9 years agoCodeGen: tweak struct ABI handling
Saleem Abdulrasool [Sun, 23 Nov 2014 02:16:24 +0000 (02:16 +0000)]
CodeGen: tweak struct ABI handling

Cygwin and MinGW fail to conform to the underlying system's structure passing
ABI.  Make the check more precise to ensure that we correctly generate code for
the itanium environment.

llvm-svn: 222626

9 years agoInstCombine: Propagate exact for (sdiv X, Pow2) -> (udiv X, Pow2)
David Majnemer [Sat, 22 Nov 2014 20:00:41 +0000 (20:00 +0000)]
InstCombine: Propagate exact for (sdiv X, Pow2) -> (udiv X, Pow2)

llvm-svn: 222625

9 years agoInstCombine: Propagate exact for (sdiv X, Y) -> (udiv X, Y)
David Majnemer [Sat, 22 Nov 2014 20:00:38 +0000 (20:00 +0000)]
InstCombine: Propagate exact for (sdiv X, Y) -> (udiv X, Y)

llvm-svn: 222624

9 years agoInstCombine: Propagate exact for (sdiv -X, C) -> (sdiv X, -C)
David Majnemer [Sat, 22 Nov 2014 20:00:34 +0000 (20:00 +0000)]
InstCombine: Propagate exact for (sdiv -X, C) -> (sdiv X, -C)

llvm-svn: 222623

9 years agoTidied up target triple OS detection. NFC
Simon Pilgrim [Sat, 22 Nov 2014 19:12:10 +0000 (19:12 +0000)]
Tidied up target triple OS detection. NFC

Use Triple::isOS*() helper functions where possible.

llvm-svn: 222622

9 years agoReduce size of some tables in tablegen register info output.
Craig Topper [Sat, 22 Nov 2014 18:30:18 +0000 (18:30 +0000)]
Reduce size of some tables in tablegen register info output.

Primarily done by using SequenceToOffsetTable to reduce the register pressure set tables and then sizing the indices into the tables appropriately. Size a few other table entries based on content as well. Reduces X86RegisterInfo.o by ~9k.

llvm-svn: 222621

9 years agoInstCombine: Propagate exact in (udiv (lshr X,C1),C2) -> (udiv x,C1<<C2)
David Majnemer [Sat, 22 Nov 2014 18:16:54 +0000 (18:16 +0000)]
InstCombine: Propagate exact in (udiv (lshr X,C1),C2) -> (udiv x,C1<<C2)

llvm-svn: 222620

9 years agoTry to fix ARM buildbots
Renato Golin [Sat, 22 Nov 2014 16:59:03 +0000 (16:59 +0000)]
Try to fix ARM buildbots

llvm-svn: 222619

9 years agoSupport matching signext attribute in the parallel_num_threads_codegen test to appeas...
Daniel Sanders [Sat, 22 Nov 2014 16:21:18 +0000 (16:21 +0000)]
Support matching signext attribute in the parallel_num_threads_codegen test to appease clang-cmake-mips builder.

The Mips target adds the signext attribute to signed 32-bit integers in order
to support the N32/N64 correctly. Integers must be promoted to 64-bit bit on
these ABI's.

llvm-svn: 222618

9 years agoSupport matching signext attribute in vla-lambda-capturing test to appease clang...
Daniel Sanders [Sat, 22 Nov 2014 16:08:56 +0000 (16:08 +0000)]
Support matching signext attribute in vla-lambda-capturing test to appease clang-cmake-mips builder.

The Mips target adds the signext attribute to signed 32-bit integers in order
to support the N32/N64 correctly. Integers must be promoted to 64-bit bit on
these ABI's.

llvm-svn: 222617

9 years agoCodeGen: Make atomic operations play nice with address spaces
David Majnemer [Sat, 22 Nov 2014 10:44:12 +0000 (10:44 +0000)]
CodeGen: Make atomic operations play nice with address spaces

We were being a little sloppy with our pointer/address space casts.

This fixes PR21643.

llvm-svn: 222615

9 years ago[x86] Teach the vector shuffle yet another step of canonicalization.
Chandler Carruth [Sat, 22 Nov 2014 09:18:53 +0000 (09:18 +0000)]
[x86] Teach the vector shuffle yet another step of canonicalization.

No functionality changed yet, but this will prevent subsequent patches
from having to handle permutations of various interleaved shuffle
patterns.

llvm-svn: 222614

9 years agoInstCombine: Propagate NSW/NUW for X*(1<<Y) -> X<<Y
David Majnemer [Sat, 22 Nov 2014 08:57:02 +0000 (08:57 +0000)]
InstCombine: Propagate NSW/NUW for X*(1<<Y) -> X<<Y

llvm-svn: 222613

9 years agoInstCombine: Propagate NSW for -X * -Y -> X * Y
David Majnemer [Sat, 22 Nov 2014 07:25:19 +0000 (07:25 +0000)]
InstCombine: Propagate NSW for -X * -Y -> X * Y

llvm-svn: 222612

9 years agoInstSimplify: Simplify (sub 0, X) -> X if it's NUW
David Majnemer [Sat, 22 Nov 2014 07:15:16 +0000 (07:15 +0000)]
InstSimplify: Simplify (sub 0, X) -> X if it's NUW

This is a generalization of the X - (0 - Y) -> X transform.

llvm-svn: 222611

9 years agoSimplify MicrosoftMangleContextImpl::shouldMangleStringLiteral
David Majnemer [Sat, 22 Nov 2014 06:20:38 +0000 (06:20 +0000)]
Simplify MicrosoftMangleContextImpl::shouldMangleStringLiteral

No functionality changed.

llvm-svn: 222610

9 years agoInstCombine: Silence a parenthesis warning
David Majnemer [Sat, 22 Nov 2014 06:09:28 +0000 (06:09 +0000)]
InstCombine: Silence a parenthesis warning

llvm-svn: 222609

9 years agoMark 9 lldb unit tests for ubuntu as XFAIL.
Siva Chandra [Sat, 22 Nov 2014 05:55:00 +0000 (05:55 +0000)]
Mark 9 lldb unit tests for ubuntu as XFAIL.

The following lldb unit tests fail check-lldb on ubuntu:

TestDataFormatterStdMap.py
TestDataFormatterStdVBool.py
TestDataFormatterStdVector.py
TestDataFormatterSynthVal.py
TestEvents.py
TestInitializerList.py
TestMemoryHistory.py
TestReportData.py
TestValueVarUpdate.py

These unit test failures are for non-core functionality. The intent is to
reduce the check-lldb FAILS to core functionality FAILS and then circle
back later and fix these FAILS at a later date.

llvm-svn: 222608

9 years ago[x86] Add some tests for a common unpack pattern of vector shuffle that
Chandler Carruth [Sat, 22 Nov 2014 05:44:43 +0000 (05:44 +0000)]
[x86] Add some tests for a common unpack pattern of vector shuffle that
has a remarkably unique and efficient lowering.

While we get this some of the time already, we miss a few cases and
there wasn't a principled reason we got it. We should at least test
this. v8 already has tests for this pattern.

llvm-svn: 222607

9 years agoInstCombine: Preserve nsw when folding X*(2^C) -> X << C
David Majnemer [Sat, 22 Nov 2014 04:52:55 +0000 (04:52 +0000)]
InstCombine: Preserve nsw when folding X*(2^C) -> X << C

llvm-svn: 222606

9 years agoInstCombine: Preserve nsw/nuw for ((X << C2)*C1) -> (X * (C1 << C2))
David Majnemer [Sat, 22 Nov 2014 04:52:52 +0000 (04:52 +0000)]
InstCombine: Preserve nsw/nuw for ((X << C2)*C1) -> (X * (C1 << C2))

llvm-svn: 222605

9 years agoInstCombine: Preserve nsw for (mul %V, -1) -> (sub 0, %V)
David Majnemer [Sat, 22 Nov 2014 04:52:38 +0000 (04:52 +0000)]
InstCombine: Preserve nsw for (mul %V, -1) -> (sub 0, %V)

llvm-svn: 222604

9 years agoDelay checking overrides for exception specifications if the overridden
Richard Smith [Sat, 22 Nov 2014 03:09:05 +0000 (03:09 +0000)]
Delay checking overrides for exception specifications if the overridden
specification has not yet been parsed.

llvm-svn: 222603

9 years agoFixed an issue where a DW_FORM_ref{2,4,8} might be extracted incorrectly because...
Greg Clayton [Sat, 22 Nov 2014 01:58:59 +0000 (01:58 +0000)]
Fixed an issue where a DW_FORM_ref{2,4,8} might be extracted incorrectly because the wrong compile unit was being used to calculate the compile unit relative offset.

This was fixed by making the DWARFFormValue contain the compile unit that it needs so it can decode its form value correctly. Any form value that requires a compile unit will now assert. If any of the assertions that were added are triggered, then code that led to the extraction of the form value without properly setting the compile unit must be fixed immediately.

<rdar://problem/19035440>

llvm-svn: 222602

9 years agoWhen a RegisterContext produces an invalid CFA address, change
Jason Molenda [Sat, 22 Nov 2014 01:52:03 +0000 (01:52 +0000)]
When a RegisterContext produces an invalid CFA address, change
UnwindLLDB::AddOneMoreFrame to try the fallback unwind plan on
that same stack frame before it tries the fallback unwind plan
on the "next" or callee frame.

In RegisterContextLLDB::TryFallbackUnwindPlan, when we're
trying the fallback unwind plan to see if it is valid, make
sure we change all of the object ivars that might be used in
the process of fetching the CFA & caller's saved pc value
and restore those if we decide not to use the fallback
unwindplan.

<rdar://problem/19035079>

llvm-svn: 222601

9 years agoThis is the first step of making lldb able to create target-specific things
Jim Ingham [Sat, 22 Nov 2014 01:42:44 +0000 (01:42 +0000)]
This is the first step of making lldb able to create target-specific things
(e.g. breakpoints, stop-hooks) before we have any targets - for instance in
your ~/.lldbinit file.  These will then get copied over to any new targets
that get created.  So far, you can only make stop-hooks.

Breakpoints will have to learn to move themselves from target to target for
us to get them from no-target to new-target.

We should also make a command & SB API way to prime this ur-target.

llvm-svn: 222600

9 years agoMake the sourcing of the local .lldbinit file quiet.
Jim Ingham [Sat, 22 Nov 2014 01:33:22 +0000 (01:33 +0000)]
Make the sourcing of the local .lldbinit file quiet.

<rdar://problem/19065278>

llvm-svn: 222599

9 years agoSilence a -Wcast-qual warning
David Majnemer [Sat, 22 Nov 2014 00:45:01 +0000 (00:45 +0000)]
Silence a -Wcast-qual warning

llvm-svn: 222598

9 years ago[ProcessWindows] Clean up the register definitions array.
Zachary Turner [Sat, 22 Nov 2014 00:37:14 +0000 (00:37 +0000)]
[ProcessWindows] Clean up the register definitions array.

llvm-svn: 222597

9 years agoJust a few words to introduce the extra optional argument to Python summaries
Enrico Granata [Sat, 22 Nov 2014 00:06:30 +0000 (00:06 +0000)]
Just a few words to introduce the extra optional argument to Python summaries

llvm-svn: 222594

9 years agoEnable Python summaries to use custom SBTypeSummaryOptions if the user is so inclined...
Enrico Granata [Sat, 22 Nov 2014 00:02:47 +0000 (00:02 +0000)]
Enable Python summaries to use custom SBTypeSummaryOptions if the user is so inclined. Updates to the webdoc will follow

llvm-svn: 222593

9 years agoFix mispelled 'ling' Python property to be 'line' in
Jason Molenda [Sat, 22 Nov 2014 00:00:17 +0000 (00:00 +0000)]
Fix mispelled 'ling' Python property to be 'line' in
SBLineEntry and SBDeclaration.  Patch from Chris Willmore.
<rdar://problem/19054323>

llvm-svn: 222592

9 years agoMS ABI: Mangle u8 string literals
David Majnemer [Fri, 21 Nov 2014 23:56:50 +0000 (23:56 +0000)]
MS ABI: Mangle u8 string literals

UTF8 string literals are mangled just like ASCII string literals.

llvm-svn: 222591

9 years ago[InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence)
Gerolf Hoflehner [Fri, 21 Nov 2014 23:36:44 +0000 (23:36 +0000)]
[InstCombine] Re-commit of  r218721 (Optimize icmp-select-icmp sequence)

Fixes the self-host fail. Note that this commit activates dominator
analysis in the combiner by default (like the original commit did).

llvm-svn: 222590

9 years agoRemove print statement that was accidentally left in.
Greg Clayton [Fri, 21 Nov 2014 23:34:35 +0000 (23:34 +0000)]
Remove print statement that was accidentally left in.

llvm-svn: 222589

9 years agoDon't make check-sanitizer depend on profile on Windows
Reid Kleckner [Fri, 21 Nov 2014 23:09:51 +0000 (23:09 +0000)]
Don't make check-sanitizer depend on profile on Windows

We don't build the profiling library on Windows, so CMake warns that the
target doesn't exist.

llvm-svn: 222588

9 years agoFix transformation of add with pc argument to adr for non-immediate
Joerg Sonnenberger [Fri, 21 Nov 2014 22:39:34 +0000 (22:39 +0000)]
Fix transformation of add with pc argument to adr for non-immediate
arguments.

llvm-svn: 222587

9 years ago[asan] remove old experimental code
Kostya Serebryany [Fri, 21 Nov 2014 22:34:29 +0000 (22:34 +0000)]
[asan] remove old experimental code

llvm-svn: 222586

9 years agoR600/SI: Add a failing test case for offset order in ds_read2 instructions
Tom Stellard [Fri, 21 Nov 2014 22:31:47 +0000 (22:31 +0000)]
R600/SI: Add a failing test case for offset order in ds_read2 instructions

llvm-svn: 222585

9 years agoR600/SI: Add an s_mov_b32 to patterns which use the M0RegClass
Tom Stellard [Fri, 21 Nov 2014 22:31:46 +0000 (22:31 +0000)]
R600/SI: Add an s_mov_b32 to patterns which use the M0RegClass

We need to use a s_mov_b32 rather than a copy, so that CSE will
eliminate redundant moves to the m0 register.

llvm-svn: 222584

9 years agoR600/SI: Emit s_mov_b32 m0, -1 before every DS instruction
Tom Stellard [Fri, 21 Nov 2014 22:31:44 +0000 (22:31 +0000)]
R600/SI: Emit s_mov_b32 m0, -1 before every DS instruction

This s_mov_b32 will write to a virtual register from the M0Reg
class and all the ds instructions now take an extra M0Reg explicit
argument.

This change is necessary to prevent issues with the scheduler
mixing together instructions that expect different values in the m0
registers.

llvm-svn: 222583

9 years agoPer off-list feedback, this API returns the *first* value with a given name, not...
Enrico Granata [Fri, 21 Nov 2014 22:23:08 +0000 (22:23 +0000)]
Per off-list feedback, this API returns the *first* value with a given name, not the *only* one. Rename it to reflect that

llvm-svn: 222582

9 years agoR600/SI: Add SIFoldOperands pass
Tom Stellard [Fri, 21 Nov 2014 22:06:37 +0000 (22:06 +0000)]
R600/SI: Add SIFoldOperands pass

This pass attempts to fold the source operands of mov and copy
instructions into their uses.

llvm-svn: 222581

9 years ago[mips][microMIPS] This patch implements functionality in MIPS delay slot
Jozef Kolek [Fri, 21 Nov 2014 22:04:35 +0000 (22:04 +0000)]
[mips][microMIPS] This patch implements functionality in MIPS delay slot
filler such as if delay slot filler have to put NOP instruction into the
delay slot of microMIPS BEQ or BNE instruction which uses the register $0,
then instead of emitting NOP this instruction is replaced by the corresponding
microMIPS compact branch instruction, i.e. BEQZC or BNEZC.

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

llvm-svn: 222580

9 years agoR600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable
Tom Stellard [Fri, 21 Nov 2014 22:00:16 +0000 (22:00 +0000)]
R600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable

llvm-svn: 222579

9 years agoR600/SI: Use hex notation for constant in test
Tom Stellard [Fri, 21 Nov 2014 22:00:13 +0000 (22:00 +0000)]
R600/SI: Use hex notation for constant in test

llvm-svn: 222578

9 years ago[Hexagon] Adding sxth instruction.
Colin LeMahieu [Fri, 21 Nov 2014 21:54:59 +0000 (21:54 +0000)]
[Hexagon] Adding sxth instruction.

llvm-svn: 222577

9 years agoAdd an API on SBValueList to find the first value with a given name stored in the...
Enrico Granata [Fri, 21 Nov 2014 21:45:03 +0000 (21:45 +0000)]
Add an API on SBValueList to find the first value with a given name stored in the list

llvm-svn: 222576

9 years ago[Hexagon] Adding sxtb instruction. Renaming some identically named classes that...
Colin LeMahieu [Fri, 21 Nov 2014 21:35:52 +0000 (21:35 +0000)]
[Hexagon] Adding sxtb instruction.  Renaming some identically named classes that will be removed after converting referencing defs.

llvm-svn: 222575

9 years ago[Mips] Use endian::read() for relocation addendum reading
Simon Atanasyan [Fri, 21 Nov 2014 21:26:32 +0000 (21:26 +0000)]
[Mips] Use endian::read() for relocation addendum reading

llvm-svn: 222574

9 years ago[asan] add statistic counter to dynamic alloca instrumentation
Kostya Serebryany [Fri, 21 Nov 2014 21:25:18 +0000 (21:25 +0000)]
[asan] add statistic counter to dynamic alloca instrumentation

llvm-svn: 222573

9 years ago[ASan] Get fake stack code working with GCC 4.8.2.
Jay Foad [Fri, 21 Nov 2014 21:25:09 +0000 (21:25 +0000)]
[ASan] Get fake stack code working with GCC 4.8.2.

Summary:
TestCases/Linux/heavy_uar_test.cc was failing on my
PowerPC64 box with GCC 4.8.2, because the compiler recognised
a memset-like loop and turned it into a call to memset, which
got intercepted by __asan_memset, which got upset because it was
being called on an address in high shadow memory.

Use break_optimization to stop the compiler from doing this.

Reviewers: kcc, samsonov

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 222572

9 years ago[Hexagon] Removing SUB_rr and replacing with A2_sub.
Colin LeMahieu [Fri, 21 Nov 2014 21:19:18 +0000 (21:19 +0000)]
[Hexagon] Removing SUB_rr and replacing with A2_sub.

llvm-svn: 222571

9 years agoObjective-C ARC. Fixes a crash when checking for 'weak' propery
Fariborz Jahanian [Fri, 21 Nov 2014 21:12:11 +0000 (21:12 +0000)]
Objective-C ARC. Fixes a crash when checking for 'weak' propery
whose base is not an expression. rdar://19053620

llvm-svn: 222570

9 years agoSema: Don't permit variably modified types in typeid
David Majnemer [Fri, 21 Nov 2014 21:09:12 +0000 (21:09 +0000)]
Sema: Don't permit variably modified types in typeid

GCC and ICC both reject this and the 'Runtime-sized arrays with
automatic storage duration' (N3639) paper forbade this as well.
Previously, we would crash on our way to mangling.

This fixes PR21632.

llvm-svn: 222569

9 years agoImplement -Wcast-qual, fixing #13772.
Roman Divacky [Fri, 21 Nov 2014 21:03:10 +0000 (21:03 +0000)]
Implement -Wcast-qual, fixing #13772.

Many thanks to dblaikie for his advices and suggestions!

llvm-svn: 222568

9 years agoRemove duplication of relocation names in lib/Object/ELFYAML.cpp
Tim Northover [Fri, 21 Nov 2014 20:16:09 +0000 (20:16 +0000)]
Remove duplication of relocation names in lib/Object/ELFYAML.cpp

We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

llvm-svn: 222567

9 years agoRemove duplication of relocation names in lib/Object/ELF.cpp
Tim Northover [Fri, 21 Nov 2014 20:16:07 +0000 (20:16 +0000)]
Remove duplication of relocation names in lib/Object/ELF.cpp

We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

llvm-svn: 222566

9 years agoSplit ELF relocation defintions into per-architecture .def files
Tim Northover [Fri, 21 Nov 2014 20:16:02 +0000 (20:16 +0000)]
Split ELF relocation defintions into per-architecture .def files

This should allow the list of relocations for a particular
architecture to be kept in a single header rather than duplicated
whenever we need to enumerate all the relocations.

Patch by Will Newton.

llvm-svn: 222565

9 years agoMS ABI: Mangle char16_t and char32_t string literals
David Majnemer [Fri, 21 Nov 2014 19:57:25 +0000 (19:57 +0000)]
MS ABI: Mangle char16_t and char32_t string literals

We previously had support for char and wchar_t string literals.  VS 2015
added support for char16_t and char32_t.

String literals must be mangled in the MS ABI in order for them to be
deduplicated across translation units: their linker has no notion of
mergeable section.  Instead, they use the mangled name to make a COMDAT
for the string literal; the COMDAT will merge with other COMDATs in
other object files.

This allows strings in object files generated by clang to get merged
with strings in object files generated by MSVC.

llvm-svn: 222564

9 years agoDebug Info: revert r222195, r222210 and r222239.
Manman Ren [Fri, 21 Nov 2014 19:55:23 +0000 (19:55 +0000)]
Debug Info: revert r222195, r222210 and r222239.

This is no longer needed after David's fix at r222377 + r222485.
rdar://18958417

llvm-svn: 222563

9 years agoDisable header duplication at -Oz in loop-rotate pass.
Roman Divacky [Fri, 21 Nov 2014 19:53:24 +0000 (19:53 +0000)]
Disable header duplication at -Oz in loop-rotate pass.

llvm-svn: 222562

9 years agoDebug Info: add an assertion that the context field of a global variable can not
Manman Ren [Fri, 21 Nov 2014 19:47:48 +0000 (19:47 +0000)]
Debug Info: add an assertion that the context field of a global variable can not
be a DIType with identifier.

This makes sure that there is no need to use DIScopeRef for global variable's
context.

rdar://18958417

llvm-svn: 222561

9 years agoUse isl_schedule_get_ctx
Tobias Grosser [Fri, 21 Nov 2014 19:39:42 +0000 (19:39 +0000)]
Use isl_schedule_get_ctx

llvm-svn: 222560

9 years agoFix typo
Tobias Grosser [Fri, 21 Nov 2014 19:39:38 +0000 (19:39 +0000)]
Fix typo

llvm-svn: 222559

9 years ago[Objective-C] Support a new special module flag that will be put into the
Manman Ren [Fri, 21 Nov 2014 19:24:55 +0000 (19:24 +0000)]
[Objective-C] Support a new special module flag that will be put into the
objc_imageinfo struct.

rdar://17954668

llvm-svn: 222558

9 years agoLazyValueInfo: range'ify some for-loops. No functional change.
Hans Wennborg [Fri, 21 Nov 2014 19:07:46 +0000 (19:07 +0000)]
LazyValueInfo: range'ify some for-loops. No functional change.

llvm-svn: 222557

9 years agoAdd params() to FunctionType. NFC.
Rafael Espindola [Fri, 21 Nov 2014 19:03:35 +0000 (19:03 +0000)]
Add params() to FunctionType. NFC.

While at it, also use makeArrayRef in elements().

llvm-svn: 222556

9 years agoDon't repeat class/function/variable names in comments. NFC.
Sanjay Patel [Fri, 21 Nov 2014 18:58:38 +0000 (18:58 +0000)]
Don't repeat class/function/variable names in comments. NFC.

llvm-svn: 222555

9 years agoLazyValueInfo: fix some typos and indentation, etc. NFC.
Hans Wennborg [Fri, 21 Nov 2014 18:58:23 +0000 (18:58 +0000)]
LazyValueInfo: fix some typos and indentation, etc. NFC.

llvm-svn: 222554

9 years agoAdd and use a helper elements() to StructType. NFC.
Rafael Espindola [Fri, 21 Nov 2014 18:53:05 +0000 (18:53 +0000)]
Add and use a helper elements() to StructType. NFC.

llvm-svn: 222553

9 years agoAdd an assertion for detecting missed/uncorrected TypoExprs.
Kaelyn Takata [Fri, 21 Nov 2014 18:48:06 +0000 (18:48 +0000)]
Add an assertion for detecting missed/uncorrected TypoExprs.

llvm-svn: 222552

9 years agoEnable ActOnIdExpression to use delayed typo correction for non-C++ code
Kaelyn Takata [Fri, 21 Nov 2014 18:48:04 +0000 (18:48 +0000)]
Enable ActOnIdExpression to use delayed typo correction for non-C++ code
when calling DiagnoseEmptyLookup.

llvm-svn: 222551

9 years agoProperly correct initializer expressions based on whether they would be valid.
Kaelyn Takata [Fri, 21 Nov 2014 18:48:00 +0000 (18:48 +0000)]
Properly correct initializer expressions based on whether they would be valid.

llvm-svn: 222550

9 years agoUse the full-Expr filter to disambiguate equidistant correction
Kaelyn Takata [Fri, 21 Nov 2014 18:47:58 +0000 (18:47 +0000)]
Use the full-Expr filter to disambiguate equidistant correction
candidates.

llvm-svn: 222549

9 years agoDo some cleanup of DumpValueObjectOptions. The whole concept of raw printing was...
Enrico Granata [Fri, 21 Nov 2014 18:47:26 +0000 (18:47 +0000)]
Do some cleanup of DumpValueObjectOptions. The whole concept of raw printing was split between feature-specific flags, and an m_be_raw flag, which then drove some other changes in printing behavior. Clean that up, so that each functionality has its own flag .. oh, and make the bools all go in a bitfield since I may want to add more of those over time

llvm-svn: 222548

9 years agoAllow multiple -debug-only args
Matthias Braun [Fri, 21 Nov 2014 18:06:09 +0000 (18:06 +0000)]
Allow multiple -debug-only args

Debug output is shown if any of the -debug-only arguments match.

llvm-svn: 222547

9 years agoLess space; NFC
Sanjay Patel [Fri, 21 Nov 2014 18:05:59 +0000 (18:05 +0000)]
Less space; NFC

llvm-svn: 222546

9 years agoFix formatting. NFC.
Rafael Espindola [Fri, 21 Nov 2014 18:05:55 +0000 (18:05 +0000)]
Fix formatting. NFC.

llvm-svn: 222545

9 years agoAdd a feature flag for slow 32-byte unaligned memory accesses [x86].
Sanjay Patel [Fri, 21 Nov 2014 17:40:04 +0000 (17:40 +0000)]
Add a feature flag for slow 32-byte unaligned memory accesses [x86].

This patch adds a feature flag to avoid unaligned 32-byte load/store AVX codegen
for Sandy Bridge and Ivy Bridge. There is no functionality change intended for
those chips. Previously, the absence of AVX2 was being used as a proxy to detect
this feature. But that hindered codegen for AVX-enabled AMD chips such as btver2
that do not have the 32-byte unaligned access slowdown.

Performance measurements are included in PR21541 ( http://llvm.org/bugs/show_bug.cgi?id=21541 ).

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

llvm-svn: 222544

9 years agoRevert "Allow FDE references outside the +/-2GB range supported by PC relative offset...
Duncan P. N. Exon Smith [Fri, 21 Nov 2014 17:21:18 +0000 (17:21 +0000)]
Revert "Allow FDE references outside the +/-2GB range supported by PC relative offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise."

This reverts commit r222538.

It's causing test failures for CFI, at least on Darwin:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1189/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/1391/

Note that the previous incremental build was on r222537, and the CFI
tests weren't failing:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1188/

llvm-svn: 222542

9 years agoExtend PipePosix with child_processes_inherit support - to control whether pipe handl...
Oleksiy Vyalov [Fri, 21 Nov 2014 16:18:57 +0000 (16:18 +0000)]
Extend PipePosix with child_processes_inherit support - to control whether pipe handles should be inherited by a child process.

http://reviews.llvm.org/D6348

llvm-svn: 222541

9 years ago[x86] Restructure the checking patterns for v16 and v32 avx2 vector
Chandler Carruth [Fri, 21 Nov 2014 14:53:03 +0000 (14:53 +0000)]
[x86] Restructure the checking patterns for v16 and v32 avx2 vector
shuffle lowering to allow much better blend matching.

Specifically, with the new structure the code seems clearer to me and we
correctly can hit the cases where merging two 128-bit lanes is a clear
win and can be shuffled cheaply afterward.

llvm-svn: 222539

9 years agoAllow FDE references outside the +/-2GB range supported by PC relative
Joerg Sonnenberger [Fri, 21 Nov 2014 14:42:43 +0000 (14:42 +0000)]
Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.

Patch from Akos Kiss.

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

llvm-svn: 222538

9 years ago[x86] Make the previous logic significantly less conservative and get
Chandler Carruth [Fri, 21 Nov 2014 14:33:24 +0000 (14:33 +0000)]
[x86] Make the previous logic significantly less conservative and get
a bunch more improvements.

Non-lane-crossing is fine, the key is that lane merging only makes sense
for single-input shuffles. Not sure why I got so turned around here. The
code all works, I was just using the wrong model for it.

This only updates v4 and v8 lowering. The v16 and v32 lowering requires
restructuring the entire check sequence.

llvm-svn: 222537

9 years ago[DAG] Teach how to turn a build_vector into a shuffle if some of the operands are...
Andrea Di Biagio [Fri, 21 Nov 2014 14:32:06 +0000 (14:32 +0000)]
[DAG] Teach how to turn a build_vector into a shuffle if some of the operands are zero.

Before this patch, the DAGCombiner only tried to convert build_vector dag nodes
into shuffles if all operands were either extract_vector_elt or undef.

This patch improves that logic and teaches the DAGCombiner how to deal with
build_vector dag nodes where one or more operands are zero. A build_vector
dag node with some zero operands is turned into a shuffle only if the resulting
shuffle mask is legal for the target.

llvm-svn: 222536

9 years ago[ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint option...
Alexander Potapenko [Fri, 21 Nov 2014 14:12:00 +0000 (14:12 +0000)]
[ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint option in llvm-symbolizer

Let the users of SymbolizationLoop define a function that produces the list of .dSYM hints (possible path to the .dSYM bundle) for the given binary.
Because the hints can't be added to an existing llvm-symbolizer process, we spawn a new symbolizer process ones each time a new hint appears.
Those can only appear for binaries that we haven't seen before.

llvm-svn: 222535

9 years agoclang-format: Understand more lambda return types.
Daniel Jasper [Fri, 21 Nov 2014 14:08:38 +0000 (14:08 +0000)]
clang-format: Understand more lambda return types.

Before:
  auto a = [&b, c ](D * d) -> D * {}

After:
 auto a = [&b, c](D* d) -> D* {}

llvm-svn: 222534

9 years ago[x86] Teach the x86 vector shuffle lowering to detect mergable 128-bit
Chandler Carruth [Fri, 21 Nov 2014 13:56:05 +0000 (13:56 +0000)]
[x86] Teach the x86 vector shuffle lowering to detect mergable 128-bit
lanes.

By special casing these we can often either reduce the total number of
shuffles significantly or reduce the number of (high latency on Haswell)
AVX2 shuffles that potentially cross 128-bit lanes. Even when these
don't actually cross lanes, they have much higher latency to support
that. Doing two of them and a blend is worse than doing a single insert
across the 128-bit lanes to blend and then doing a single interleaved
shuffle.

While this seems like a narrow case, it kept cropping up on me and the
difference is *huge* as you can see in many of the test cases. I first
hit this trying to perfectly fix the interleaving shuffle patterns used
by Halide for AVX2.

llvm-svn: 222533

9 years agosanitizer_common: fix function w/o return
Dmitry Vyukov [Fri, 21 Nov 2014 13:55:19 +0000 (13:55 +0000)]
sanitizer_common: fix function w/o return
When SANITIZER_USES_CANONICAL_LINUX_SYSCALLS the function misses return statement.

llvm-svn: 222532