platform/upstream/llvm.git
10 years agoImprove diagnostic mapping terminology
Alp Toker [Tue, 10 Jun 2014 09:31:37 +0000 (09:31 +0000)]
Improve diagnostic mapping terminology

Diagnostic mappings are used to calculate the final severity of diagnostic
instances.

Detangle the implementation to reflect the terminology used in documentation
and bindings.

No change in functionality.

llvm-svn: 210518

10 years ago[asan] Disable a flaky test.
Evgeniy Stepanov [Tue, 10 Jun 2014 08:32:01 +0000 (08:32 +0000)]
[asan] Disable a flaky test.

llvm-svn: 210517

10 years agoDelete X86JITInfo in the subtarget destructor.
Eric Christopher [Tue, 10 Jun 2014 08:03:42 +0000 (08:03 +0000)]
Delete X86JITInfo in the subtarget destructor.

llvm-svn: 210516

10 years agoDon't suppress backend diagnostics in system headers
Alp Toker [Tue, 10 Jun 2014 07:03:25 +0000 (07:03 +0000)]
Don't suppress backend diagnostics in system headers

Doing so would be inconsistent with the common fallback case where backend
diagnostics without source locations are emitted unconditionally.

llvm-svn: 210515

10 years agoclang-format: Support variadic lambda captures.
Daniel Jasper [Tue, 10 Jun 2014 06:39:03 +0000 (06:39 +0000)]
clang-format: Support variadic lambda captures.

Before:
  return [ i, args... ]{};

After:
  return [i, args...] {};

llvm-svn: 210514

10 years agoclang-format: Handle multiline strings inside ternary expressions.
Daniel Jasper [Tue, 10 Jun 2014 06:27:23 +0000 (06:27 +0000)]
clang-format: Handle multiline strings inside ternary expressions.

With AlwaysSplitBeforeMultilineStrings, clang-format would not find any
valid solution.

llvm-svn: 210513

10 years agoShow -Wdate-time in system headers
Alp Toker [Tue, 10 Jun 2014 06:09:00 +0000 (06:09 +0000)]
Show -Wdate-time in system headers

Anyone enabling this warning would expect to hear about all occurrences
including those in system headers that can cause non-reproducible builds.

To achieve this, rework ShowInSystemHeader to remove broken unused mapping code
that didn't make sense with a simpler and correct scheme.

llvm-svn: 210512

10 years agoImplement -Wdate-time preprocessor warning
Alp Toker [Tue, 10 Jun 2014 06:08:51 +0000 (06:08 +0000)]
Implement -Wdate-time preprocessor warning

This GCC warning is useful for validating reproducible builds
and might help when tracking down issues with modules too.

llvm-svn: 210511

10 years agoImprove specificity in the diag-mapping2.c test
Alp Toker [Tue, 10 Jun 2014 06:08:41 +0000 (06:08 +0000)]
Improve specificity in the diag-mapping2.c test

Make sure grep catches the correct diagnostic, otherwise this test fails to
detect broken functionality.

llvm-svn: 210510

10 years ago[llvm-readobj][ELF] Factor out the code retrieve ELF symbol information
Simon Atanasyan [Tue, 10 Jun 2014 05:59:15 +0000 (05:59 +0000)]
[llvm-readobj][ELF] Factor out the code retrieve ELF symbol information
(section name, section index, full name) into the separate functions.

No functional changes.

llvm-svn: 210509

10 years agoSimplify code. No functional change.
Craig Topper [Tue, 10 Jun 2014 04:50:50 +0000 (04:50 +0000)]
Simplify code. No functional change.

llvm-svn: 210508

10 years agoSmallVectorTest.cpp: Use LLVM_DELETED_FUNCTION.
NAKAMURA Takumi [Tue, 10 Jun 2014 04:06:56 +0000 (04:06 +0000)]
SmallVectorTest.cpp: Use LLVM_DELETED_FUNCTION.

llvm-svn: 210507

10 years ago[mach-o] refactor mach-o output section selection to be table driven.
Nick Kledzik [Tue, 10 Jun 2014 01:50:00 +0000 (01:50 +0000)]
[mach-o] refactor mach-o output section selection to be table driven.

In -r mode the sections use the table used to parse .o files.  Otherwise
use final exectuable table.  No functionality change.

llvm-svn: 210506

10 years agoImprove checking for dynamic initializers of dllimport fields in template instantiation
Hans Wennborg [Tue, 10 Jun 2014 00:55:51 +0000 (00:55 +0000)]
Improve checking for dynamic initializers of dllimport fields in template instantiation

We would previously assert if the initializer was dependent. I also think that
checking isConstantInitializer is more correct here than checkInitIsICE.

llvm-svn: 210505

10 years ago[ConstantHoisting][X86] Improve the cost model for small constants with large types...
Juergen Ributzka [Tue, 10 Jun 2014 00:32:29 +0000 (00:32 +0000)]
[ConstantHoisting][X86] Improve the cost model for small constants with large types (i64 and above).

This improves the X86 cost model for small constants with large types. Before
this commit we would even hoist trivial constants such as i96 2.

This is related to <rdar://problem/17070936>

llvm-svn: 210504

10 years agoMake '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible
Alp Toker [Mon, 9 Jun 2014 23:59:38 +0000 (23:59 +0000)]
Make '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible

It turns out the trailing '=' really is part of the option name spelling and
treating it as such gets us compatible with GCC's -Werror= and pragmas.

(GCC doesn't appear to support any -Wno- form for this diagnostic but we do.)

llvm-svn: 210503

10 years ago[mach-o] parse multiple symbols on same address into aliases
Nick Kledzik [Mon, 9 Jun 2014 23:35:37 +0000 (23:35 +0000)]
[mach-o] parse multiple symbols on same address into aliases

llvm-svn: 210502

10 years agoReorder Value and User fields to save 8 bytes of padding on 64-bit
Reid Kleckner [Mon, 9 Jun 2014 23:32:20 +0000 (23:32 +0000)]
Reorder Value and User fields to save 8 bytes of padding on 64-bit

Reviewered by: rafael

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

llvm-svn: 210501

10 years agoFixed damaged row in issues table; thanks to STL for the catch
Marshall Clow [Mon, 9 Jun 2014 23:27:27 +0000 (23:27 +0000)]
Fixed damaged row in issues table; thanks to STL for the catch

llvm-svn: 210500

10 years agoReduce indentation in ActOnIdExpression, NFC
Reid Kleckner [Mon, 9 Jun 2014 23:16:24 +0000 (23:16 +0000)]
Reduce indentation in ActOnIdExpression, NFC

llvm-svn: 210499

10 years agoRemoving an "if (this == nullptr)" check from two print methods. The condition
Richard Trieu [Mon, 9 Jun 2014 22:53:25 +0000 (22:53 +0000)]
Removing an "if (this == nullptr)" check from two print methods.  The condition
will never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

llvm-svn: 210498

10 years agoRemoving an "if (!this)" check from two print methods. The condition will
Richard Trieu [Mon, 9 Jun 2014 22:53:16 +0000 (22:53 +0000)]
Removing an "if (!this)" check from two print methods.  The condition will
never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

llvm-svn: 210497

10 years agoReduce verbiage of lit.local.cfg files
Alp Toker [Mon, 9 Jun 2014 22:42:55 +0000 (22:42 +0000)]
Reduce verbiage of lit.local.cfg files

We can just split targets_to_build in one place and make it immutable.

llvm-svn: 210496

10 years agoSmallVector: support resize(N) with move-only types
David Blaikie [Mon, 9 Jun 2014 22:26:20 +0000 (22:26 +0000)]
SmallVector: support resize(N) with move-only types

Unfortunately there's no way to elegantly do this with pre-canned
algorithms. Using a generating iterator doesn't work because you default
construct for each element, then move construct into the actual slot
(bad for copy but non-movable types, and a little unneeded overhead even
in the move-only case), so just write it out manually.

This solution isn't exception safe (if one of the element's ctors calls
we don't fall back, destroy the constructed elements, and throw on -
which std::uninitialized_fill does do) but SmallVector (and LLVM) isn't
exception safe anyway.

llvm-svn: 210495

10 years ago[TSan] Exclude blacklist tests from manual test runner
Alexey Samsonov [Mon, 9 Jun 2014 22:02:14 +0000 (22:02 +0000)]
[TSan] Exclude blacklist tests from manual test runner

llvm-svn: 210494

10 years ago[PPC64LE] Generate correct code for unaligned little-endian vector loads
Bill Schmidt [Mon, 9 Jun 2014 22:00:52 +0000 (22:00 +0000)]
[PPC64LE] Generate correct code for unaligned little-endian vector loads

The code in PPCTargetLowering::PerformDAGCombine() that handles
unaligned Altivec vector loads generates a lvsl followed by a vperm.
As we've seen in numerous other places, the vperm instruction has a
big-endian bias, and this is fixed for little endian by complementing
the permute control vector and swapping the input operands.  In this
case the lvsl is providing the permute control vector.  Rather than
generating an lvsl and a complement operation, it is sufficient to
generate an lvsr instruction instead.  Thus for LE code generation we
will generate an lvsr rather than an lvsl, and swap the other input
arguments on the vperm.

The existing test/CodeGen/PowerPC/vec_misalign.ll is updated to test
the code generation for PPC64 and PPC64LE, in addition to the existing
PPC32/G5 testing.

llvm-svn: 210493

10 years agoGenerate better location ranges for some register-described variables.
Alexey Samsonov [Mon, 9 Jun 2014 21:53:47 +0000 (21:53 +0000)]
Generate better location ranges for some register-described variables.

Don't terminate location ranges for register-described variables
at the end of machine basic block if this register is never modified
in the function body, except for the prologue and epilogue. Prologue
location is guessed by FrameSetup flags on MachineInstructions, while
epilogue location is deduced from debug locations of instructions
in the basic blocks ending with return instructions.

This patch is mostly targeted to fix non-trivial debug locations for
variables addressed via stack and frame pointers.

It is not really a generic fix. We can still produce poor debug info
for register-described variables if this register *is* modified somewhere
in the function, but in unrelated places. This might be the case for the debug
info in optimized binaries (e.g. for local variables in inlined functions).
LiveDebugVariables pass in CodeGen attempts to fix this problem by adjusting
DBG_VALUE instructions, but this pass is tied to greedy register allocator,
which is used in optimized builds only. Proper fix would likely involve
generalizing LiveDebugVariables to all register allocators. See more discussion
in http://reviews.llvm.org/D3933 review thread.

I'm proceeding with this patch to fix immediate severe problems and
important cases, e.g. fix completely broken debug info with AddressSanitizer
and fix PR19307 (missing debug info for by-value std::string arguments).

llvm-svn: 210492

10 years agoObjective-C. Consider block pointer as NSObject as well as conforming to
Fariborz Jahanian [Mon, 9 Jun 2014 21:42:01 +0000 (21:42 +0000)]
Objective-C. Consider block pointer as NSObject as well as conforming to
'NSCopying' protocol when diagnosing block to ObjC pointer conversion.
// rdar://16739120

llvm-svn: 210491

10 years agoUpdate langref for unnamed_addr being allowed in aliases.
Rafael Espindola [Mon, 9 Jun 2014 21:21:33 +0000 (21:21 +0000)]
Update langref for unnamed_addr being allowed in aliases.

Thanks to Duncan P. N. Exon Smith and Owen Anderson for noticing.

llvm-svn: 210490

10 years agoARM: add VLA extension for WoA Itanium ABI
Saleem Abdulrasool [Mon, 9 Jun 2014 20:18:42 +0000 (20:18 +0000)]
ARM: add VLA extension for WoA Itanium ABI

The armv7-windows-itanium environment is nearly identical to the MSVC ABI. It
has a few divergences, mostly revolving around the use of the Itanium ABI for
C++. VLA support is one of the extensions that are amongst the set of the
extensions.

This adds support for proper VLA emission for this environment. This is
somewhat similar to the handling for __chkstk emission on X86 and the large
stack frame emission for ARM. The invocation style for chkstk is still
controlled via the -mcmodel flag to clang.

Make an explicit note that this is an extension.

llvm-svn: 210489

10 years agoLook through addrspacecasts when turning ptr comparisons into
Matt Arsenault [Mon, 9 Jun 2014 19:20:29 +0000 (19:20 +0000)]
Look through addrspacecasts when turning ptr comparisons into
index comparisons.

llvm-svn: 210488

10 years agoDisallow multiple inclusion of clang/Config/config.h
Alp Toker [Mon, 9 Jun 2014 19:09:28 +0000 (19:09 +0000)]
Disallow multiple inclusion of clang/Config/config.h

Internal config.h headers are only meant to be included from the main file.

llvm-svn: 210487

10 years agoAdded functions cross-reference test.
Stepan Dyatkovskiy [Mon, 9 Jun 2014 19:03:02 +0000 (19:03 +0000)]
Added functions cross-reference test.
Originally this similar was initiated by Björn Steinbrink here:
http://reviews.llvm.org/D3437

Bug itself has been fixed by principal changes in MergeFunctions. Though
special checks for functions merging are still actual. And the test has
been accepted with slight modifications.

llvm-svn: 210486

10 years agoRemove old fenv.h workaround for a historic clang driver bug
Alp Toker [Mon, 9 Jun 2014 19:00:52 +0000 (19:00 +0000)]
Remove old fenv.h workaround for a historic clang driver bug

Tested and works fine with clang using libstdc++.

All indications are that this was fixed some time ago and isn't a problem with
any clang version we support.

I've added a note in PR6907 which is still open for some reason.

llvm-svn: 210485

10 years agoAllow definition of dllimport static fields in partial specializations (PR19956)
Hans Wennborg [Mon, 9 Jun 2014 18:30:28 +0000 (18:30 +0000)]
Allow definition of dllimport static fields in partial specializations (PR19956)

This expands the logic from r210141 to cover partial specializations too.

llvm-svn: 210484

10 years agoFold FEnv.h into the implementation
Alp Toker [Mon, 9 Jun 2014 18:28:53 +0000 (18:28 +0000)]
Fold FEnv.h into the implementation

Support headers shouldn't use config.h definitions, and they should never be
undefined like this.

ConstantFolding.cpp was the only user of this facility and already includes
config.h for other math features, so it makes sense to move the checks there at
point of use.

(The implicit config.h was also quite dangerous -- removing the FEnv.h include
would have silently disabled math constant folding without causing any tests to
fail. Need to investigate -Wundef once the cleanup is done.)

This eliminates the last config.h include from LLVM headers, paving the way for
more consistent configuration checks.

llvm-svn: 210483

10 years ago[OCaml] Add more Llvm_target tests
Peter Zotov [Mon, 9 Jun 2014 18:28:47 +0000 (18:28 +0000)]
[OCaml] Add more Llvm_target tests

Patch by Jacques-Pascal Deplaix

llvm-svn: 210482

10 years agoAdded gdb-remote test for s packet, single stepping.
Todd Fiala [Mon, 9 Jun 2014 17:46:37 +0000 (17:46 +0000)]
Added gdb-remote test for s packet, single stepping.

llvm-svn: 210481

10 years ago[OCaml] Unbreak Llvm_target.TargetMachine.set_verbose_asm
Peter Zotov [Mon, 9 Jun 2014 17:34:34 +0000 (17:34 +0000)]
[OCaml] Unbreak Llvm_target.TargetMachine.set_verbose_asm

Patch by Jacques-Pascal Deplaix

llvm-svn: 210480

10 years agoMove all of the x86 subtarget initialized variables down into the x86 subtarget
Eric Christopher [Mon, 9 Jun 2014 17:08:19 +0000 (17:08 +0000)]
Move all of the x86 subtarget initialized variables down into the x86 subtarget
from the x86 target machine. Should be no functional change.

llvm-svn: 210479

10 years agoR600/SI: Rename VOP3 helper class to be more general
Matt Arsenault [Mon, 9 Jun 2014 17:00:46 +0000 (17:00 +0000)]
R600/SI: Rename VOP3 helper class to be more general

It has other uses besides shift instructions.

llvm-svn: 210478

10 years ago[X86] Add target combine rules for horizontal add/sub.
Andrea Di Biagio [Mon, 9 Jun 2014 16:54:41 +0000 (16:54 +0000)]
[X86] Add target combine rules for horizontal add/sub.

This patch adds new target specific combine rules to identify horizontal
add/sub idioms from BUILD_VECTOR dag nodes.

This patch also teaches the DAGCombiner how to canonicalize sequences of
insert_vector_elt dag nodes according to the following rule:

  (insert_vector_elt (insert_vector_elt A, I0), I1) ->
    (insert_vecto_elt (insert_vector_elt A, I1), I0)

This new canonicalization rule only triggers if the inner insert_vector
dag node has exactly one use; also, both indices must be known constants,
and I1 < I0.
This last rule made it possible to write a simpler algorithm to identify
horizontal add/sub patterns because now we don't have to worry about the
ordering of insert_vector_elt dag nodes.

llvm-svn: 210477

10 years agoR600/SI: Keep 64-bit not on SALU
Matt Arsenault [Mon, 9 Jun 2014 16:36:31 +0000 (16:36 +0000)]
R600/SI: Keep 64-bit not on SALU

llvm-svn: 210476

10 years agoR600: Fix selection failure for vector bswap
Matt Arsenault [Mon, 9 Jun 2014 16:20:25 +0000 (16:20 +0000)]
R600: Fix selection failure for vector bswap

llvm-svn: 210475

10 years ago[PPC64LE] Generate correct little-endian code for v16i8 multiply
Bill Schmidt [Mon, 9 Jun 2014 16:06:29 +0000 (16:06 +0000)]
[PPC64LE] Generate correct little-endian code for v16i8 multiply

The existing code in PPCTargetLowering::LowerMUL() for multiplying two
v16i8 values assumes that vector elements are numbered in big-endian
order.  For little-endian targets, the vector element numbering is
reversed, but the vmuleub, vmuloub, and vperm instructions still
assume big-endian numbering.  To account for this, we must adjust the
permute control vector and reverse the order of the input registers on
the vperm instruction.

The existing test/CodeGen/PowerPC/vec_mul.ll is updated to be executed
on powerpc64 and powerpc64le targets as well as the original powerpc
(32-bit) target.

llvm-svn: 210474

10 years agoFix test in r210472.
Evgeniy Stepanov [Mon, 9 Jun 2014 14:48:53 +0000 (14:48 +0000)]
Fix test in r210472.

llvm-svn: 210473

10 years ago[msan] Workaround for invalid origins in shufflevector.
Evgeniy Stepanov [Mon, 9 Jun 2014 14:29:34 +0000 (14:29 +0000)]
[msan] Workaround for invalid origins in shufflevector.

Makes origin propagation ignore literal undef operands, and,
in general, any operand we don't have origin for.

https://code.google.com/p/memory-sanitizer/issues/detail?id=56

llvm-svn: 210472

10 years agollvm/test/CodeGen/X86/2014-05-29-factorial.ll: Relax an expression to match Win32...
NAKAMURA Takumi [Mon, 9 Jun 2014 14:20:23 +0000 (14:20 +0000)]
llvm/test/CodeGen/X86/2014-05-29-factorial.ll: Relax an expression to match Win32 x64.

llvm-svn: 210471

10 years ago[mips] Fix a bug for NaCl target - Don't report the error when non-dangerous
Sasa Stankovic [Mon, 9 Jun 2014 14:09:28 +0000 (14:09 +0000)]
[mips] Fix a bug for NaCl target - Don't report the error when non-dangerous
load/store is in branch delay slot.

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

llvm-svn: 210470

10 years ago[Mips] Make dt-textrel.test test case independent from external input files.
Simon Atanasyan [Mon, 9 Jun 2014 13:45:58 +0000 (13:45 +0000)]
[Mips] Make dt-textrel.test test case independent from external input files.

llvm-svn: 210469

10 years ago[X86] Avoid emitting unnecessary test instructions.
Andrea Di Biagio [Mon, 9 Jun 2014 12:34:50 +0000 (12:34 +0000)]
[X86] Avoid emitting unnecessary test instructions.

This patch teaches the backend how to check for the 'NoSignedWrap' flag on
binary operations to improve the emission of 'test' instructions.

If the result of a binary operation is known not to overflow we know that
resetting the Overflow flag is unnecessary and so we can avoid emitting
the test instruction.

Patch by Marcello Maggioni.

llvm-svn: 210468

10 years ago[DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.
Andrea Di Biagio [Mon, 9 Jun 2014 12:32:53 +0000 (12:32 +0000)]
[DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.

This patch modifies SelectionDAGBuilder to construct SDNodes with associated
NoSignedWrap, NoUnsignedWrap and Exact flags coming from IR BinaryOperator
instructions.

Added a new SDNode type called 'BinaryWithFlagsSDNode' to allow accessing
nsw/nuw/exact flags during codegen.

Patch by Marcello Maggioni.

llvm-svn: 210467

10 years ago[X86] Use ADD/SUB instead of INC/DEC for Silvermont
Alexey Volkov [Mon, 9 Jun 2014 11:40:41 +0000 (11:40 +0000)]
[X86] Use ADD/SUB instead of INC/DEC for Silvermont

According to Intel Software Optimization Manual
on Silvermont INC or DEC instructions require
an additional uop to merge the flags.
As a result, a branch instruction depending
on an INC or a DEC instruction incurs a 1 cycle penalty.

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

llvm-svn: 210466

10 years ago[asan] Remove dependency of tests on runtime library in standalone build.
Evgeniy Stepanov [Mon, 9 Jun 2014 11:17:37 +0000 (11:17 +0000)]
[asan] Remove dependency of tests on runtime library in standalone build.

llvm-svn: 210465

10 years ago[AArch64] Missing aliases for CMP/CMN [W]SP with no shift
Artyom Skrobov [Mon, 9 Jun 2014 11:10:14 +0000 (11:10 +0000)]
[AArch64] Missing aliases for CMP/CMN [W]SP with no shift

llvm-svn: 210464

10 years ago[msan] Intercept __strto*_internal.
Evgeniy Stepanov [Mon, 9 Jun 2014 10:41:22 +0000 (10:41 +0000)]
[msan] Intercept __strto*_internal.

This should fix strtoimax/strtoumax on newer glibc.
https://code.google.com/p/memory-sanitizer/issues/detail?id=36

llvm-svn: 210463

10 years ago[docs] Fix typo, align comments, fix syntax highlighting
Jeroen Ketema [Mon, 9 Jun 2014 10:12:29 +0000 (10:12 +0000)]
[docs] Fix typo, align comments, fix syntax highlighting

llvm-svn: 210462

10 years agoRemove dead parameter.
Rui Ueyama [Mon, 9 Jun 2014 09:58:53 +0000 (09:58 +0000)]
Remove dead parameter.

llvm-svn: 210461

10 years ago[mips][mips64r6] Add LDPC instruction
Zoran Jovanovic [Mon, 9 Jun 2014 09:49:51 +0000 (09:49 +0000)]
[mips][mips64r6] Add LDPC instruction
Differential Revision: http://reviews.llvm.org/D3822

llvm-svn: 210460

10 years agoFix line numbers for code inlined from __nodebug__ functions.
Evgeniy Stepanov [Mon, 9 Jun 2014 09:09:19 +0000 (09:09 +0000)]
Fix line numbers for code inlined from __nodebug__ functions.

Instructions from __nodebug__ functions don't have file:line
information even when inlined into no-nodebug functions. As a result,
intrinsics (SSE and other) from <*intrin.h> clang headers _never_
have file:line information.

With this change, an instruction without !dbg metadata gets one from
the call instruction when inlined.

Fixes PR19001.

llvm-svn: 210459

10 years ago[msan] Add a test for mmx.packuswb.
Evgeniy Stepanov [Mon, 9 Jun 2014 08:58:41 +0000 (08:58 +0000)]
[msan] Add a test for mmx.packuswb.

llvm-svn: 210458

10 years ago[msan] Simplify tests.
Evgeniy Stepanov [Mon, 9 Jun 2014 08:57:40 +0000 (08:57 +0000)]
[msan] Simplify tests.

llvm-svn: 210457

10 years agoRe-commit r210425.
Rui Ueyama [Mon, 9 Jun 2014 08:57:37 +0000 (08:57 +0000)]
Re-commit r210425.

llvm-svn: 210456

10 years agoAdd missing dependency for check-lld.
Rui Ueyama [Mon, 9 Jun 2014 08:42:38 +0000 (08:42 +0000)]
Add missing dependency for check-lld.

llvm-svn: 210455

10 years ago[msan] Fix vector pack intrinsic handling.
Evgeniy Stepanov [Mon, 9 Jun 2014 08:40:16 +0000 (08:40 +0000)]
[msan] Fix vector pack intrinsic handling.

This fixes a crash on MMX intrinsics, as well as a corner case in handling of
all unsigned pack intrinsics.

PR19953.

llvm-svn: 210454

10 years agoR600: Add more and testcases
Matt Arsenault [Mon, 9 Jun 2014 08:36:53 +0000 (08:36 +0000)]
R600: Add more and testcases

llvm-svn: 210453

10 years ago[asan] Add malloc_usable_size to android malloc dispatch.
Evgeniy Stepanov [Mon, 9 Jun 2014 08:36:14 +0000 (08:36 +0000)]
[asan] Add malloc_usable_size to android malloc dispatch.

llvm-svn: 210452

10 years agoRevert "[Mips] Make got16.test test case independent from external input files."
Rui Ueyama [Mon, 9 Jun 2014 08:23:58 +0000 (08:23 +0000)]
Revert "[Mips] Make got16.test test case independent from external input files."

This reverts commit r210425 because the test added in the commit
is broken.

llvm-svn: 210451

10 years agoFix gcc warning (enumeral and non-enumeral type in conditional expression)
Patrik Hagglund [Mon, 9 Jun 2014 07:35:07 +0000 (07:35 +0000)]
Fix gcc warning (enumeral and non-enumeral type in conditional expression)

llvm-svn: 210450

10 years ago[PPC64LE] Implement little-endian semantics for vec_sums
Bill Schmidt [Mon, 9 Jun 2014 03:31:47 +0000 (03:31 +0000)]
[PPC64LE] Implement little-endian semantics for vec_sums

The PowerPC vsumsws instruction, accessed via vec_sums, is defined
architecturally with a big-endian bias, in that the second input vector
and the result always reference big-endian element 3 (little-endian
element 0).  For ease of porting, the programmer wants elements 3 in
both cases.

To provide this semantics, for little endian we generate a permute for
the second input vector prior to the vsumsws instruction, and generate
a permute for the result vector following the vsumsws instruction.

The correctness of this code is tested by the new sums.c test added in
a previous patch, as well as the modifications to
builtins-ppc-altivec.c in the present patch.

llvm-svn: 210449

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Mon, 9 Jun 2014 02:04:02 +0000 (02:04 +0000)]
[C++11] Use 'nullptr'.

llvm-svn: 210448

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Mon, 9 Jun 2014 02:03:06 +0000 (02:03 +0000)]
[C++11] Use 'nullptr'.

llvm-svn: 210447

10 years ago[AArch64] Fix the ordering of the accumulate operand in SchedRW list.
Chad Rosier [Mon, 9 Jun 2014 01:54:00 +0000 (01:54 +0000)]
[AArch64] Fix the ordering of the accumulate operand in SchedRW list.
Patch by Dave Estes <cestes@codeaurora.org>
http://reviews.llvm.org/D4037

llvm-svn: 210446

10 years ago[AArch64] When combining constant mul of power of 2 plus/minus 1, prefer shift
Chad Rosier [Mon, 9 Jun 2014 01:25:51 +0000 (01:25 +0000)]
[AArch64] When combining constant mul of power of 2 plus/minus 1, prefer shift
plus add.  The shift can be folded into the add.  This only effects codegen
when the constant is 3.

llvm-svn: 210445

10 years ago[SeparateConstOffsetFromGEP] inbounds zext => sext for better splitting
Jingyue Wu [Sun, 8 Jun 2014 23:49:34 +0000 (23:49 +0000)]
[SeparateConstOffsetFromGEP] inbounds zext => sext for better splitting

For each array index that is in the form of zext(a), convert it to sext(a)
if we can prove zext(a) <= max signed value of typeof(a). The conversion
helps to split zext(x + y) into sext(x) + sext(y).

Reviewed in http://reviews.llvm.org/D4060

llvm-svn: 210444

10 years agoEscape "@function" with \verbatim. [-Wdocumentation]
NAKAMURA Takumi [Sun, 8 Jun 2014 23:25:02 +0000 (23:25 +0000)]
Escape "@function" with \verbatim. [-Wdocumentation]

llvm-svn: 210443

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Sun, 8 Jun 2014 22:29:17 +0000 (22:29 +0000)]
[C++11] Use 'nullptr'.

llvm-svn: 210442

10 years agoConvert tests I recently add to use -verify instead of FileCheck.
Joey Gouly [Sun, 8 Jun 2014 21:28:54 +0000 (21:28 +0000)]
Convert tests I recently add to use -verify instead of FileCheck.

This uncovered something strange. Diagnostics for InlineAsm have source locations
that don't really map to where they are within the .c source file.

llvm-svn: 210440

10 years ago[SeparateConstOffsetFromGEP] Fix an illegitimate optimization on zext
Jingyue Wu [Sun, 8 Jun 2014 20:19:38 +0000 (20:19 +0000)]
[SeparateConstOffsetFromGEP] Fix an illegitimate optimization on zext

zext(a + b) != zext(a) + zext(b) even if a + b >= 0 && b >= 0.

e.g., a = i4 0b1111, b = i4 0b0001
zext a + b to i8 = zext 0b0000 to i8 = 0b00000000
(zext a to i8) + (zext b to i8) = 0b00001111 + 0b00000001 = 0b00010000

llvm-svn: 210439

10 years agoRefactor canonicalizing array indices to a helper function
Jingyue Wu [Sun, 8 Jun 2014 20:15:45 +0000 (20:15 +0000)]
Refactor canonicalizing array indices to a helper function

No functionality changes.

llvm-svn: 210438

10 years ago[SeparateConstOffsetFromGEP] make two tests more strict
Jingyue Wu [Sun, 8 Jun 2014 20:01:42 +0000 (20:01 +0000)]
[SeparateConstOffsetFromGEP] make two tests more strict

inbounds are not necessary in these two tests. zext(a +nuw b) = zext(a) +
zext(b) should hold with or without inbounds.

llvm-svn: 210437

10 years agoSmallVector: Improve test coverage for insert with repetition
David Blaikie [Sun, 8 Jun 2014 19:33:40 +0000 (19:33 +0000)]
SmallVector: Improve test coverage for insert with repetition

To test cases that involve actual repetition (> 1 elements), at least
one element before the insertion point, and some elements of the
original range that still fit in that range space after insertion.

Actually we need coverage for the inverse case too (where no elements
after the insertion point fit into the previously allocated space), but
this'll do for now, and I might end up rewriting bits of SmallVector to
avoid that special case anyway.

llvm-svn: 210436

10 years agoScalarEvolution: Derive element size from the type of the loaded element
Tobias Grosser [Sun, 8 Jun 2014 19:21:20 +0000 (19:21 +0000)]
ScalarEvolution: Derive element size from the type of the loaded element

Before, we where looking at the size of the pointer type that specifies the
location from which to load the element. This did not make any sense at all.

This change fixes a bug in the delinearization where we failed to delinerize
certain load instructions.

llvm-svn: 210435

10 years agoSmallVector: More movable improvements - don't copy elements to make space when inser...
David Blaikie [Sun, 8 Jun 2014 19:12:31 +0000 (19:12 +0000)]
SmallVector: More movable improvements - don't copy elements to make space when inserting repeated elements.

Also split and improve tests a bit.

llvm-svn: 210433

10 years agoSmallVector: Move, don't copy, elements to make space for an insertion.
David Blaikie [Sun, 8 Jun 2014 19:12:28 +0000 (19:12 +0000)]
SmallVector: Move, don't copy, elements to make space for an insertion.

llvm-svn: 210432

10 years agoX86: simplify data layout calculation
Saleem Abdulrasool [Sun, 8 Jun 2014 19:08:36 +0000 (19:08 +0000)]
X86: simplify data layout calculation

X86Subtarget::isTargetCygMing || X86Subtarget::isTargetKnownWindowsMSVC is
equivalent to all Windows environments.  Simplify the check to isOSWindows.
NFC.

llvm-svn: 210431

10 years agoSmallVectorTest: Remove some more robust checks added in r210429 since they caught...
David Blaikie [Sun, 8 Jun 2014 17:33:47 +0000 (17:33 +0000)]
SmallVectorTest: Remove some more robust checks added in r210429 since they caught some bugs I haven't fixed yet.

Specifically this caused inserting an element from a SmallVector into
itself when such an insertion would cause a reallocation. We have code
to handle this for non-reallocating cases, but it's not robust against
reallocation.

llvm-svn: 210430

10 years agoFix some more moving-from-moved-from objects issues in SmallVector
David Blaikie [Sun, 8 Jun 2014 16:55:13 +0000 (16:55 +0000)]
Fix some more moving-from-moved-from objects issues in SmallVector

(& because it makes it easier to test, this also improves
correctness/performance slightly by moving the last element in an insert
operation, rather than copying it)

llvm-svn: 210429

10 years agoAPFloat: x - NaN needs to flip the signbit of NaN when x is a number.
Stephen Canon [Sun, 8 Jun 2014 16:53:31 +0000 (16:53 +0000)]
APFloat: x - NaN needs to flip the signbit of NaN when x is a number.

Because we don't have a separate negate( ) function, 0 - NaN does double-duty as the IEEE-754 negate( ) operation, which (unlike most FP ops) *does* attach semantic meaning to the signbit of NaN.

llvm-svn: 210428

10 years agoAsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperand
David Blaikie [Sun, 8 Jun 2014 16:18:35 +0000 (16:18 +0000)]
AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperand

I saw at least a memory leak or two from inspection (on probably
untested error paths) and r206991, which was the original inspiration
for this change.

I ran this idea by Jim Grosbach a few weeks ago & he was OK with it.
Since it's a basically mechanical patch that seemed sufficient - usual
post-commit review, revert, etc, as needed.

llvm-svn: 210427

10 years agoEnsure SmallVector::insert doesn't overwrite the last element in the range with the...
David Blaikie [Sun, 8 Jun 2014 16:00:02 +0000 (16:00 +0000)]
Ensure SmallVector::insert doesn't overwrite the last element in the range with the already-moved-from value

This would cause the last element in a range to be in a moved-from state
after an insert at a non-end position, losing that value entirely in the
process.

Side note: move_backward is subtle. It copies [A, B) to C-1 and down.
(the fact that it decrements both the second and third iterators before
the first movement is the subtle part... kind of surprising, anyway)

llvm-svn: 210426

10 years ago[Mips] Make got16.test test case independent from external input files.
Simon Atanasyan [Sun, 8 Jun 2014 11:33:05 +0000 (11:33 +0000)]
[Mips] Make got16.test test case independent from external input files.

llvm-svn: 210425

10 years agoRevert "Do materialize for floating point"
Alp Toker [Sun, 8 Jun 2014 09:13:42 +0000 (09:13 +0000)]
Revert "Do materialize for floating point"

1) The commit was made despite profound lack of understanding:

   "I did not understand the comment about using dyn_cast instead of isa. I will
   commit as is and make the update after. You can explain what you meant to me."

   Commit first, understand later isn't OK.

2) Review comments were simply ignored:

   "Can you edit the summary to describe what the patch is for? It appears to be
   a list of commits at the moment."

3) The patch got LGTM'd off-list without any indication of readiness.

4) The public mailing list was excluded from patch review so all of this was
   hidden from the community.

This reverts commit r210414.

llvm-svn: 210424

10 years ago[C++11] Use 'nullptr'. Unittests edition.
Craig Topper [Sun, 8 Jun 2014 08:38:12 +0000 (08:38 +0000)]
[C++11] Use 'nullptr'. Unittests edition.

llvm-svn: 210423

10 years ago[C++11] Use 'nullptr'. Tools edition.
Craig Topper [Sun, 8 Jun 2014 08:38:04 +0000 (08:38 +0000)]
[C++11] Use 'nullptr'. Tools edition.

llvm-svn: 210422

10 years agoRemove outdated CMake MSVC workaround
Alp Toker [Sun, 8 Jun 2014 07:37:17 +0000 (07:37 +0000)]
Remove outdated CMake MSVC workaround

llvm-svn: 210421

10 years agoSplit out inline asm parsing into ParseStmtAsm.cpp
Alp Toker [Sun, 8 Jun 2014 05:40:04 +0000 (05:40 +0000)]
Split out inline asm parsing into ParseStmtAsm.cpp

This change isolates various llvm/MC headers from the rest of the parser and
better aligns with the existing SemaStmtAsm.cpp.

No change in functionality, code move only.

llvm-svn: 210420

10 years agoRemove redundant typedef from MCAsmParserSemaCallback
Alp Toker [Sun, 8 Jun 2014 05:14:54 +0000 (05:14 +0000)]
Remove redundant typedef from MCAsmParserSemaCallback

The last use has been removed in clang r210418.

llvm-svn: 210419

10 years agoDon't include llvm/MC/MCParser throughout all of Sema
Alp Toker [Sun, 8 Jun 2014 05:11:37 +0000 (05:11 +0000)]
Don't include llvm/MC/MCParser throughout all of Sema

Requires LLVM r210417.

llvm-svn: 210418

10 years agoMake InlineAsmIdentifierInfo forward-declarable
Alp Toker [Sun, 8 Jun 2014 05:07:38 +0000 (05:07 +0000)]
Make InlineAsmIdentifierInfo forward-declarable

This helps localize header inclusion in the frontend.

llvm-svn: 210417