platform/upstream/llvm.git
9 years agoRevert "Masked Vector Load and Store Intrinsics."
Duncan P. N. Exon Smith [Fri, 28 Nov 2014 21:29:14 +0000 (21:29 +0000)]
Revert "Masked Vector Load and Store Intrinsics."

This reverts commit r222632 (and follow-up r222636), which caused a host
of LNT failures on an internal bot.  I'll respond to the commit on the
list with a reproduction of one of the failures.

Conflicts:
lib/Target/X86/X86TargetTransformInfo.cpp

llvm-svn: 222936

9 years agoSimplify some more ownership using forward_list<T> rather than vector<unique_ptr<T>>
David Blaikie [Fri, 28 Nov 2014 21:20:24 +0000 (21:20 +0000)]
Simplify some more ownership using forward_list<T> rather than vector<unique_ptr<T>>

llvm-svn: 222935

9 years agoForgotten formatting from previous commit
David Blaikie [Fri, 28 Nov 2014 21:20:22 +0000 (21:20 +0000)]
Forgotten formatting from previous commit

llvm-svn: 222934

9 years agoAdd additional arguments for -mfpu options
Richard Barton [Fri, 28 Nov 2014 20:39:59 +0000 (20:39 +0000)]
Add additional arguments for -mfpu options

Add neon-vfpv3 to allow specifying both at the same time. This is not an
option that GCC supports, but follows the same track and should be
non-controversial.

Change-Id: Id9ec157c835937d7d11ad0f49dbe5171fac17658
llvm-svn: 222933

9 years agoAdd -mfpu=neon-vfpv4
Richard Barton [Fri, 28 Nov 2014 20:39:54 +0000 (20:39 +0000)]
Add -mfpu=neon-vfpv4

This enables user to architecturally specify ARMv7A + VFPv4 + NEON.

Change-Id: I779b01fef5c47e5e4ac702ae24ed2f76a0e4c63f
llvm-svn: 222932

9 years agoSimplify ownership by using forward_list<T> rather than vector<unique_ptr<T>>
David Blaikie [Fri, 28 Nov 2014 20:35:57 +0000 (20:35 +0000)]
Simplify ownership by using forward_list<T> rather than vector<unique_ptr<T>>

Since the elements were not polymorphic, the unique_ptr was only used to
avoid pointer invalidation on container resizes - might as well skip the
indirection and use a container with suitable invalidation semantics.

llvm-svn: 222931

9 years agoFix a few memory leaks in CodeGenRegBank.
Craig Topper [Fri, 28 Nov 2014 20:30:39 +0000 (20:30 +0000)]
Fix a few memory leaks in CodeGenRegBank.

llvm-svn: 222930

9 years agoUse unique_ptr to simplify deletion.
Craig Topper [Fri, 28 Nov 2014 20:30:37 +0000 (20:30 +0000)]
Use unique_ptr to simplify deletion.

llvm-svn: 222929

9 years agoInstCombine: FoldOrOfICmps harder
David Majnemer [Fri, 28 Nov 2014 19:58:29 +0000 (19:58 +0000)]
InstCombine: FoldOrOfICmps harder

We may be in a situation where the icmps might not be near each other in
a tree of or instructions.  Try to dig out related compare instructions
and see if they combine.

N.B.  This won't fire on deep trees of compares because rewritting the
tree might end up creating a net increase of IR.  We may have to resort
to something more sophisticated if this is a real problem.

llvm-svn: 222928

9 years ago[LICM] Store sink and indirectbr instructions
Bruno Cardoso Lopes [Fri, 28 Nov 2014 19:47:46 +0000 (19:47 +0000)]
[LICM] Store sink and indirectbr instructions

Loop simplify skips exit-block insertion when exits contain indirectbr
instructions. This leads to an assertion in LICM when trying to sink
stores out of non-dedicated loop exits containing indirectbr
instructions. This patch fix this issue by re-checking for dedicated
exits in LICM prior to store sink attempts.

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

rdar://problem/18943047

llvm-svn: 222927

9 years ago[SwitchLowering] Handle multiple destinations on condensed case stmts
Bruno Cardoso Lopes [Fri, 28 Nov 2014 19:47:33 +0000 (19:47 +0000)]
[SwitchLowering] Handle multiple destinations on condensed case stmts

Switch cases statements with sequential values that branch to the same
destination BB may often be handled together in a single new source BB.
In this scenario we need to remove remaining incoming values from PHI
instructions in the destination BB, as to match the number of source
branches.

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

rdar://problem/19040894

llvm-svn: 222926

9 years agoEnable FeatureFastUAMem for btver2
Sanjay Patel [Fri, 28 Nov 2014 18:40:18 +0000 (18:40 +0000)]
Enable FeatureFastUAMem for btver2

Allow unaligned 16-byte memop codegen for btver2. No functional changes for any other subtargets.

Replace the existing supposed small memcpy test with an actual test of a small memcpy.
The previous test wasn't using FileCheck either.

This patch should allow us to close PR21541 ( http://llvm.org/bugs/show_bug.cgi?id=21541 ).

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

llvm-svn: 222925

9 years ago[clang-tidy] More tests for the google-explicit-constructor check
Alexander Kornienko [Fri, 28 Nov 2014 17:31:51 +0000 (17:31 +0000)]
[clang-tidy] More tests for the google-explicit-constructor check

llvm-svn: 222924

9 years agoAdd back r222727 with a fix.
Rafael Espindola [Fri, 28 Nov 2014 16:41:24 +0000 (16:41 +0000)]
Add back r222727 with a fix.

The original patch would fail when:

* A dst opaque type (%A) is matched with a src type (%A).
* A src opaque (%E) type is then speculatively matched with %A and the
  speculation fails afterward.
* When rolling back the speculation we would cancel the source %A to dest
  %A mapping.

The fix is to keep an explicit list of which resolutions are speculative.

Original message:

Fix overly aggressive type merging.

If we find out that two types are *not* isomorphic, we learn nothing about
opaque sub types in both the source and destination.

llvm-svn: 222923

9 years agoAdd an assert and use a range loop. NFC.
Rafael Espindola [Fri, 28 Nov 2014 16:26:14 +0000 (16:26 +0000)]
Add an assert and use a range loop. NFC.

llvm-svn: 222922

9 years agoAdd a testcase reduced from clang lto bootstrap on OS X.
Rafael Espindola [Fri, 28 Nov 2014 15:45:31 +0000 (15:45 +0000)]
Add a testcase reduced from clang lto bootstrap on OS X.

llvm-svn: 222921

9 years agoFix wrong encoding of MRSBanked.
Charlie Turner [Fri, 28 Nov 2014 15:01:06 +0000 (15:01 +0000)]
Fix wrong encoding of MRSBanked.

Patch by Matthew Wahab.

Change-Id: Ia2a001ca2760028ea360fe77b56f203a219eefbc
llvm-svn: 222920

9 years ago[Msan] Generalize mapping facilities to add FreeBSD support
Viktor Kutuzov [Fri, 28 Nov 2014 11:42:55 +0000 (11:42 +0000)]
[Msan] Generalize mapping facilities to add FreeBSD support
Differential Revision: http://reviews.llvm.org/D6387

llvm-svn: 222919

9 years ago[msan] Fix origin propagation for select of floats.
Evgeniy Stepanov [Fri, 28 Nov 2014 11:17:58 +0000 (11:17 +0000)]
[msan] Fix origin propagation for select of floats.

MSan does not assign origin for instrumentation temps (i.e. the ones that do
not come from the application code), but "select" instrumentation erroneously
tried to use one of those.

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

llvm-svn: 222918

9 years agoTest all <build attribute, value> pairs.
Charlie Turner [Fri, 28 Nov 2014 11:14:47 +0000 (11:14 +0000)]
Test all <build attribute, value> pairs.

Add more tests to make sure the encoding/decoding of build attributes works
correctly for all permissible values of build attributes. For cases where there
are an infinite number of such values, a representative subset has been settled
for.

Change-Id: I2643c9624c211b2d56405306e16eec2d487bc5d6
llvm-svn: 222917

9 years agoRemoved extra line from a comment to test first commit. NFC.
Ankur Garg [Fri, 28 Nov 2014 10:38:18 +0000 (10:38 +0000)]
Removed extra line from a comment to test first commit. NFC.

llvm-svn: 222916

9 years ago[asan] Remove the local copy of Android ucontext.h.
Evgeniy Stepanov [Fri, 28 Nov 2014 10:37:44 +0000 (10:37 +0000)]
[asan] Remove the local copy of Android ucontext.h.

This header is present in the r10c release of the NDK.

llvm-svn: 222915

9 years ago[OPENMP] Additional processing of 'omp atomic write' directive.
Alexey Bataev [Fri, 28 Nov 2014 07:21:40 +0000 (07:21 +0000)]
[OPENMP] Additional processing of 'omp atomic write' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic write' is allowed to be used only for expression statements of form 'x = expr;', where x is a lvalue expression and expr is an expression with scalar type. Patch adds checks for it.

llvm-svn: 222913

9 years agoFix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.
Craig Topper [Fri, 28 Nov 2014 05:01:21 +0000 (05:01 +0000)]
Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.

llvm-svn: 222912

9 years agoAdd missing 'override' keyword.
Craig Topper [Fri, 28 Nov 2014 03:58:26 +0000 (03:58 +0000)]
Add missing 'override' keyword.

llvm-svn: 222911

9 years agoAdd support for UNWIND_X86_64_MODE_STACK_IND entries.
Jason Molenda [Fri, 28 Nov 2014 03:54:13 +0000 (03:54 +0000)]
Add support for UNWIND_X86_64_MODE_STACK_IND entries.
Correct the function offset computations in UNWIND_SECOND_LEVEL_REGULAR
tables.  A few other small fixes.

llvm-svn: 222910

9 years agoUse unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.
Craig Topper [Fri, 28 Nov 2014 03:53:02 +0000 (03:53 +0000)]
Use unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.

llvm-svn: 222909

9 years agoUse range-based for loops and const-correct a few things.
Craig Topper [Fri, 28 Nov 2014 03:53:00 +0000 (03:53 +0000)]
Use range-based for loops and const-correct a few things.

llvm-svn: 222908

9 years agoDo not incorrectly set the inverted flag.
Hongbin Zheng [Fri, 28 Nov 2014 03:26:06 +0000 (03:26 +0000)]
Do not incorrectly set the inverted flag.

In TempScopInfo::buildCondition we extract the conditions to guard the
BB *in addition of* loop bounds. This means we should only consider the
conditions in the paths (in CFG) that do not contain cycles (loops).

At the same time, we set the invert flag if the FalseBB of the current
branch dominates our target BB to indicate that we reach the target BB
with an inverted condition from the current branch.

In this case, the path from the FalseBB contains a cycle if the FalseBB
is the target of a backedge. The conditions implied by such a path should
not be consider. We can identify such a case by checking if the TrueBB
also dominates our target BB, which means we can also reach our target
BB from the TrueBB, without going through the backedge.

llvm-svn: 222907

9 years agoCreate a new 'flag_enum' attribute.
Alexis Hunt [Fri, 28 Nov 2014 00:53:20 +0000 (00:53 +0000)]
Create a new 'flag_enum' attribute.

This attribute serves as a hint to improve warnings about the ranges of
enumerators used as flag types. It currently has no working C++ implementation
due to different semantics for enums in C++. For more explanation, see the docs
and testcases.

Reviewed by Aaron Ballman.

llvm-svn: 222906

9 years agoStop using ArrayRef of a const type.
Tim Northover [Thu, 27 Nov 2014 21:29:20 +0000 (21:29 +0000)]
Stop using ArrayRef of a const type.

I *think* this is what the GCC bots are complaining about.

llvm-svn: 222905

9 years agoAArch64: simplify PCS mapping.
Tim Northover [Thu, 27 Nov 2014 21:02:49 +0000 (21:02 +0000)]
AArch64: simplify PCS mapping.

Now that LLVM can count the registers needed to implement AAPCS rules, we don't
need to duplicate that logic here. This means we can drop the explicit padding
and also use more natural types in many cases (e.g. "struct { float arr[3]; }"
used to end up as "[2 x double]" to avoid holes on the stack.

The one wrinkle is that AAPCS va_arg was also using the register counting
machinery. But the local replacement isn't too bad.

llvm-svn: 222904

9 years agoAArch64: treat [N x Ty] as a block during procedure calls.
Tim Northover [Thu, 27 Nov 2014 21:02:42 +0000 (21:02 +0000)]
AArch64: treat [N x Ty] as a block during procedure calls.

The AAPCS treats small structs and homogeneous floating (or vector) aggregates
specially, and guarantees they either get passed as a contiguous block of
registers, or prevent any future use of those registers and get passed on the
stack.

This concept can fit quite neatly into LLVM's own type system, mapping an HFA
to [N x float] and so on, and small structs to [N x i64]. Doing so allows
front-ends to emit AAPCS compliant code without having to duplicate the
register counting logic.

llvm-svn: 222903

9 years agoMake LLGS to open a named pipe and write a listening port to it only when a proper...
Oleksiy Vyalov [Thu, 27 Nov 2014 20:51:24 +0000 (20:51 +0000)]
Make LLGS to open a named pipe and write a listening port to it only when a proper port value is received.

llvm-svn: 222902

9 years ago[mips][microMIPS] Implement SWM16 and LWM16 instructions
Zoran Jovanovic [Thu, 27 Nov 2014 18:28:59 +0000 (18:28 +0000)]
[mips][microMIPS] Implement SWM16 and LWM16 instructions
Differential Revision: http://reviews.llvm.org/D5579

llvm-svn: 222901

9 years ago[mips][microMIPS] Implement BREAK16 and SDBBP16 instructions
Jozef Kolek [Thu, 27 Nov 2014 18:18:42 +0000 (18:18 +0000)]
[mips][microMIPS] Implement BREAK16 and SDBBP16 instructions

Patch by Radovan Obradovic.

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

llvm-svn: 222900

9 years ago[mips] Add synci instruction.
Daniel Sanders [Thu, 27 Nov 2014 17:28:10 +0000 (17:28 +0000)]
[mips] Add synci instruction.

Patch by Amaury Pouly

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 222899

9 years agoWiden ELFYAML relocation type to 32 bits
Will Newton [Thu, 27 Nov 2014 17:20:48 +0000 (17:20 +0000)]
Widen ELFYAML relocation type to 32 bits

The current 8 bits is sufficient for ELF32 targets but ELF64 requires
32 bits. Add a test for AArch64 that exposes the issue.

llvm-svn: 222898

9 years agoCommit back the correct bits of r222760 (was r222538).
Rafael Espindola [Thu, 27 Nov 2014 17:13:56 +0000 (17:13 +0000)]
Commit back the correct bits of r222760 (was r222538).

I also added a test.

Original message:

Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.

Patch from Akos Kiss.

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

llvm-svn: 222897

9 years agoRevert "Reapply 222538 and update tests to explicitly request small code model and...
Rafael Espindola [Thu, 27 Nov 2014 17:13:51 +0000 (17:13 +0000)]
Revert "Reapply 222538 and update tests to explicitly request small code model and PIC:"

This reverts commit r222760.

It changed our behaviour on PIC so we don't match gas anymore. It also
included lots of unnecessary changes to tests.

If those changes are desirable, there should be an independent discussion
as they are out of scope for that patch.

I will recommit the other bits.

llvm-svn: 222896

9 years agoRevert "Fix overly aggressive type merging."
Duncan P. N. Exon Smith [Thu, 27 Nov 2014 17:01:10 +0000 (17:01 +0000)]
Revert "Fix overly aggressive type merging."

This reverts commit r222727, which causes LTO bootstrap failures.

Last passing @ r222698:
http://lab.llvm.org:8080/green/job/clang-Rlto_master_build/532/

First failing @ r222843:
http://lab.llvm.org:8080/green/job/clang-Rlto_master_build/533/

Internal bootstraps pointed at a much narrower range: r222725 is
passing, and r222731 is failing.

LTO crashes while handling libclang.dylib:
http://lab.llvm.org:8080/green/job/clang-Rlto_master_build/533/consoleFull#-158682280549ba4694-19c4-4d7e-bec5-911270d8a58c

    GEP is not of right type for indices!
      %InfoObj.i.i = getelementptr inbounds %"class.llvm::OnDiskIterableChainedHashTable"* %.lcssa, i64 0, i32 0, i32 4, !dbg !123627
     %"class.clang::serialization::reader::ASTIdentifierLookupTrait" = type { %"class.clang::ASTReader.31859"*, %"class.clang::serialization::ModuleFile.31870"*, %"class.clang::IdentifierInfo"* }LLVM ERROR: Broken function found, compilation aborted!
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Looks like the new algorithm doesn't merge types aggressively enough.

llvm-svn: 222895

9 years agoSphinx does not have a lexer for OpenCL, so falling back to C for the language on...
Aaron Ballman [Thu, 27 Nov 2014 15:45:59 +0000 (15:45 +0000)]
Sphinx does not have a lexer for OpenCL, so falling back to C for the language on the code block. Also fixing an indentation warning. NFC to the content of the documentation itself.

llvm-svn: 222894

9 years agoclang-format: [JS] Contract fewer functions to a single line.
Daniel Jasper [Thu, 27 Nov 2014 15:37:42 +0000 (15:37 +0000)]
clang-format: [JS] Contract fewer functions to a single line.

Before:
  var someVariable =
      function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); };

After:
  var someVariable = function(x) {
    return x.zIsTooLongForOneLineWithTheDeclarationLine();
  };

llvm-svn: 222893

9 years agoclang-format: [JS] Try not to break in container literals.
Daniel Jasper [Thu, 27 Nov 2014 15:24:48 +0000 (15:24 +0000)]
clang-format: [JS] Try not to break in container literals.

Before:
  var obj = {
    fooooooooo:
        function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); }
  };

After:
  var obj = {
    fooooooooo: function(x) {
      return x.zIsTooLongForOneLineWithTheDeclarationLine();
    }
  };

llvm-svn: 222892

9 years agoreinstate r222872: Peephole optimization in switch table lookup: reuse the guarding...
Erik Eckstein [Thu, 27 Nov 2014 15:13:14 +0000 (15:13 +0000)]
reinstate r222872: Peephole optimization in switch table lookup: reuse the guarding table comparison if possible.

Fixed missing dominance check.
Original commit message:

This optimization tries to reuse the generated compare instruction, if there is a comparison against the default value after the switch.
Example:
   if (idx < tablesize)
      r = table[idx]; // table does not contain default_value
   else
      r = default_value;
   if (r != default_value)
      ...
Is optimized to:
   cond = idx < tablesize;
   if (cond)
      r = table[idx];
   else
      r = default_value;
   if (cond)
      ...
Jump threading will then eliminate the second if(cond).

llvm-svn: 222891

9 years agoclang-format: [JS] new and delete are valid function names.
Daniel Jasper [Thu, 27 Nov 2014 14:55:17 +0000 (14:55 +0000)]
clang-format: [JS] new and delete are valid function names.

Before:
  someObject.new ();
  someObject.delete ();

After:
  someObject.new();
  someObject.delete();

llvm-svn: 222890

9 years ago[msan] Remove indirect call wrapping code.
Evgeniy Stepanov [Thu, 27 Nov 2014 14:54:02 +0000 (14:54 +0000)]
[msan] Remove indirect call wrapping code.

This functionality was only used in MSanDR, which is deprecated.

llvm-svn: 222889

9 years agoclang-format: [JS] Make Closure module detection more narrow.
Daniel Jasper [Thu, 27 Nov 2014 14:46:03 +0000 (14:46 +0000)]
clang-format: [JS] Make Closure module detection more narrow.

Before:
  var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName');

After:
  var MyLongClassName =
      goog.module.get('my.long.module.name.followedBy.MyLongClassName');

llvm-svn: 222888

9 years ago[mips][microMIPS] Implement disassembler support for 16-bit instructions LI16, ADDIUR...
Jozef Kolek [Thu, 27 Nov 2014 14:41:44 +0000 (14:41 +0000)]
[mips][microMIPS] Implement disassembler support for 16-bit instructions LI16, ADDIUR1SP, ADDIUR2 and ADDIUS5

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

llvm-svn: 222887

9 years agoclang-format: Don't use column layout with AlignAfterOpenBrackets.
Daniel Jasper [Thu, 27 Nov 2014 14:40:48 +0000 (14:40 +0000)]
clang-format: Don't use column layout with AlignAfterOpenBrackets.

This fixes llvm.org/PR21676.

llvm-svn: 222886

9 years ago[Msan] Fix some interceptors to pass initialization on FreeBSD
Viktor Kutuzov [Thu, 27 Nov 2014 14:28:57 +0000 (14:28 +0000)]
[Msan] Fix some interceptors to pass initialization on FreeBSD
Differential Revision: http://reviews.llvm.org/D6417

llvm-svn: 222885

9 years agoA little more work on the compact unwind dumper.
Jason Molenda [Thu, 27 Nov 2014 13:21:38 +0000 (13:21 +0000)]
A little more work on the compact unwind dumper.
UNWIND_X86_64_MODE_STACK_IND mode is almost correct; extra stack
space allocated before the reg saves isn't handled right.  Still a
little wobbily on the file addresses of functions.  Finally understand
how the 6 registers that may be saved are ordered in just 10 its
of space -- the Lehmer code for the registers is derived and then
the sequence is encoded in a variable base number.  Added some
comments with references to what the code is doing so it'll be
easier for others to track down.

llvm-svn: 222884

9 years agoStop uppercasing build attribute data.
Charlie Turner [Thu, 27 Nov 2014 12:13:56 +0000 (12:13 +0000)]
Stop uppercasing build attribute data.

The string data for string-valued build attributes were being unconditionally
uppercased. There is no mention in the ARM ABI addenda about case conventions,
so it's technically implementation defined as to whether the data are
capitialised in some way or not. However, there are good reasons not to
captialise the data.

  * It's less work.
  * Some vendors may legitimately have case-sensitive checks for these
    attributes which would fail on LLVM generated object files.
  * There could be locale issues with uppercasing.

The original reasons for uppercasing appear to have stemmed from an
old codesourcery toolchain behaviour, see

http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/87133

This patch makes the object file emitted no longer captialise string
data, it encodes as seen in the assembly source.

Change-Id: Ibe20dd6e60d2773d57ff72a78470839033aa5538
llvm-svn: 222882

9 years agoUse FileCheck instead of grep. Change by Ankur Garg.
Suyog Sarda [Thu, 27 Nov 2014 11:22:49 +0000 (11:22 +0000)]
Use FileCheck instead of grep. Change by Ankur Garg.

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

llvm-svn: 222879

9 years ago[clang-tidy] Support initializer_list in google-explicit-constructor check
Alexander Kornienko [Thu, 27 Nov 2014 11:11:47 +0000 (11:11 +0000)]
[clang-tidy] Support initializer_list in google-explicit-constructor check

Summary:
According to the Google C++ Style Guide, constructors taking a single
std::initializer_list<> should not be marked explicit.

This change also changes the messages according to conventions used in Clang
diagnostics: no capitalization of the first letter, no trailing dot.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 222878

9 years agoRevert "Peephole optimization in switch table lookup: reuse the guarding table compar...
Erik Eckstein [Thu, 27 Nov 2014 10:59:08 +0000 (10:59 +0000)]
Revert "Peephole optimization in switch table lookup: reuse the guarding table comparison if possible."

It is breaking the clang bootstrag.

llvm-svn: 222877

9 years agoUse FileCheck instead of grep. Change by Sonam.
Suyog Sarda [Thu, 27 Nov 2014 10:57:24 +0000 (10:57 +0000)]
Use FileCheck instead of grep. Change by Sonam.

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

llvm-svn: 222876

9 years agoautoconf: Move libraries later to ensure that all symbols are found
Tobias Grosser [Thu, 27 Nov 2014 10:14:27 +0000 (10:14 +0000)]
autoconf: Move libraries later to ensure that all symbols are found

This fixes llvm.org/PR19540

llvm-svn: 222874

9 years agoAdd test for MI tokens.
Hafiz Abid Qadeer [Thu, 27 Nov 2014 09:19:46 +0000 (09:19 +0000)]
Add test for MI tokens.
This file tests the sequence of digits that can come before
an MI command.

Patch from dawn@burble.org.

llvm-svn: 222873

9 years agoPeephole optimization in switch table lookup: reuse the guarding table comparison...
Erik Eckstein [Thu, 27 Nov 2014 08:33:51 +0000 (08:33 +0000)]
Peephole optimization in switch table lookup: reuse the guarding table comparison if possible.

This optimization tries to reuse the generated compare instruction, if there is a comparison against the default value after the switch.
Example:
    if (idx < tablesize)
       r = table[idx]; // table does not contain default_value
    else
       r = default_value;
    if (r != default_value)
       ...
Is optimized to:
    cond = idx < tablesize;
    if (cond)
       r = table[idx];
    else
       r = default_value;
    if (cond)
       ...
\endcode
Jump threading will then eliminate the second if(cond).

llvm-svn: 222872

9 years agoInstCombine: Restore optimizations lost in r210006
David Majnemer [Thu, 27 Nov 2014 07:25:21 +0000 (07:25 +0000)]
InstCombine: Restore optimizations lost in r210006

This restores our ability to optimize:
(X & C) == 0 ? X ^ C : X  into  X | C
(X & C) != 0 ? X ^ C : X  into  X & ~C

llvm-svn: 222871

9 years agoAdd LLVMObject to LLVMExecutionEngine.
NAKAMURA Takumi [Thu, 27 Nov 2014 06:36:22 +0000 (06:36 +0000)]
Add LLVMObject to LLVMExecutionEngine.

llvm-svn: 222869

9 years agoInstSimplify: Restore optimizations lost in r210006
David Majnemer [Thu, 27 Nov 2014 06:32:46 +0000 (06:32 +0000)]
InstSimplify: Restore optimizations lost in r210006

This restores our ability to optimize:
(X & C) ? X & ~C : X  into  X & ~C
(X & C) ? X : X & ~C  into  X
(X & C) ? X | C : X  into  X
(X & C) ? X : X | C  into  X | C

llvm-svn: 222868

9 years ago[MCJIT] Remove the local symbol table from RuntimeDlyd - it's not needed.
Lang Hames [Thu, 27 Nov 2014 05:40:13 +0000 (05:40 +0000)]
[MCJIT] Remove the local symbol table from RuntimeDlyd - it's not needed.

All symbols have to be stored in the global symbol to enable
cross-rtdyld-instance linking, so the local symbol table content is
redundant.

llvm-svn: 222867

9 years ago[MCJIT] Update CMakeLists.txt for llvm-rtdyld to add Object as a requirement.
Lang Hames [Thu, 27 Nov 2014 04:18:50 +0000 (04:18 +0000)]
[MCJIT] Update CMakeLists.txt for llvm-rtdyld to add Object as a requirement.

Hopefully this will fix
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8271/steps/stage1_build/logs/stdio

llvm-svn: 222866

9 years ago[c++1z] Remove terse range-based for loops; they've been removed from
Richard Smith [Thu, 27 Nov 2014 01:54:27 +0000 (01:54 +0000)]
[c++1z] Remove terse range-based for loops; they've been removed from
consideration for C++17 for now. Update C++ status page to match.

llvm-svn: 222865

9 years ago[MCJIT] Replace JITEventListener::anchor (temporarily removed in r222861), and
Lang Hames [Thu, 27 Nov 2014 01:41:16 +0000 (01:41 +0000)]
[MCJIT] Replace JITEventListener::anchor (temporarily removed in r222861), and
move GDBRegistrationListener into ExecutionEngine to avoid layering violation.

llvm-svn: 222864

9 years agoWhen checking for uninitialized values, do not confuse "std::move" with every
Richard Trieu [Thu, 27 Nov 2014 01:29:32 +0000 (01:29 +0000)]
When checking for uninitialized values, do not confuse "std::move" with every
other function named "move".

llvm-svn: 222863

9 years agoRefactor SocketAddress::getaddrinfo - avoid calling IsValid if ::getaddrinfo has...
Oleksiy Vyalov [Thu, 27 Nov 2014 00:32:54 +0000 (00:32 +0000)]
Refactor SocketAddress::getaddrinfo - avoid calling IsValid if ::getaddrinfo has failed.
Otherwise, IsValid crashes on assertation in GetFamilyLength.

llvm-svn: 222862

9 years ago[MCJIT] Remove JITEventListener's anchor until I can determine the right place
Lang Hames [Thu, 27 Nov 2014 00:15:28 +0000 (00:15 +0000)]
[MCJIT] Remove JITEventListener's anchor until I can determine the right place
to put it. This should unbreak the Mips bots.

llvm-svn: 222861

9 years agoTeach LLVM about llgo subproject.
Peter Collingbourne [Thu, 27 Nov 2014 00:15:21 +0000 (00:15 +0000)]
Teach LLVM about llgo subproject.

llvm-svn: 222860

9 years ago[MCJIT] Move get-any-symbol-load-address logic out of RuntimeDyld and into
Lang Hames [Thu, 27 Nov 2014 00:12:28 +0000 (00:12 +0000)]
[MCJIT] Move get-any-symbol-load-address logic out of RuntimeDyld and into
RuntimeDyldChecker.

RuntimeDyld instances should only provide lookup for locally defined
symbols.

llvm-svn: 222859

9 years agoInitial commit of llgo third_party.
Peter Collingbourne [Thu, 27 Nov 2014 00:12:26 +0000 (00:12 +0000)]
Initial commit of llgo third_party.

llvm-svn: 222858

9 years agoInitial commit of llgo.
Peter Collingbourne [Thu, 27 Nov 2014 00:06:42 +0000 (00:06 +0000)]
Initial commit of llgo.

llvm-svn: 222857

9 years agoRevert "Added inst combine transforms for single bit tests from Chris's note"
David Majnemer [Wed, 26 Nov 2014 23:00:38 +0000 (23:00 +0000)]
Revert "Added inst combine transforms for single bit tests from Chris's note"

This reverts commit r210006, it miscompiled libapr which is used in who
knows how many projects.

A test has been added to ensure that we don't regress again.

I'll work on a rewrite of what the optimization was trying to do later.

llvm-svn: 222856

9 years agoAdd a small "usage:" comment at the top of not.cpp
Sean Silva [Wed, 26 Nov 2014 22:53:46 +0000 (22:53 +0000)]
Add a small "usage:" comment at the top of not.cpp

Mostly pulled from Rafael's r185678 commit message.

llvm-svn: 222855

9 years agoCreate directories for llgo subproject.
Peter Collingbourne [Wed, 26 Nov 2014 22:50:16 +0000 (22:50 +0000)]
Create directories for llgo subproject.

llvm-svn: 222854

9 years agoOpenCL: fix test for lack of names in release builds
Tim Northover [Wed, 26 Nov 2014 22:33:04 +0000 (22:33 +0000)]
OpenCL: fix test for lack of names in release builds

llvm-svn: 222853

9 years agoObject/COFF: Fix off-by-one error for object having lots of relocations
Rui Ueyama [Wed, 26 Nov 2014 22:17:25 +0000 (22:17 +0000)]
Object/COFF: Fix off-by-one error for object having lots of relocations

llvm-objdump printed out an error message for this off-by-one error,
but because it always exits with 0 whether or not it found an error,
the test (llvm-objdump/coff-many-relocs.test) succeeded.
I made llvm-objdump exit with EXIT_FAILURE when an error is found.

llvm-svn: 222852

9 years ago[analyzer] Indented code within the DisplayHelp sub.
Anton Yartsev [Wed, 26 Nov 2014 21:53:39 +0000 (21:53 +0000)]
[analyzer] Indented code within the DisplayHelp sub.

llvm-svn: 222851

9 years agoR600/SI: Use ZeroOrNegativeOneBooleanContent
Matt Arsenault [Wed, 26 Nov 2014 21:23:15 +0000 (21:23 +0000)]
R600/SI: Use ZeroOrNegativeOneBooleanContent

This sort of doesn't matter since the setcc type is i1, but
this previously was using the default UndefinedBooleanContent. This
makes it more consistent with R600. This enables more optimizations
which typically give up on UndefinedBooleanContent. For example,
there is already a special case target DAG combine for
setcc + sext which can be eliminated in favor of what the generic
DAG combiner can do if it assumes boolean values are sign extended.
Since -1 is an inline immediate, using it is basically free and the
backend already uses it when a boolean value is needed in a wider type.

llvm-svn: 222850

9 years ago[Hexagon] Adding cmp* immediate form instructions.
Colin LeMahieu [Wed, 26 Nov 2014 19:43:12 +0000 (19:43 +0000)]
[Hexagon] Adding cmp* immediate form instructions.

llvm-svn: 222849

9 years agoFix buildbot failure on LLP64 platforms like MSVC x86_64.
Richard Smith [Wed, 26 Nov 2014 19:37:39 +0000 (19:37 +0000)]
Fix buildbot failure on LLP64 platforms like MSVC x86_64.

llvm-svn: 222848

9 years ago[mips][microMIPS] Implement disassembler support for 16-bit instructions LBU16, LHU16...
Jozef Kolek [Wed, 26 Nov 2014 18:56:38 +0000 (18:56 +0000)]
[mips][microMIPS] Implement disassembler support for 16-bit instructions LBU16, LHU16, LW16, SB16, SH16 and SW16

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

llvm-svn: 222847

9 years ago[Hexagon] Adding and64, or64, and xor64 instructions.
Colin LeMahieu [Wed, 26 Nov 2014 18:55:59 +0000 (18:55 +0000)]
[Hexagon] Adding and64, or64, and xor64 instructions.

llvm-svn: 222846

9 years agoFix several test failures on Linux/FreeBSD caused by compiler configuration and inval...
Oleksiy Vyalov [Wed, 26 Nov 2014 18:30:04 +0000 (18:30 +0000)]
Fix several test failures on Linux/FreeBSD caused by compiler configuration and invalid environment.

http://reviews.llvm.org/D6392

llvm-svn: 222845

9 years agoR600/SI: Create e64 versions of and/or/xor in SILowerI1Copies
Matt Arsenault [Wed, 26 Nov 2014 18:18:28 +0000 (18:18 +0000)]
R600/SI: Create e64 versions of and/or/xor in SILowerI1Copies

This fixes moving boolean constants into registers before operating
on them. They get permuted and shrunk down to e32 anyway later. This
is a temporary fix until the patch that removes these pseudos is
committed.

llvm-svn: 222844

9 years agoclang-format: [Java] Don't line-wrap package declarations.
Daniel Jasper [Wed, 26 Nov 2014 18:03:42 +0000 (18:03 +0000)]
clang-format: [Java] Don't line-wrap package declarations.

This fixes llvm.org/PR21677.

llvm-svn: 222843

9 years agolibc++: integral types trap on PNaCl
JF Bastien [Wed, 26 Nov 2014 17:51:58 +0000 (17:51 +0000)]
libc++: integral types trap on PNaCl

    Reviewers: dschuff, danalbert

    Subscribers: jfb, cfe-commits

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

llvm-svn: 222842

9 years ago[MCJIT] Fix missing return statement.
Lang Hames [Wed, 26 Nov 2014 17:21:41 +0000 (17:21 +0000)]
[MCJIT] Fix missing return statement.

llvm-svn: 222841

9 years ago[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.
Lang Hames [Wed, 26 Nov 2014 16:54:40 +0000 (16:54 +0000)]
[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.

llvm-svn: 222840

9 years agoclang-format: Tweak -style=Chromium for Java files.
Nico Weber [Wed, 26 Nov 2014 16:43:18 +0000 (16:43 +0000)]
clang-format: Tweak -style=Chromium for Java files.

For Java, don't do any of the deviations from Google Style that Chromium style
does for C++.

Chromium's Java follows Android Java style [1], which is roughly Google Java
style with an indent of 4 and a continuation indent of 8.

1: https://source.android.com/source/code-style.html
llvm-svn: 222839

9 years agoImprove lldb-mi tests.
Hafiz Abid Qadeer [Wed, 26 Nov 2014 16:37:51 +0000 (16:37 +0000)]
Improve lldb-mi tests.

summary of changes:
  Cleanup: Use "line_number" API instead of hardcoded source lines
  Combine child.sendline with previous child.send command.
  test_lldbmi_tokens: Add test for MI tokens.
  test_lldbmi_badpathexe: Remove check for prompt so test for bad path can be enabled.

Patch from dawn@burble.org.

llvm-svn: 222838

9 years agoAdding an explicit triple to this test to get it to pass all build bots.
Aaron Ballman [Wed, 26 Nov 2014 16:17:20 +0000 (16:17 +0000)]
Adding an explicit triple to this test to get it to pass all build bots.

llvm-svn: 222837

9 years ago[asan] Disable preload tests on Android.
Evgeniy Stepanov [Wed, 26 Nov 2014 15:44:15 +0000 (15:44 +0000)]
[asan] Disable preload tests on Android.

They don't test what they claim to because LD_PRELOAD applies to "not" instead
of the actual test binary. And all Android tests run with LD_PRELOAD anyway.

llvm-svn: 222835

9 years ago[OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0.
Anastasia Stulova [Wed, 26 Nov 2014 15:36:41 +0000 (15:36 +0000)]
[OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0.

OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces:
- the named address spaces (__global, __local, and __private) => __generic - implicitly converted;
- __generic => named - with an explicit cast;
- named <=> named - disallowed;
- __constant <=> any other - disallowed.

llvm-svn: 222834

9 years agoReverting r222828 and r222810-r222812 as they broke the build on Windows.
Aaron Ballman [Wed, 26 Nov 2014 15:27:39 +0000 (15:27 +0000)]
Reverting r222828 and r222810-r222812 as they broke the build on Windows.

http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753

llvm-svn: 222833

9 years ago[OpenCL] Generic address space parsing and diagnostics test (forgotten previously)
Anastasia Stulova [Wed, 26 Nov 2014 14:14:05 +0000 (14:14 +0000)]
[OpenCL] Generic address space parsing and diagnostics test (forgotten previously)

llvm-svn: 222832

9 years ago[OpenCL] Generic address space has been added in OpenCL v2.0.
Anastasia Stulova [Wed, 26 Nov 2014 14:10:06 +0000 (14:10 +0000)]
[OpenCL] Generic address space has been added in OpenCL v2.0.

To support it in the frontend, the following has been added:
- generic address space type attribute;
- documentation for the OpenCL address space attributes;
- parsing of __generic(generic) keyword;
- test code for the parser and diagnostics.

llvm-svn: 222831

9 years agoRemoving a spurious semicolon; NFC
Aaron Ballman [Wed, 26 Nov 2014 13:55:55 +0000 (13:55 +0000)]
Removing a spurious semicolon; NFC

llvm-svn: 222830