platform/upstream/llvm.git
8 years ago[InstCombine] Added more specific SSE2/AVX2 vector shift tests.
Simon Pilgrim [Wed, 5 Aug 2015 08:21:38 +0000 (08:21 +0000)]
[InstCombine] Added more specific SSE2/AVX2 vector shift tests.

llvm-svn: 244022

8 years agoFixed line endings.
Simon Pilgrim [Wed, 5 Aug 2015 08:18:00 +0000 (08:18 +0000)]
Fixed line endings.

llvm-svn: 244021

8 years ago[MachineCombiner] Don't use the opcode-only form of computeInstrLatency
Hal Finkel [Wed, 5 Aug 2015 07:45:28 +0000 (07:45 +0000)]
[MachineCombiner] Don't use the opcode-only form of computeInstrLatency

In r242277, I updated the MachineCombiner to work with itineraries, but I
missed a call that is scheduling-model-only (the opcode-only form of
computeInstrLatency). Using the form that takes an MI* allows this to work with
itineraries (and should be NFC for subtargets with scheduling models).

llvm-svn: 244020

8 years ago[llvm-objdump] Call exit(1) on error, i.e. fail early.
Davide Italiano [Wed, 5 Aug 2015 07:18:31 +0000 (07:18 +0000)]
[llvm-objdump] Call exit(1) on error, i.e. fail early.

Previously we kept going on partly corrupted input, which might result
in garbage being printed, or even worse, random crashes.
Rafael mentioned that this is the GNU behavior as well, but after some
discussion we both agreed it's probably better to emit a reasonable
error message and exit. As a side-effect of this commit, now we don't
rely on global state for error codes anymore. objdump was the last tool
in the toolchain which needed to be converted. Hopefully the old behavior
won't sneak into the tree again.

llvm-svn: 244019

8 years agoDon't repeat function names in comments. NFC.
Filipe Cabecinhas [Wed, 5 Aug 2015 06:19:26 +0000 (06:19 +0000)]
Don't repeat function names in comments. NFC.

llvm-svn: 244018

8 years agounittests/ADT/ArrayRefTest.cpp: Suppress r243995 on g++-4.8 for now to unbreak bots.
NAKAMURA Takumi [Wed, 5 Aug 2015 06:11:23 +0000 (06:11 +0000)]
unittests/ADT/ArrayRefTest.cpp: Suppress r243995 on g++-4.8 for now to unbreak bots.

For example of mingw-w64-g++-4.8.1,

  llvm/unittests/ADT/ArrayRefTest.cpp: In member function 'virtual void {anonymous}::ArrayRefTest_AllocatorCopy_Test::TestBody()':
  llvm/unittests/ADT/ArrayRefTest.cpp:56:40: internal compiler error: in count_type_elements, at expr.c:5523
     } Array3Src[] = {{"hello"}, {"world"}};
                                          ^
  Please submit a full bug report,
  with preprocessed source if appropriate.

llvm-svn: 244017

8 years agoWindows/COM.inc: Fix emacs mode in the first line.
NAKAMURA Takumi [Wed, 5 Aug 2015 06:11:08 +0000 (06:11 +0000)]
Windows/COM.inc: Fix emacs mode in the first line.

llvm-svn: 244016

8 years agoTemporarily revert r244012 while we see if it's really necessary.
Eric Christopher [Wed, 5 Aug 2015 05:32:22 +0000 (05:32 +0000)]
Temporarily revert r244012 while we see if it's really necessary.
Add a comment explaining the current theory as to why we'd need
the -lole32 on the link line.

llvm-svn: 244015

8 years agoRemove autoconf checks for sigsetjmp and siglongjmp as they appear to
Eric Christopher [Wed, 5 Aug 2015 04:50:46 +0000 (04:50 +0000)]
Remove autoconf checks for sigsetjmp and siglongjmp as they appear to
be unused.

llvm-svn: 244014

8 years agoRemove the apparently unused rand48 configure checks and associated m4.
Eric Christopher [Wed, 5 Aug 2015 04:50:43 +0000 (04:50 +0000)]
Remove the apparently unused rand48 configure checks and associated m4.

llvm-svn: 244013

8 years agoRemove obsolete configure check for libole32 as we don't appear to use
Eric Christopher [Wed, 5 Aug 2015 04:50:40 +0000 (04:50 +0000)]
Remove obsolete configure check for libole32 as we don't appear to use
it anymore.

llvm-svn: 244012

8 years agoRemove the unused header check for utime.h.
Eric Christopher [Wed, 5 Aug 2015 04:50:37 +0000 (04:50 +0000)]
Remove the unused header check for utime.h.

llvm-svn: 244011

8 years agoUpdate links to lists.llvm.org.
Tanya Lattner [Wed, 5 Aug 2015 04:19:04 +0000 (04:19 +0000)]
Update links to lists.llvm.org.

llvm-svn: 244009

8 years agoUpdate to lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 04:04:09 +0000 (04:04 +0000)]
Update to lists.llvm.org

llvm-svn: 244008

8 years agoUpdate to new lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 04:03:05 +0000 (04:03 +0000)]
Update to new lists.llvm.org

llvm-svn: 244007

8 years agoUpdate to new lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 04:02:43 +0000 (04:02 +0000)]
Update to new lists.llvm.org

llvm-svn: 244006

8 years agoUpdate to new lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 04:01:47 +0000 (04:01 +0000)]
Update to new lists.llvm.org

llvm-svn: 244005

8 years agoUpdate to new lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 04:01:26 +0000 (04:01 +0000)]
Update to new lists.llvm.org

llvm-svn: 244004

8 years agoUpdate references to lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 03:59:14 +0000 (03:59 +0000)]
Update references to lists.llvm.org

llvm-svn: 244003

8 years agoUpdate references to new lists.llvm.org mailing lists.
Tanya Lattner [Wed, 5 Aug 2015 03:58:00 +0000 (03:58 +0000)]
Update references to new lists.llvm.org mailing lists.

llvm-svn: 244002

8 years agoUpdate references to new lists.llvm.org mailing lists.
Tanya Lattner [Wed, 5 Aug 2015 03:56:44 +0000 (03:56 +0000)]
Update references to new lists.llvm.org mailing lists.

llvm-svn: 244001

8 years agoUpdate mailing list references to lists.llvm.org
Tanya Lattner [Wed, 5 Aug 2015 03:55:23 +0000 (03:55 +0000)]
Update mailing list references to lists.llvm.org

llvm-svn: 244000

8 years agoRename all references to old mailing lists to new lists.llvm.org address.
Tanya Lattner [Wed, 5 Aug 2015 03:51:17 +0000 (03:51 +0000)]
Rename all references to old mailing lists to new lists.llvm.org address.

llvm-svn: 243999

8 years agoAvoid passing nullptr to std::equal.
Yaron Keren [Tue, 4 Aug 2015 15:57:04 +0000 (15:57 +0000)]
Avoid passing nullptr to std::equal.
As documented in the LLVM Coding Standards, indeed MSVC incorrectly asserts
on this in Debug mode. This happens when building clang with Visual C++ and
-triple i686-pc-windows-gnu on these clang regression tests:

 clang/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c
 clang/test/CodeGen/empty-union-init.c

llvm-svn: 243996

8 years ago[ArrayRef] Make copy use std::uninitialized_copy.
Benjamin Kramer [Tue, 4 Aug 2015 15:52:56 +0000 (15:52 +0000)]
[ArrayRef] Make copy use std::uninitialized_copy.

std::copy does not work for non-trivially copyable classes when we're
copying into uninitialized memory.

llvm-svn: 243995

8 years agowrap OptSize and MinSize attributes for easier and consistent access (NFCI)
Sanjay Patel [Tue, 4 Aug 2015 15:49:57 +0000 (15:49 +0000)]
wrap OptSize and MinSize attributes for easier and consistent access (NFCI)

Create wrapper methods in the Function class for the OptimizeForSize and MinSize
attributes. We want to hide the logic of "or'ing" them together when optimizing
just for size (-Os).

Currently, we are not consistent about this and rely on a front-end to always set
OptimizeForSize (-Os) if MinSize (-Oz) is on. Thus, there are 18 FIXME changes here
that should be added as follow-on patches with regression tests.

This patch is NFC-intended: it just replaces existing direct accesses of the attributes
by the equivalent wrapper call.

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

llvm-svn: 243994

8 years agoCreate ObjectFile with the correct endian and word size.
Rafael Espindola [Tue, 4 Aug 2015 15:45:54 +0000 (15:45 +0000)]
Create ObjectFile with the correct endian and word size.

The writer is still hard coded to 64 bits le, but with this we can test for
invalid ELF files.

llvm-svn: 243993

8 years ago[CodeGen] Fold memcpy into SmallVector initializer. No functionality change.
Benjamin Kramer [Tue, 4 Aug 2015 15:38:49 +0000 (15:38 +0000)]
[CodeGen] Fold memcpy into SmallVector initializer. No functionality change.

llvm-svn: 243992

8 years ago[RuntimeDyld] Adapt PPC64 relocations to PPC32
Hal Finkel [Tue, 4 Aug 2015 15:29:00 +0000 (15:29 +0000)]
[RuntimeDyld] Adapt PPC64 relocations to PPC32

Begin adapting some of the implemented PPC64 relocations for PPC32 (with a
test case).

Patch by Pierre-Andre Saulais!

llvm-svn: 243991

8 years ago[x86] machine combiner reassociation: mark EFLAGS operand as 'dead'
Sanjay Patel [Tue, 4 Aug 2015 15:21:56 +0000 (15:21 +0000)]
[x86] machine combiner reassociation: mark EFLAGS operand as 'dead'

In the commentary for D11660, I wasn't sure if it was alright to create new
integer machine instructions without also creating the implicit EFLAGS operand.
From what I can see, the implicit operand is always created by the MachineInstrBuilder
based on the instruction type, so we don't have to do that explicitly. However, in
reviewing the debug output, I noticed that the operand was not marked as 'dead'.
The machine combiner should do that to preserve future optimization opportunities
that may be checking for that dead EFLAGS operand themselves.

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

llvm-svn: 243990

8 years ago[Sema] Add a crazy test case for r243987
Benjamin Kramer [Tue, 4 Aug 2015 15:18:16 +0000 (15:18 +0000)]
[Sema] Add a crazy test case for r243987

It's not valid code (maybe it can be made valid, but I'm not sure how).
To trigger the crash fixed in r243987 requires a friend function with
more than four template parameter lists. With this test we have at least
some coverage.

llvm-svn: 243989

8 years agoUse make_unique. NFC.
Rafael Espindola [Tue, 4 Aug 2015 15:06:36 +0000 (15:06 +0000)]
Use make_unique. NFC.

llvm-svn: 243988

8 years ago[Sema] Allocate SmallVector to the right size.
Benjamin Kramer [Tue, 4 Aug 2015 14:46:06 +0000 (14:46 +0000)]
[Sema] Allocate SmallVector to the right size.

SmallVector::set_size does not reallocate the vector. Sadly I have no
idea how to test this. The vector never has more than one member in all
of the regression tests.

Found by inspection.

llvm-svn: 243987

8 years ago[mips][FastISel] Disable code generation for unsupported targets through FastISel.
Vasileios Kalintiris [Tue, 4 Aug 2015 14:35:50 +0000 (14:35 +0000)]
[mips][FastISel] Disable code generation for unsupported targets through FastISel.

Summary:
Previously, we would check whether the target is supported or not, only in
fastSelectInstruction(). This means that 64-bit targets could use FastISel too.
We fix this by checking every overridden method of the FastISel class and
by falling back to SelectionDAG if the target isn't supported. This change
should have been committed along with r243638, but somehow I missed it.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 243986

8 years agoThe SymbolTable doesn't need to be a template.
Rafael Espindola [Tue, 4 Aug 2015 14:29:01 +0000 (14:29 +0000)]
The SymbolTable doesn't need to be a template.

It was already using just code that is common to all object files.

llvm-svn: 243985

8 years agoRevert r229675 - [mips] Avoid redundant sign extension of the result of binary bitwis...
Vasileios Kalintiris [Tue, 4 Aug 2015 14:26:35 +0000 (14:26 +0000)]
Revert r229675 - [mips] Avoid redundant sign extension of the result of binary bitwise instructions.

It introduced two regressions on 64-bit big-endian targets running under N32
(MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4, and
MultiSource/Applications/kimwitu++/kc) The issue is that on 64-bit targets
comparisons such as BEQ compare the whole GPR64 but incorrectly tell the
instruction selector that they operate on GPR32's. This leads to the
elimination of i32->i64 extensions that are actually required by
comparisons to work correctly.

There's currently a patch under review that fixes this problem.

llvm-svn: 243984

8 years agoRemove a silly return.
Rafael Espindola [Tue, 4 Aug 2015 14:08:11 +0000 (14:08 +0000)]
Remove a silly return.

llvm-svn: 243983

8 years agoThis function never returns null, don't check it.
Rafael Espindola [Tue, 4 Aug 2015 14:00:56 +0000 (14:00 +0000)]
This function never returns null, don't check it.

llvm-svn: 243982

8 years agoOptionally model read-only scalars
Tobias Grosser [Tue, 4 Aug 2015 13:54:20 +0000 (13:54 +0000)]
Optionally model read-only scalars

Even though read-only accesses to scalars outside of a scop do not need to be
modeled to derive valid transformations or to generate valid sequential code,
but information about them is useful when we considering memory footprint
analysis and/or kernel offloading.

llvm-svn: 243981

8 years agoRemove SymbolTable::getChunks.
Rafael Espindola [Tue, 4 Aug 2015 13:39:30 +0000 (13:39 +0000)]
Remove SymbolTable::getChunks.

When we were using a std::sort over all the chunks we needed to put them in a
single storage.

Now that we just iterate over them and use a map to find the output section,
we can avoid allocating the temporary storage.

llvm-svn: 243980

8 years ago[AST] Really allocate a SmallVector to the right size.
Benjamin Kramer [Tue, 4 Aug 2015 13:34:50 +0000 (13:34 +0000)]
[AST] Really allocate a SmallVector to the right size.

set_size only resets the end pointer and asserts if it is used to grow
the buffer. This would crash when mangling a float with more than 80 bits,
add a test with a ppc double double (128 bits).

Found by inspection.

llvm-svn: 243979

8 years ago[lldb-mi] Fix non-OS X builds.
Bruce Mitchener [Tue, 4 Aug 2015 13:25:23 +0000 (13:25 +0000)]
[lldb-mi] Fix non-OS X builds.

llvm-svn: 243978

8 years agoFix 80-column
Duncan P. N. Exon Smith [Tue, 4 Aug 2015 13:24:26 +0000 (13:24 +0000)]
Fix 80-column

llvm-svn: 243977

8 years agoLinker: Fix ASan failure from r243961
Duncan P. N. Exon Smith [Tue, 4 Aug 2015 13:23:30 +0000 (13:23 +0000)]
Linker: Fix ASan failure from r243961

r243883 and r243961 made a use-after-free far more likely:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/6041/steps/check-llvm%20asan/logs/stdio

Unresolved nodes get inserted into the `Cycles` array.  If they later
get resolved through RAUW, we need to update the reference.  It's
interesting that this never hit before (maybe an asan-ified clang
bootstrap with `-flto -g` would have hit it, but I admit I haven't tried
anything quite that crazy).

llvm-svn: 243976

8 years ago[lldb-mi] Simplify MICmnMIOutOfBandRecord implementation.
Bruce Mitchener [Tue, 4 Aug 2015 13:12:31 +0000 (13:12 +0000)]
[lldb-mi] Simplify MICmnMIOutOfBandRecord implementation.

Summary:
* Remove extraneous members that were just storing temporary
  values.
* OutOfBand_e parameters don't need to be const as they are
  scalars.
* Switch from a map with CMIUtilString values to using a mapping
  function. This uses a switch statement which will generate
  a warning if a new result class is added.
* Make BuildAsyncRecord a static function rather than a private
  member function so that we can construct the result text
  correctly and avoid having extra stuff in the header.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 243975

8 years ago[AST] Simplify code by letting ArrayRef do the copying.
Benjamin Kramer [Tue, 4 Aug 2015 12:59:41 +0000 (12:59 +0000)]
[AST] Simplify code by letting ArrayRef do the copying.

No functionality change intended.

llvm-svn: 243974

8 years ago[CodeGen] Don't write into a SmallVector's uninitialized memory.
Benjamin Kramer [Tue, 4 Aug 2015 12:34:30 +0000 (12:34 +0000)]
[CodeGen] Don't write into a SmallVector's uninitialized memory.

That's just ugly and not needed in this case. No functionality change.

llvm-svn: 243973

8 years ago[ASTContext] Add a templated convenience wrapper for Allocate.
Benjamin Kramer [Tue, 4 Aug 2015 12:34:23 +0000 (12:34 +0000)]
[ASTContext] Add a templated convenience wrapper for Allocate.

This brings ASTContext closer to LLVM's Allocator concept. Ideally we
would just derive ASTContext from llvm::AllocatorBase, but that does
not work because ASTContext's allocator is mutable and we allocate using
const ASTContext& everywhere.

llvm-svn: 243972

8 years agoRun ScopInfo after the ScopViewers
Tobias Grosser [Tue, 4 Aug 2015 11:49:39 +0000 (11:49 +0000)]
Run ScopInfo after the ScopViewers

This change is required to see the detected scops even in cases where there is
no other ScopInfo user after the ScopViewers. Before this change, when
running with -polly-optimizer=none -polly-code-generator=none detected scops
have not been shown.

llvm-svn: 243971

8 years ago[FileManager] Use StringRef::copy to store canonical paths.
Benjamin Kramer [Tue, 4 Aug 2015 11:27:08 +0000 (11:27 +0000)]
[FileManager] Use StringRef::copy to store canonical paths.

No functional change intended.

llvm-svn: 243970

8 years ago[OPENMP 4.1] Support for 'linear' clause in loop directives.
Alexey Bataev [Tue, 4 Aug 2015 11:18:19 +0000 (11:18 +0000)]
[OPENMP 4.1] Support for  'linear' clause in loop directives.

OpenMP 4.1 allows 'linear' clause in loop directives. Patch adds support for it.

llvm-svn: 243969

8 years ago[Edit] Use StringRef's copy method. No functional change intended.
Benjamin Kramer [Tue, 4 Aug 2015 11:18:09 +0000 (11:18 +0000)]
[Edit] Use StringRef's copy method. No functional change intended.

llvm-svn: 243968

8 years ago[lldb-mi] Use empty arg lists instead of (void).
Bruce Mitchener [Tue, 4 Aug 2015 10:24:20 +0000 (10:24 +0000)]
[lldb-mi] Use empty arg lists instead of (void).

Summary: This brings the code more in line with the usual LLDB style. NFC.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 243967

8 years ago[AST] Use StringRef's convenient copy method. No functionality change.
Benjamin Kramer [Tue, 4 Aug 2015 10:22:38 +0000 (10:22 +0000)]
[AST] Use StringRef's convenient copy method. No functionality change.

llvm-svn: 243966

8 years agoDrive-by fixes for LandingPad -> EHPad
David Majnemer [Tue, 4 Aug 2015 08:21:40 +0000 (08:21 +0000)]
Drive-by fixes for LandingPad -> EHPad

This change was done as an audit and is by inspection.  The new EH
system is still very much a work in progress.  NFC for the landingpad
case.

llvm-svn: 243965

8 years ago[OPENMP] Fix compiler crash during data-sharing attributes analysis.
Alexey Bataev [Tue, 4 Aug 2015 08:10:48 +0000 (08:10 +0000)]
[OPENMP] Fix compiler crash during data-sharing attributes analysis.

If a global variable is marked as private in OpenMP construct and then is used in of the private clauses of the same construct, it might cause compiler crash because of incorrect capturing.

llvm-svn: 243964

8 years ago[InstCombine] Split off SSE2/AVX2 vector shift tests.
Simon Pilgrim [Tue, 4 Aug 2015 08:05:27 +0000 (08:05 +0000)]
[InstCombine] Split off SSE2/AVX2 vector shift tests.

These aren't vector demanded bits tests. More tests to follow.

llvm-svn: 243963

8 years ago[InstCombine] Moved SSE vector shift constant folding into its own helper function...
Simon Pilgrim [Tue, 4 Aug 2015 07:49:58 +0000 (07:49 +0000)]
[InstCombine] Moved SSE vector shift constant folding into its own helper function. NFCI.

This will make some upcoming bugfixes + improvements easier to manage.

llvm-svn: 243962

8 years agoLinker: Fix references to uniqued nodes after r243883
Duncan P. N. Exon Smith [Tue, 4 Aug 2015 06:42:31 +0000 (06:42 +0000)]
Linker: Fix references to uniqued nodes after r243883

r243883 started moving 'distinct' nodes instead of duplicated them in
lib/Linker.  This had the side-effect of sometimes not cloning uniqued
nodes that reference them.  I missed a corner case:

    !named = !{!0}
    !0 = !{!1}
    !1 = distinct !{!0}

!0 is the entry point for "remapping", and a temporary clone (say,
!0-temp) is created and mapped in case we need to model a uniquing
cycle.

    Recursive descent into !1.  !1 is distinct, so we leave it alone,
    but update its operand to !0-temp.

Pop back out to !0.  Its only operand, !1, hasn't changed, so we don't
need to use !0-temp.  !0-temp goes out of scope, and we're finished
remapping, but we're left with:

    !named = !{!0}
    !0 = !{!1}
    !1 = distinct !{null} ; uh oh...

Previously, if !0 and !0-temp ended up with identical operands, then
!0-temp couldn't have been referenced at all.  Now that distinct nodes
don't get duplicated, that assumption is invalid.  We need to
!0-temp->replaceAllUsesWith(!0) before freeing !0-temp.

I found this while running an internal `-flto -g` bootstrap.  Strangely,
there was no case of this in the open source bootstrap I'd done before
commit...

llvm-svn: 243961

8 years agoUpdate test suite to make "ninja check" succeed without native backend builtin
Mehdi Amini [Tue, 4 Aug 2015 06:32:54 +0000 (06:32 +0000)]
Update test suite to make "ninja check" succeed without native backend builtin

Requires "native" feature in most places that were failing.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243960

8 years agoMove generic MIR tests in their own subdir, requires "native" as well
Mehdi Amini [Tue, 4 Aug 2015 06:32:45 +0000 (06:32 +0000)]
Move generic MIR tests in their own subdir, requires "native" as well

These tests rely on the native backend to be built-in.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243959

8 years agoImprove lit "native" feature to check if the native backend is builtin
Mehdi Amini [Tue, 4 Aug 2015 06:32:31 +0000 (06:32 +0000)]
Improve lit "native" feature to check if the native backend is builtin

The goal is to have 'ninja check' passing even if the X86 backend is
not built.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243958

8 years agoRemove the configure and cmake checks for sys/wait.h
Justin Bogner [Tue, 4 Aug 2015 06:29:58 +0000 (06:29 +0000)]
Remove the configure and cmake checks for sys/wait.h

If we don't have sys/wait.h and we're on a unix system there's no way
that several of the llvm tools work at all. This includes clang.

Just remove the configure and cmake checks entirely - we'll get a
build error instead of building something broken now.

llvm-svn: 243957

8 years ago[SDAG] Fix a result chain in ExpandUnalignedLoad
Hal Finkel [Tue, 4 Aug 2015 06:29:12 +0000 (06:29 +0000)]
[SDAG] Fix a result chain in ExpandUnalignedLoad

On the code path in ExpandUnalignedLoad which expands an unaligned vector/fp
value in terms of a legal integer load of the same size, the ChainResult needs
to be the chain result of the integer load.

No in-tree test case is currently available.

Patch by Jan Hranac!

llvm-svn: 243956

8 years ago[LAA] Remove unused pointer partition argument from addRuntimeCheck, NFC
Adam Nemet [Tue, 4 Aug 2015 05:16:20 +0000 (05:16 +0000)]
[LAA] Remove unused pointer partition argument from addRuntimeCheck, NFC

This variant of addRuntimeCheck is only used now from the LoopVectorizer
which does not use this parameter.

llvm-svn: 243955

8 years agoIntroduce enum value for previously defined metadata -- make.implicit
Chen Li [Tue, 4 Aug 2015 04:41:34 +0000 (04:41 +0000)]
Introduce enum value for previously defined metadata -- make.implicit

Summary: This patch adds enum value for an existing metadata type -- make.implicit. Using preassigned enum will be helpful to get compile time type checking and avoid string construction and comparison. The patch also changes uses of make.implicit from string metadata to enum metadata. There is no functionality change.

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 243954

8 years ago[debugserver] Fix "control may reach end of non-void function" warnings.
Bruce Mitchener [Tue, 4 Aug 2015 04:01:16 +0000 (04:01 +0000)]
[debugserver] Fix "control may reach end of non-void function" warnings.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 243953

8 years agoARM: support windows division routines
Saleem Abdulrasool [Tue, 4 Aug 2015 03:57:56 +0000 (03:57 +0000)]
ARM: support windows division routines

This adds the software division routines for the Windows RTABI.  These are not
expected to be used often though as most modern Windows ARM capable targets
support hardware division.  In the case that the target CPU doesnt support
hardware division, this will be the fallback.

llvm-svn: 243952

8 years agoARM: make Darwin libcall registration table driven (NFC)
Saleem Abdulrasool [Tue, 4 Aug 2015 03:57:52 +0000 (03:57 +0000)]
ARM: make Darwin libcall registration table driven (NFC)

Make the libcall updating table driven similar to the approach that the Linux
and Windows codepath does below.  NFC.

llvm-svn: 243951

8 years ago[UB] Avoid a really broken call to realloc that would later result in
Chandler Carruth [Tue, 4 Aug 2015 03:53:04 +0000 (03:53 +0000)]
[UB] Avoid a really broken call to realloc that would later result in
a bad call to memcpy.

When we only have a buffer from one of the two reparse calls, we can
just return that buffer rather than going through the realloc/memcpy
dance.

Found with UBsan.

llvm-svn: 243950

8 years ago[UB] Guard two calls to memcpy in generated attribute code to handle
Chandler Carruth [Tue, 4 Aug 2015 03:53:01 +0000 (03:53 +0000)]
[UB] Guard two calls to memcpy in generated attribute code to handle
null StringRef objects as inputs.

Found by UBSan.

llvm-svn: 243949

8 years ago[UB] Another place where we were trying to put string data into
Chandler Carruth [Tue, 4 Aug 2015 03:53:00 +0000 (03:53 +0000)]
[UB] Another place where we were trying to put string data into
a BumpPtrAllocator. This at least now handles the case where there is no
concatentation without calling memcpy on a null pointer. It might be
interesting to handle the case where everything is empty without
round-tripping through the allocator, but it wasn't clear to me if the
pointer returned is significant in any way, so I've left it in
a conservatively more-correct state.

Again, found with UBSan.

llvm-svn: 243948

8 years ago[UB] When attaching empty strings to the AST, use an empty StringRef
Chandler Carruth [Tue, 4 Aug 2015 03:52:58 +0000 (03:52 +0000)]
[UB] When attaching empty strings to the AST, use an empty StringRef
rather than forcing the bump pointer allocator to produce a viable
pointer. This also fixes UB when we would try to memcpy from the null
incoming StringRef.

llvm-svn: 243947

8 years ago[UB] Fix the two ways that we would try to memcpy from a null buffer in
Chandler Carruth [Tue, 4 Aug 2015 03:52:56 +0000 (03:52 +0000)]
[UB] Fix the two ways that we would try to memcpy from a null buffer in
the nested name specifier code.

First, skip the entire thing when the input is empty.

Next, handle the case where we started off with a null buffer and a zero
capacity to skip copying and freeing.

This was found with UBSan.

llvm-svn: 243946

8 years ago[UB] Fix two cases of UB in copy/pasted code from SmallVector.
Chandler Carruth [Tue, 4 Aug 2015 03:52:52 +0000 (03:52 +0000)]
[UB] Fix two cases of UB in copy/pasted code from SmallVector.

We should really stop copying and pasting code around. =/

Found by UBSan.

llvm-svn: 243945

8 years ago[UB] Don't allocate space for contained types and then try to copy the
Chandler Carruth [Tue, 4 Aug 2015 03:48:26 +0000 (03:48 +0000)]
[UB] Don't allocate space for contained types and then try to copy the
contained types into the space when we have no contained types. This
fixes the UB stemming from a call to memcpy with a null pointer. This
also reduces the calls to allocate because this actually happens in
a notable client - Clang.

Found by UBSan.

llvm-svn: 243944

8 years agoBump the version # in the xcode proj file from major number 340 to 350.
Jason Molenda [Tue, 4 Aug 2015 03:14:49 +0000 (03:14 +0000)]
Bump the version # in the xcode proj file from major number 340 to 350.
The SB API for major version 340 won't be changing any more.

llvm-svn: 243943

8 years ago[GettingStarted.rst] Commit the right patch.
Sean Silva [Tue, 4 Aug 2015 03:12:33 +0000 (03:12 +0000)]
[GettingStarted.rst] Commit the right patch.

Looks like the rebased version that Mehdi committed didn't incorporate
the latest changes.

Patch by Erik de Castro Lopo <erikd@mega-nerd.com>!

llvm-svn: 243942

8 years agoFix cmake build on non-Windows platforms.
Bruce Mitchener [Tue, 4 Aug 2015 02:41:49 +0000 (02:41 +0000)]
Fix cmake build on non-Windows platforms.

r243914 introduced a change which mistakenly tried to build the
Windows minidump code on all platforms rather than only on Windows.

llvm-svn: 243941

8 years ago[modules] Make IndirectFieldDecl mergeable to avoid lookup ambiguity when the same...
Richard Smith [Tue, 4 Aug 2015 02:05:09 +0000 (02:05 +0000)]
[modules] Make IndirectFieldDecl mergeable to avoid lookup ambiguity when the same anonymous union is defined across multiple modules.

llvm-svn: 243940

8 years agoRevert "[LSR] Generate and use zero extends"
Sanjoy Das [Tue, 4 Aug 2015 01:52:05 +0000 (01:52 +0000)]
Revert "[LSR] Generate and use zero extends"

This reverts commit r243348 and r243357.  They caused PR24347.

llvm-svn: 243939

8 years agoRemove unused header include.
Argyrios Kyrtzidis [Tue, 4 Aug 2015 01:44:13 +0000 (01:44 +0000)]
Remove unused header include.

llvm-svn: 243938

8 years agoChange char_traits<char16_t>::eof() to return 0xFFFF instead of 0xDFFF. Fixes PR...
Marshall Clow [Tue, 4 Aug 2015 01:38:34 +0000 (01:38 +0000)]
Change char_traits<char16_t>::eof() to return 0xFFFF instead of 0xDFFF. Fixes PR#24342

llvm-svn: 243937

8 years ago[AArch64] Rename FP formats to be more consistent. NFC.
Ahmed Bougacha [Tue, 4 Aug 2015 01:38:08 +0000 (01:38 +0000)]
[AArch64] Rename FP formats to be more consistent. NFC.

Some are named "FP", others "SD", others still "FP*SD".
Rename all this to just use "FP", which, except for conversions
(which don't use this format naming scheme), implies "SD" anyway.

llvm-svn: 243936

8 years ago[AArch64] Add isel support for f16 indexed LD/ST.
Ahmed Bougacha [Tue, 4 Aug 2015 01:29:38 +0000 (01:29 +0000)]
[AArch64] Add isel support for f16 indexed LD/ST.

llvm-svn: 243935

8 years ago[UB] Fix yet another use of memcpy with a null pointer argument. I think
Chandler Carruth [Tue, 4 Aug 2015 01:00:56 +0000 (01:00 +0000)]
[UB] Fix yet another use of memcpy with a null pointer argument. I think
this is the last of them in my build of LLVM. Haven't tried Clang yet.

Found via UBSan.

llvm-svn: 243934

8 years ago[AArch64][v8.1a] The "pan" sysreg isn't MSR-specific. NFCI.
Ahmed Bougacha [Tue, 4 Aug 2015 00:55:11 +0000 (00:55 +0000)]
[AArch64][v8.1a] The "pan" sysreg isn't MSR-specific. NFCI.

It's already in SysRegMappings, no need to also have it in MSRMappings:
the latter is only used if we didn't find a match in the former.

llvm-svn: 243933

8 years ago[UB] Fix another place where we would pass a null pointer to memcpy.
Chandler Carruth [Tue, 4 Aug 2015 00:53:01 +0000 (00:53 +0000)]
[UB] Fix another place where we would pass a null pointer to memcpy.

This too was found by UBSan. Down to 35 failures for me.

llvm-svn: 243932

8 years ago[AArch64] Remove unnecessary "break". NFC.
Ahmed Bougacha [Tue, 4 Aug 2015 00:49:08 +0000 (00:49 +0000)]
[AArch64] Remove unnecessary "break".  NFC.

llvm-svn: 243931

8 years ago[AArch64] Use SDValue bool operator. NFC.
Ahmed Bougacha [Tue, 4 Aug 2015 00:48:02 +0000 (00:48 +0000)]
[AArch64] Use SDValue bool operator.  NFC.

llvm-svn: 243930

8 years agoAdd a -revert option to utils/release/merge.sh
Hans Wennborg [Tue, 4 Aug 2015 00:47:58 +0000 (00:47 +0000)]
Add a -revert option to utils/release/merge.sh

llvm-svn: 243929

8 years ago[UB] Fix a nasty place where we would pass null pointers to memcpy.
Chandler Carruth [Tue, 4 Aug 2015 00:44:07 +0000 (00:44 +0000)]
[UB] Fix a nasty place where we would pass null pointers to memcpy.

This happens to work, but is not guaranteed to work. Indeed, most memcpy
interfaces in Linux-land annotate these arguments as nonnull, and GCC
and LLVM both can and do optimized based upon that. When they do so,
they might legitimately have miscompiled code calling this routine with
two valid iterators, 'nullptr' and 'nullptr'. There was even code doing
precisely this because StringRef().begin() and StringRef().end() both
produce null pointers.

This was found by UBSan.

llvm-svn: 243927

8 years ago[AArch64] Vector FCOPYSIGN supports Custom-lowering: mark it as such.
Ahmed Bougacha [Tue, 4 Aug 2015 00:42:34 +0000 (00:42 +0000)]
[AArch64] Vector FCOPYSIGN supports Custom-lowering: mark it as such.

There's a bunch of code in LowerFCOPYSIGN that does smart lowering, and
is actually already vector-aware; let's use it instead of scalarizing!

The only interesting change is that for v2f32, we previously always used
use v4i32 as the integer vector type.
Use v2i32 instead, and mark FCOPYSIGN as Custom.

llvm-svn: 243926

8 years ago[CodeGen] Fix FCOPYSIGN legalization to account for mismatched types.
Ahmed Bougacha [Tue, 4 Aug 2015 00:32:55 +0000 (00:32 +0000)]
[CodeGen] Fix FCOPYSIGN legalization to account for mismatched types.

We used to legalize it like it's any other binary operations.  It's not,
because it accepts mismatched operand types.  Because of that, we used
to hit various asserts and miscompiles.

Specialize vector legalizations to, in the worst case, unroll, or, when
possible, to just legalize the operand that needs legalization.

Scalarization isn't covered, because I can't think of a target where
some but not all of the 1-element vector types are to be scalarized.

llvm-svn: 243924

8 years agoMIR Serialization: Serialize the 'volatile' machine memory operand flag.
Alex Lorenz [Tue, 4 Aug 2015 00:24:45 +0000 (00:24 +0000)]
MIR Serialization: Serialize the 'volatile' machine memory operand flag.

llvm-svn: 243923

8 years agoXFAIL TestInferiorAssert for Android API <= 16.
Chaoren Lin [Mon, 3 Aug 2015 23:59:41 +0000 (23:59 +0000)]
XFAIL TestInferiorAssert for Android API <= 16.

llvm-svn: 243922

8 years ago[LAA] Remove unused needsAnyChecking(), NFC
Adam Nemet [Mon, 3 Aug 2015 23:33:03 +0000 (23:33 +0000)]
[LAA] Remove unused needsAnyChecking(), NFC

llvm-svn: 243921

8 years ago[LoopVer] Remove unused needsRuntimeChecks(), NFC
Adam Nemet [Mon, 3 Aug 2015 23:32:57 +0000 (23:32 +0000)]
[LoopVer] Remove unused needsRuntimeChecks(), NFC

The previous commits moved this functionality into the client.

Also remove the now unused member variable.

llvm-svn: 243920

8 years agoDocs: s/Sanitiser/Sanitizer/ for consistency
Mehdi Amini [Mon, 3 Aug 2015 23:25:46 +0000 (23:25 +0000)]
Docs: s/Sanitiser/Sanitizer/ for consistency

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243918

8 years agoGettingStarted.rst: Add info about building sanitizers
Mehdi Amini [Mon, 3 Aug 2015 23:17:47 +0000 (23:17 +0000)]
GettingStarted.rst: Add info about building sanitizers

From: Erik de Castro Lopo <erikd@qti.qualcomm.com>
llvm-svn: 243917