platform/upstream/llvm.git
9 years agounique_ptrify the value in DominatorTreeBase::DomTreeNodes
David Blaikie [Wed, 14 Jan 2015 19:55:27 +0000 (19:55 +0000)]
unique_ptrify the value in DominatorTreeBase::DomTreeNodes

(noticed the need for an explicit dtor in a recent commit & figured I'd
tidy that up)

llvm-svn: 226028

9 years agoTyping "gui" will crash programs that don't give LLDB a real terminal.
Greg Clayton [Wed, 14 Jan 2015 19:45:21 +0000 (19:45 +0000)]
Typing "gui" will crash programs that don't give LLDB a real terminal.

We now verify that the debugger's input file is a valid terminal file descriptor before allowing the "gui" command to try to run.

Xcode would crash if you typed "gui" at the command line prior to this fix.

<rdar://problem/18775851>

llvm-svn: 226027

9 years agoFix handling of extern_weak. This was broken by r225983.
Rafael Espindola [Wed, 14 Jan 2015 19:43:32 +0000 (19:43 +0000)]
Fix handling of extern_weak. This was broken by r225983.

llvm-svn: 226026

9 years agoclang-tidy: Add initial check for "Don't use else after return".
Daniel Jasper [Wed, 14 Jan 2015 19:37:54 +0000 (19:37 +0000)]
clang-tidy: Add initial check for "Don't use else after return".

As per the LLVM coding standards:
http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return

Initial version, probably still quite a bit to do until this is really
useful.

Review: http://reviews.llvm.org/D6927
llvm-svn: 226025

9 years agoSupport picking the unwinder used for testing on linux (just as libc++abi testing...
Jonathan Roelofs [Wed, 14 Jan 2015 19:29:04 +0000 (19:29 +0000)]
Support picking the unwinder used for testing on linux (just as libc++abi testing allows)

llvm-svn: 226024

9 years agoInstCombine: Don't take A-B<0 into A<B if A-B has other uses
David Majnemer [Wed, 14 Jan 2015 19:26:56 +0000 (19:26 +0000)]
InstCombine: Don't take A-B<0 into A<B if A-B has other uses

This fixes PR22226.

llvm-svn: 226023

9 years agoRevert "Add r224985 back with two fixes."
Rafael Espindola [Wed, 14 Jan 2015 19:07:23 +0000 (19:07 +0000)]
Revert "Add r224985 back with two fixes."

This reverts commit r225644 while I debug a regression.

llvm-svn: 226022

9 years agoEmit the Itanium LSDA for unknown EH personalities on Win64
Reid Kleckner [Wed, 14 Jan 2015 18:50:10 +0000 (18:50 +0000)]
Emit the Itanium LSDA for unknown EH personalities on Win64

This fixes lots of generic CodeGen tests that use __gcc_personality_v0.
This suggests that using ExceptionHandling::MSVC was a mistake, and we
should instead classify each function by personality function. This
would, for example, allow us to LTO a binary containing uses of SEH and
Itanium EH.

llvm-svn: 226019

9 years agoRemove dead code for llvm.eh.selector in the old EH model
Reid Kleckner [Wed, 14 Jan 2015 18:49:39 +0000 (18:49 +0000)]
Remove dead code for llvm.eh.selector in the old EH model

llvm-svn: 226018

9 years agoImplement demangling on Windows.
Zachary Turner [Wed, 14 Jan 2015 18:34:43 +0000 (18:34 +0000)]
Implement demangling on Windows.

llvm-svn: 226017

9 years agoAdd null pointer checks to some SBStream functions.
Zachary Turner [Wed, 14 Jan 2015 18:34:35 +0000 (18:34 +0000)]
Add null pointer checks to some SBStream functions.

llvm-svn: 226016

9 years agodocs/conf.py: bump version to 3.7
Hans Wennborg [Wed, 14 Jan 2015 18:32:20 +0000 (18:32 +0000)]
docs/conf.py: bump version to 3.7

llvm-svn: 226015

9 years agoUpdate PACKAGE_VERSION to 3.7.0svn
Hans Wennborg [Wed, 14 Jan 2015 18:30:55 +0000 (18:30 +0000)]
Update PACKAGE_VERSION to 3.7.0svn

llvm-svn: 226014

9 years ago[Hexagon] Removing old versions of cmph and updating references.
Colin LeMahieu [Wed, 14 Jan 2015 18:26:14 +0000 (18:26 +0000)]
[Hexagon] Removing old versions of cmph and updating references.

llvm-svn: 226013

9 years agoAdd support for comdats with names larger than 256 characters.
Rafael Espindola [Wed, 14 Jan 2015 18:25:45 +0000 (18:25 +0000)]
Add support for comdats with names larger than 256 characters.

llvm-svn: 226012

9 years agoRevert "More robust deployment target parsing on darwin"
Steven Wu [Wed, 14 Jan 2015 18:22:29 +0000 (18:22 +0000)]
Revert "More robust deployment target parsing on darwin"

This breaks green-dragon. Revert it and investigate.

llvm-svn: 226011

9 years agodocs/conf.py: update for 3.7
Hans Wennborg [Wed, 14 Jan 2015 18:14:05 +0000 (18:14 +0000)]
docs/conf.py: update for 3.7

llvm-svn: 226010

9 years agoReleaseNotes.rst: update to 3.7
Hans Wennborg [Wed, 14 Jan 2015 18:14:03 +0000 (18:14 +0000)]
ReleaseNotes.rst: update to 3.7

The 3.6 release notes are in the 3.6 branch.

llvm-svn: 226009

9 years agoUpdate cxx_dr_status.html after 3.6 branch
Hans Wennborg [Wed, 14 Jan 2015 18:14:00 +0000 (18:14 +0000)]
Update cxx_dr_status.html after 3.6 branch

llvm-svn: 226008

9 years agoReleaseNotes.rst: bump version to 3.7
Hans Wennborg [Wed, 14 Jan 2015 18:07:30 +0000 (18:07 +0000)]
ReleaseNotes.rst: bump version to 3.7

The 3.6 notes are now in the 3.6 branch.

llvm-svn: 226007

9 years ago[Hexagon] Removing old versions of cmpb and updating references.
Colin LeMahieu [Wed, 14 Jan 2015 18:05:44 +0000 (18:05 +0000)]
[Hexagon] Removing old versions of cmpb and updating references.

llvm-svn: 226006

9 years agoMore robust deployment target parsing on darwin
Steven Wu [Wed, 14 Jan 2015 18:01:27 +0000 (18:01 +0000)]
More robust deployment target parsing on darwin

Summary:
This is a more robust way of figuring out implicit deployment target
from isysroot. It also handles iphone simulator target.

Reviewers: bob.wilson, t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, cfe-commits

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

llvm-svn: 226005

9 years agoTrunk is now 3.7.0svn
Hans Wennborg [Wed, 14 Jan 2015 17:38:03 +0000 (17:38 +0000)]
Trunk is now 3.7.0svn

llvm-svn: 226004

9 years ago[Hexagon] Deleting versions of compare-not that don't have encoding information....
Colin LeMahieu [Wed, 14 Jan 2015 16:49:12 +0000 (16:49 +0000)]
[Hexagon] Deleting versions of compare-not that don't have encoding information.  Updating references.

llvm-svn: 226003

9 years agofix typos
Sanjay Patel [Wed, 14 Jan 2015 16:03:58 +0000 (16:03 +0000)]
fix typos

llvm-svn: 225991

9 years agobuiltins: avoid duplicating unwind declarations
Saleem Abdulrasool [Wed, 14 Jan 2015 15:55:17 +0000 (15:55 +0000)]
builtins: avoid duplicating unwind declarations

Use unwind.h to get the declarations for unwinding interfaces.  This header is
already provided by clang and gcc, so this adds no additional dependencies for
building the builtins library.  It avoids the duplication which may drift over
time though.

llvm-svn: 225990

9 years agoR600/SI: Use IMPLICIT_DEF and KILL when failing to spill VGPRs
Tom Stellard [Wed, 14 Jan 2015 15:42:34 +0000 (15:42 +0000)]
R600/SI: Use IMPLICIT_DEF and KILL when failing to spill VGPRs

This helps us avoid 'invalid register class for operand' verifier
errors.

llvm-svn: 225989

9 years agoR600/SI: Spill VGPRs to scratch space for compute shaders
Tom Stellard [Wed, 14 Jan 2015 15:42:31 +0000 (15:42 +0000)]
R600/SI: Spill VGPRs to scratch space for compute shaders

llvm-svn: 225988

9 years agoCheck that the TLI callback enableAggressiveFMAFusion has the desired effect on FMA...
Olivier Sallenave [Wed, 14 Jan 2015 15:36:28 +0000 (15:36 +0000)]
Check that the TLI callback enableAggressiveFMAFusion has the desired effect on FMA folding.

llvm-svn: 225987

9 years ago[Msan] Fix strlen() and strnlen() interceptors to work on FreeBSD
Viktor Kutuzov [Wed, 14 Jan 2015 14:59:46 +0000 (14:59 +0000)]
[Msan] Fix strlen() and strnlen() interceptors to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D6928

llvm-svn: 225986

9 years agoFix a lit configuration diagnostic. NFC
Jonathan Roelofs [Wed, 14 Jan 2015 14:48:27 +0000 (14:48 +0000)]
Fix a lit configuration diagnostic. NFC

llvm-svn: 225985

9 years agoOverride the TLI callback enableAggressiveFMAFusion and return true. Indeed, fmul...
Olivier Sallenave [Wed, 14 Jan 2015 14:47:24 +0000 (14:47 +0000)]
Override the TLI callback enableAggressiveFMAFusion and return true. Indeed, fmul, fmadd and fadd nodes cost the same number of cycles, so we can enable more combining heuristics to produce more fmadd nodes.

llvm-svn: 225984

9 years agoHandle a symbol being undefined.
Rafael Espindola [Wed, 14 Jan 2015 13:53:50 +0000 (13:53 +0000)]
Handle a symbol being undefined.

This can happen if:
* It is present in a comdat in one file.
* It is not present in the comdat of the file that is kept.
* Is is not used.

This should fix the LTO boostrap.

Thanks to Takumi NAKAMURA for setting up the bot!

llvm-svn: 225983

9 years agoclang-format: Disable flag for Google's Java and Javascript styles.
Daniel Jasper [Wed, 14 Jan 2015 12:24:59 +0000 (12:24 +0000)]
clang-format: Disable flag for Google's Java and Javascript styles.

Disable AlwaysBreakBeforeMultilineString, as the style guides don't
really say to do so.

llvm-svn: 225982

9 years ago[mips] Handle transparent unions correctly.
Daniel Sanders [Wed, 14 Jan 2015 12:00:12 +0000 (12:00 +0000)]
[mips] Handle transparent unions correctly.

Summary:
This fixes MultiSource/Applications/lemon on big-endian N32 by correcting the
handling of the argument to wait(). glibc defines it as a transparent union of
void* and int*. Such unions are passed according to the rules of the first
member so the argument must be passed as if it were a void* (sign extended from
i32 to i64) and not as a union (shifted to the upper bits of an i64).

wait() already behaves correctly on big-endian O32 and N64 since the union is
already the same size as an argument slot.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

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

llvm-svn: 225981

9 years agoAdd disassembler tests for mips32r2 platform. There are no functional changes.
Vladimir Medic [Wed, 14 Jan 2015 11:35:22 +0000 (11:35 +0000)]
Add disassembler tests for mips32r2 platform. There are no functional changes.

llvm-svn: 225980

9 years ago[cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py
Chandler Carruth [Wed, 14 Jan 2015 11:29:14 +0000 (11:29 +0000)]
[cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py

Sorry for the noise, I managed to miss a bunch of recent regressions of
include orderings here. This should actually sort all the includes for
Clang. Again, no functionality changed, this is just a mechanical
cleanup that I try to run periodically to keep the #include lines as
regular as possible across the project.

llvm-svn: 225979

9 years ago[cleanup] Re-sort #include lines using llvm/utils/sort_includes.py
Chandler Carruth [Wed, 14 Jan 2015 11:26:52 +0000 (11:26 +0000)]
[cleanup] Re-sort #include lines using llvm/utils/sort_includes.py

This is just a mechanical cleanup, no functionality changed. This just
fixes very minor inconsistencies with how #include lines were spaced and
sorted in LLD.

llvm-svn: 225978

9 years agoreapply: SLPVectorizer: Cache results from memory alias checking.
Erik Eckstein [Wed, 14 Jan 2015 11:24:47 +0000 (11:24 +0000)]
reapply: SLPVectorizer: Cache results from memory alias checking.

This speeds up the dependency calculations for blocks with many load/store/call instructions.
Beside the improved runtime, there is no functional change.

Compared to the original commit, this re-applied commit contains a bug fix which ensures that there are
no incorrect collisions in the alias cache.

llvm-svn: 225977

9 years ago[cleanup] Re-sort the #include lines with llvm/utils/sort_includes.py
Chandler Carruth [Wed, 14 Jan 2015 11:24:38 +0000 (11:24 +0000)]
[cleanup] Re-sort the #include lines with llvm/utils/sort_includes.py

No functionality changed, this is just a mechanical cleanup to keep the
order of #include lines consistent across the project.

llvm-svn: 225976

9 years ago[cleanup] Re-sort the #include lines using llvm/utils/sort_includes.py
Chandler Carruth [Wed, 14 Jan 2015 11:23:58 +0000 (11:23 +0000)]
[cleanup] Re-sort the #include lines using llvm/utils/sort_includes.py

No functionality changed, this is a purely mechanical cleanup to ensure
the #include order remains consistent across the project.

llvm-svn: 225975

9 years ago[cleanup] Re-sort all the #include lines in LLVM using
Chandler Carruth [Wed, 14 Jan 2015 11:23:27 +0000 (11:23 +0000)]
[cleanup] Re-sort all the #include lines in LLVM using
utils/sort_includes.py.

I clearly haven't done this in a while, so more changed than usual. This
even uncovered a missing include from the InstrProf library that I've
added. No functionality changed here, just mechanical cleanup of the
include order.

llvm-svn: 225974

9 years agoclang-format: [Java] Support try blocks with resources.
Daniel Jasper [Wed, 14 Jan 2015 10:48:41 +0000 (10:48 +0000)]
clang-format: [Java] Support try blocks with resources.

Before:
  try
    (SomeResource rs = someFunction()) {
      Something();
    }

After:
  try (SomeResource rs = someFunction()) {
    Something();
  }

llvm-svn: 225973

9 years agoCorrect POP handling for v7m
Jyoti Allur [Wed, 14 Jan 2015 10:48:16 +0000 (10:48 +0000)]
Correct POP handling for v7m

llvm-svn: 225972

9 years agoclang-format: [Java] Prefer not to break in parameter annotations.
Daniel Jasper [Wed, 14 Jan 2015 10:36:31 +0000 (10:36 +0000)]
clang-format: [Java] Prefer not to break in parameter annotations.

Before:
  boolean someFunction(@Param(aaaaaaaaaaaaaaaa)
                       String aaaaa,
      String bbbbbbbbbbbbbbb) {}

After:
  boolean someFunction(
      @Param(aaaaaaaaaaaaaaaa) String aaaaa,
      String bbbbbbbbbbbbbbb) {}

llvm-svn: 225971

9 years ago[dom] Make the DominatorTreeBase not a dynamic class!
Chandler Carruth [Wed, 14 Jan 2015 10:33:21 +0000 (10:33 +0000)]
[dom] Make the DominatorTreeBase not a dynamic class!

Now that the passes are wrappers around this, we no longer need
a vtable, virtual destructor, and other associated mess. This is
particularly nice to me as this is a class template. =]

llvm-svn: 225970

9 years ago[PM] Port domtree to the new pass manager (at last).
Chandler Carruth [Wed, 14 Jan 2015 10:19:28 +0000 (10:19 +0000)]
[PM] Port domtree to the new pass manager (at last).

This adds the domtree analysis to the new pass manager. The analysis
returns the same DominatorTree result entity used by the old pass
manager and essentially all of the code is shared. We just have
different boilerplate for running and printing the analysis.

I've converted one test to run in both modes just to make sure this is
exercised while both are live in the tree.

llvm-svn: 225969

9 years ago[mips] Refine octeon instructions seq/seqi/sne/snei
Kai Nacke [Wed, 14 Jan 2015 10:19:09 +0000 (10:19 +0000)]
[mips] Refine octeon instructions seq/seqi/sne/snei

This commit refines the pattern for the octeon seq/seqi/sne/snei instructions.
The target register is set to 0 or 1 according to the result of the comparison.
In C, this is something like

rd = (unsigned long)(rs == rt)

This commit adds a zext to bring the result to i64. With this change the
instruction is selected for this type of code. (gcc produces the same code for
the above C code.)

llvm-svn: 225968

9 years agoAdd disassembler tests for mips32r2 platform. There are no functional changes.
Vladimir Medic [Wed, 14 Jan 2015 10:18:56 +0000 (10:18 +0000)]
Add disassembler tests for mips32r2 platform. There are no functional changes.

llvm-svn: 225967

9 years ago[PM] Make DominatorTrees (corectly) movable so that we can move them
Chandler Carruth [Wed, 14 Jan 2015 10:07:19 +0000 (10:07 +0000)]
[PM] Make DominatorTrees (corectly) movable so that we can move them
into the new pass manager's analysis cache which stores results
by-value.

Technically speaking, the dom trees were originally not movable but
copyable! This, unsurprisingly, didn't work at all -- the copy was
shallow and just resulted in rampant memory corruption. This change
explicitly forbids copying (as it would need to be a deep copy) and
makes them explicitly movable with the unsurprising boiler plate to
member-wise move them because we can't rely on MSVC to generate this
code for us. =/

llvm-svn: 225966

9 years agoclang-format: [Java] Understand "import static".
Daniel Jasper [Wed, 14 Jan 2015 10:02:49 +0000 (10:02 +0000)]
clang-format: [Java] Understand "import static".

llvm-svn: 225965

9 years agoclang-format: [Java] Don't let annotations confuse return type analysis.
Daniel Jasper [Wed, 14 Jan 2015 10:00:20 +0000 (10:00 +0000)]
clang-format: [Java] Don't let annotations confuse return type analysis.

Before:
  @Test
  ReturnType
  doSomething(String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}

After:
  @Test
  ReturnType doSomething(
      String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}

llvm-svn: 225964

9 years agoclang-format: [Java] Don't line-wrap before annotations' l_parens.
Daniel Jasper [Wed, 14 Jan 2015 09:51:32 +0000 (09:51 +0000)]
clang-format: [Java] Don't line-wrap before annotations' l_parens.

Before:
  @SomeAnnotation
  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
  int i;

After:
  @SomeAnnotation(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
  int i;

llvm-svn: 225963

9 years agoclang-format: [Java] Don't get confused by leading annotations.
Daniel Jasper [Wed, 14 Jan 2015 09:47:57 +0000 (09:47 +0000)]
clang-format: [Java] Don't get confused by leading annotations.

Before:
  @Test(a)
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa);

After:
  @Test(a)
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 225962

9 years agoThe assembler is now enabled by default.
Brad Smith [Wed, 14 Jan 2015 08:23:49 +0000 (08:23 +0000)]
The assembler is now enabled by default.

llvm-svn: 225961

9 years agoSema: It's cheaper to ask LookupResult::empty than to calculate linkage
David Majnemer [Wed, 14 Jan 2015 08:08:52 +0000 (08:08 +0000)]
Sema: It's cheaper to ask LookupResult::empty than to calculate linkage

llvm-svn: 225960

9 years agoReapply debug info changes now that more precise column information is available.
David Blaikie [Wed, 14 Jan 2015 07:59:48 +0000 (07:59 +0000)]
Reapply debug info changes now that more precise column information is available.

llvm-svn: 225959

9 years agoUse the integrated assembler by default on 32-bit PowerPC and SPARC.
Brad Smith [Wed, 14 Jan 2015 07:55:36 +0000 (07:55 +0000)]
Use the integrated assembler by default on 32-bit PowerPC and SPARC.

llvm-svn: 225958

9 years agoUse the integrated assembler by default on SPARC.
Brad Smith [Wed, 14 Jan 2015 07:53:39 +0000 (07:53 +0000)]
Use the integrated assembler by default on SPARC.

llvm-svn: 225957

9 years agoReapply r225000 (reverted in r225555): DebugInfo: Generalize debug info location...
David Blaikie [Wed, 14 Jan 2015 07:38:27 +0000 (07:38 +0000)]
Reapply r225000 (reverted in r225555): DebugInfo: Generalize debug info location handling (and follow-up commits).

Several pieces of code were relying on implicit debug location setting
which usually lead to incorrect line information anyway. So I've fixed
those (in r225955 and r225845) separately which should pave the way for
this commit to be cleanly reapplied.

The reason these implicit dependencies resulted in crashes with this
patch is that the debug location would no longer implicitly leak from
one place to another, but be set back to invalid. Once a call with
no/invalid location was emitted, if that call was ever inlined it could
produce invalid debugloc chains and assert during LLVM's codegen.

There may be further cases of such bugs in this patch - they're hard to
flush out with regression testing, so I'll keep an eye out for reports
and investigate/fix them ASAP if they come up.

Original commit message:

Reapply "DebugInfo: Generalize debug info location handling"

Originally committed in r224385 and reverted in r224441 due to concerns
this change might've introduced a crash. Turns out this change fixes the
crash introduced by one of my earlier more specific location handling
changes (those specific fixes are reverted by this patch, in favor of
the more general solution).

Recommitted in r224941 and reverted in r224970 after it caused a crash
when building compiler-rt. Looks to be due to this change zeroing out
the debug location when emitting default arguments (which were meant to
inherit their outer expression's location) thus creating call
instructions without locations - these create problems for inlining and
must not be created. That is fixed and tested in this version of the
change.

Original commit message:

This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.

This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.

I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.

Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.

I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.

llvm-svn: 225956

9 years agoDebugInof: Correct the location of exception cleanups in global ctors/dtors and ObjC...
David Blaikie [Wed, 14 Jan 2015 07:10:46 +0000 (07:10 +0000)]
DebugInof: Correct the location of exception cleanups in global ctors/dtors and ObjC methods

Without setting the CurEHLocation these cleanups would be attributed to
whatever the last active debug line location was (the 'fn' call in the
included test cases). By setting CurEHLocation correctly the line
information is improved/corrected.

This quality bug turned into a crasher with r225000 when, instead of
allowing the last location to persist, it would be zero'd out. This
could lead to a function call (such as the dtor) being made without a
debug location - if that call was subsequently inlined (and the caller
and callee had debug info, just not the call instruction) the inliner
would violate important constraints about the debug location chains by
not updating the inlined instructions to chain up to the callee
locations.

So, by fixing this bug, I am addressing the assertion failures
introduced by r225000 and should be able to recommit that patch with
impunity...

llvm-svn: 225955

9 years agoUse the operand vector instead so inline assembly can be validated too
David Majnemer [Wed, 14 Jan 2015 06:14:36 +0000 (06:14 +0000)]
Use the operand vector instead so inline assembly can be validated too

The buildbots got upset after r225941, this should hopefully fix things.

llvm-svn: 225954

9 years agoSelectionDAG: add a -filter-view-dags option to llc
Mehdi Amini [Wed, 14 Jan 2015 06:03:18 +0000 (06:03 +0000)]
SelectionDAG: add a -filter-view-dags option to llc

This option takes the name of the basic block you want to visualize
with -view-*-dags

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

llvm-svn: 225953

9 years agoDAG Combiner: Fold SelectCC When Cond is UNDEF
Mehdi Amini [Wed, 14 Jan 2015 05:45:24 +0000 (05:45 +0000)]
DAG Combiner: Fold SelectCC When Cond is UNDEF

In case folding a node end up with a NaN as operand for the select,
the folding of the condition of the selectcc node returns "UNDEF".

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

llvm-svn: 225952

9 years agoAdd assertions for out of bound index in ComputeLinearIndex
Mehdi Amini [Wed, 14 Jan 2015 05:38:48 +0000 (05:38 +0000)]
Add assertions for out of bound index in ComputeLinearIndex

llvm-svn: 225951

9 years agoX86: only access operands if they are present
Saleem Abdulrasool [Wed, 14 Jan 2015 05:37:10 +0000 (05:37 +0000)]
X86: only access operands if they are present

If there is no associated immediate (MS style inline asm), do not try to access
the operand, assume that it is valid.  This should fix the buildbots after SVN
r225941.

llvm-svn: 225950

9 years agoFold a loop for array processing in ComputeLinearIndex
Mehdi Amini [Wed, 14 Jan 2015 05:33:01 +0000 (05:33 +0000)]
Fold a loop for array processing in ComputeLinearIndex

When processing an array, every Elt has the same layout, it is
useless to recursively call each ComputeLinearIndex on each element.
Just do it once and multiply by the number of elements.

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

llvm-svn: 225949

9 years agoRevert "Insert random noops to increase security against ROP attacks (llvm)"
JF Bastien [Wed, 14 Jan 2015 05:24:33 +0000 (05:24 +0000)]
Revert "Insert random noops to increase security against ROP attacks (llvm)"

This reverts commit:
http://reviews.llvm.org/D3392

llvm-svn: 225948

9 years agoRevert "Insert random noops to increase security against ROP attacks (clang)"
JF Bastien [Wed, 14 Jan 2015 05:24:11 +0000 (05:24 +0000)]
Revert "Insert random noops to increase security against ROP attacks (clang)"

This reverts commit:
http://reviews.llvm.org/D3393

llvm-svn: 225947

9 years agoirgen: expose DisableUnusedImportCheck flag
Peter Collingbourne [Wed, 14 Jan 2015 05:18:16 +0000 (05:18 +0000)]
irgen: expose DisableUnusedImportCheck flag

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

llvm-svn: 225946

9 years agoirgen: expose PackageCreated hook
Peter Collingbourne [Wed, 14 Jan 2015 05:17:41 +0000 (05:17 +0000)]
irgen: expose PackageCreated hook

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

llvm-svn: 225945

9 years agoNVPTX: Use MapMetadata() instead of custom/stale/untested logic
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 05:14:30 +0000 (05:14 +0000)]
NVPTX: Use MapMetadata() instead of custom/stale/untested logic

Copy the `GVMap` over to a standard `ValueToValueMapTy` so that we can
reuse the `MapMetadata()` logic.  Unfortunately the `GVMap` can't just
be replaced, since `MapMetadata()` likes to modify the map, but at least
this will prevent NVPTX from bitrotting.

llvm-svn: 225944

9 years agoNVPTX: Remove bogus remap logic for global variable address spaces
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 05:13:18 +0000 (05:13 +0000)]
NVPTX: Remove bogus remap logic for global variable address spaces

The comment is incorrect, and the code mangles debug info.  Remove the
bad logic, which wasn't tested anyway.

llvm-svn: 225943

9 years agoSema: Relax parsing of '#' in constraints
David Majnemer [Wed, 14 Jan 2015 05:11:09 +0000 (05:11 +0000)]
Sema: Relax parsing of '#' in constraints

llvm-svn: 225942

9 years agoX86: validate 'int' instruction
Saleem Abdulrasool [Wed, 14 Jan 2015 05:10:21 +0000 (05:10 +0000)]
X86: validate 'int' instruction

The int instruction takes as an operand an 8-bit immediate value.  Validate that
the input is valid rather than silently truncating the value.

llvm-svn: 225941

9 years agoDisable a couple of tests, CodeGen/X86/noop-insert.ll and CodeGen/X86/noop-insert...
NAKAMURA Takumi [Wed, 14 Jan 2015 04:21:33 +0000 (04:21 +0000)]
Disable a couple of tests, CodeGen/X86/noop-insert.ll and CodeGen/X86/noop-insert-percentage.ll, in r225908, to unbreak tests.

llvm-svn: 225940

9 years ago[dom] Remove extraneous inline keywords. Template functions and inline
Chandler Carruth [Wed, 14 Jan 2015 03:58:50 +0000 (03:58 +0000)]
[dom] Remove extraneous inline keywords. Template functions and inline
class members are implicitly "inline", no key word needed.

Naturally, this could change how LLVM inlines these functions because
<GRR>, but that's not an excuse to use the keyword. ;]

llvm-svn: 225939

9 years ago[dom] The formatting of the generic domtree has bitrotted over the years
Chandler Carruth [Wed, 14 Jan 2015 03:56:00 +0000 (03:56 +0000)]
[dom] The formatting of the generic domtree has bitrotted over the years
significantly. Clean it up with the help of clang-format.

I've touched this up by hand in a couple of places that weren't quite
right (IMO). I think most of these actually have bugs open about
already.

llvm-svn: 225938

9 years ago[dom] Clean up some comments in this header that were confusingly
Chandler Carruth [Wed, 14 Jan 2015 03:55:58 +0000 (03:55 +0000)]
[dom] Clean up some comments in this header that were confusingly
formatted or placed incorrectly.

llvm-svn: 225937

9 years ago[dom] Add a basic dominator tree test.
Chandler Carruth [Wed, 14 Jan 2015 03:34:55 +0000 (03:34 +0000)]
[dom] Add a basic dominator tree test.

Correct, we have *zero* basic testing of the dominator tree in the
regression test suite. There is a single test that even prints it out,
and that test only checks a single line of the output. There are
a handful of tests that check post dominators, but all of those are
looking for bugs rather than just exercising the basic machinery.

This test is super boring and unexciting. But hey, it's something.
I needed there to be something so I could switch the basic test to run
with both the old and new pass manager.

llvm-svn: 225936

9 years agoFix a wrong comment in LoopVectorize.
Hao Liu [Wed, 14 Jan 2015 03:02:16 +0000 (03:02 +0000)]
Fix a wrong comment in LoopVectorize.
  I.E. more than two -> exactly two
Fix a typo function name in LoopVectorize.
  I.E. collectStrideAcccess() -> collectStrideAccess()

llvm-svn: 225935

9 years agoSema: Check type compatibility with the most recent decl when merging
David Majnemer [Wed, 14 Jan 2015 02:27:38 +0000 (02:27 +0000)]
Sema: Check type compatibility with the most recent decl when merging

We would check the type information from the declaration found by lookup
but we would neglect checking compatibility with the most recent
declaration.  This would make it possible for us to not correctly
diagnose inconsistencies with declarations which were made in a
different scope.

llvm-svn: 225934

9 years agoTargetInstrInfo.h: Fix \param in r225772. [-Wdocumentation]
NAKAMURA Takumi [Wed, 14 Jan 2015 02:24:10 +0000 (02:24 +0000)]
TargetInstrInfo.h: Fix \param in r225772. [-Wdocumentation]

llvm-svn: 225933

9 years agoAnother try at handling LD_LIBRARY_PATH not being defined.
Rafael Espindola [Wed, 14 Jan 2015 02:23:27 +0000 (02:23 +0000)]
Another try at handling LD_LIBRARY_PATH not being defined.

llvm-svn: 225932

9 years agoDisable -Wunknown-pragmas in a test so that Clang without -Wself-move will not
Richard Trieu [Wed, 14 Jan 2015 01:50:12 +0000 (01:50 +0000)]
Disable -Wunknown-pragmas in a test so that Clang without -Wself-move will not
complain that the flag doesn't exist.

llvm-svn: 225931

9 years agoARM: add test for crc32 instructions in CodeGen.
Tim Northover [Wed, 14 Jan 2015 01:43:33 +0000 (01:43 +0000)]
ARM: add test for crc32 instructions in CodeGen.

Somehow we seem to have ended up without any actual tests of the
CodeGen side. Easy enough to fix.

llvm-svn: 225930

9 years agoRemove trailing slash from r225924
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:42:43 +0000 (01:42 +0000)]
Remove trailing slash from r225924

llvm-svn: 225929

9 years ago[PowerPC] Fix the noop-insert test
Hal Finkel [Wed, 14 Jan 2015 01:37:21 +0000 (01:37 +0000)]
[PowerPC] Fix the noop-insert test

The form of nops used is CPU-specific (some CPUs, such as the POWER7, have
special group-terminating nops). We probably want a different callback for this
kind of nop insertion (something more like MCAsmBackend::writeNopData), or for
PPC to use a different mechanism for scheduling nops, but this will stop the
test from failing for now.

llvm-svn: 225928

9 years agoR600/SI: Remove some redudant load testcases.
Matt Arsenault [Wed, 14 Jan 2015 01:35:26 +0000 (01:35 +0000)]
R600/SI: Remove some redudant load testcases.

This reduces coverage for Evergreen, since the more
complete tests have those run lines disabled.

llvm-svn: 225927

9 years agoR600/SI: Fix bad code with unaligned byte vector loads
Matt Arsenault [Wed, 14 Jan 2015 01:35:22 +0000 (01:35 +0000)]
R600/SI: Fix bad code with unaligned byte vector loads

Don't do the v4i8 -> v4f32 combine if the load will need to
be expanded due to alignment. This stops adding instructions
to repack into a single register that the v_cvt_ubyteN_f32
instructions read.

llvm-svn: 225926

9 years agoImplement new way of expanding extloads.
Matt Arsenault [Wed, 14 Jan 2015 01:35:17 +0000 (01:35 +0000)]
Implement new way of expanding extloads.

Now that the source and destination types can be specified,
allow doing an expansion that doesn't use an EXTLOAD of the
result type. Try to do a legal extload to an intermediate type
and extend that if possible.

This generalizes the special case custom lowering of extloads
R600 has been using to work around this problem.

This also happens to fix a bug that would incorrectly use more
aligned loads than should be used.

llvm-svn: 225925

9 years agoUtils: Remove unreachable break, NFC
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:31:34 +0000 (01:31 +0000)]
Utils: Remove unreachable break, NFC

llvm-svn: 225924

9 years agoExtend PipePosix with support for named pipes/timeout-based IO and integrate it with...
Oleksiy Vyalov [Wed, 14 Jan 2015 01:31:27 +0000 (01:31 +0000)]
Extend PipePosix with support for named pipes/timeout-based IO and integrate it with GDBRemoteCommunication / lldb-gdbserver - include reviews fixes.

http://reviews.llvm.org/D6954

llvm-svn: 225923

9 years ago[AVX512] Add FP unpack intrinsics
Adam Nemet [Wed, 14 Jan 2015 01:31:17 +0000 (01:31 +0000)]
[AVX512] Add FP unpack intrinsics

These are implemented with __builtin_shufflevector just like AVX.

We have some tests on the LLVM side to assert that these shufflevectors do
indeed generate the corresponding unpck instruction.

Part of <rdar://problem/17688758>

llvm-svn: 225922

9 years agoUtils: Handle remapping distinct MDLocations
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:29:32 +0000 (01:29 +0000)]
Utils: Handle remapping distinct MDLocations

Part of PR21433.

llvm-svn: 225921

9 years agoRefactor the lit config's linker flag discovery code. NFC
Jonathan Roelofs [Wed, 14 Jan 2015 01:29:04 +0000 (01:29 +0000)]
Refactor the lit config's linker flag discovery code. NFC

llvm-svn: 225920

9 years agoHandle LD_LIBRARY_PATH not being defined.
Rafael Espindola [Wed, 14 Jan 2015 01:28:08 +0000 (01:28 +0000)]
Handle LD_LIBRARY_PATH not being defined.

Should fix the bots after r225890.

llvm-svn: 225919

9 years agoUtils: Thread distinct-ness through the cloneMD*() functions, NFC
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:24:38 +0000 (01:24 +0000)]
Utils: Thread distinct-ness through the cloneMD*() functions, NFC

The new logic isn't actually reachable yet, so no functionality change.

llvm-svn: 225918

9 years agoUtils: Extract cloneMDNode(), NFC
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:22:47 +0000 (01:22 +0000)]
Utils: Extract cloneMDNode(), NFC

llvm-svn: 225917

9 years agoUtils: Move cloneMD*() up, NFC
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:21:24 +0000 (01:21 +0000)]
Utils: Move cloneMD*() up, NFC

llvm-svn: 225915