Commit Graph

187565 Commits

Author SHA1 Message Date
Rafael Espindola 3d0974105a Add an assert and use a range loop. NFC.
llvm-svn: 222922
2014-11-28 16:26:14 +00:00
Rafael Espindola 93cd657cf0 Add a testcase reduced from clang lto bootstrap on OS X.
llvm-svn: 222921
2014-11-28 15:45:31 +00:00
Charlie Turner db6c5e7afa Fix wrong encoding of MRSBanked.
Patch by Matthew Wahab.

Change-Id: Ia2a001ca2760028ea360fe77b56f203a219eefbc
llvm-svn: 222920
2014-11-28 15:01:06 +00:00
Viktor Kutuzov 30bd345613 [Msan] Generalize mapping facilities to add FreeBSD support
Differential Revision: http://reviews.llvm.org/D6387

llvm-svn: 222919
2014-11-28 11:42:55 +00:00
Evgeniy Stepanov a0b6899234 [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
2014-11-28 11:17:58 +00:00
Charlie Turner ab9524ecdb 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
2014-11-28 11:14:47 +00:00
Ankur Garg 876b891d51 Removed extra line from a comment to test first commit. NFC.
llvm-svn: 222916
2014-11-28 10:38:18 +00:00
Evgeniy Stepanov f34bad98af [asan] Remove the local copy of Android ucontext.h.
This header is present in the r10c release of the NDK.

llvm-svn: 222915
2014-11-28 10:37:44 +00:00
Alexey Bataev f33eba6573 [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
2014-11-28 07:21:40 +00:00
Craig Topper ce27489293 Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.
llvm-svn: 222912
2014-11-28 05:01:21 +00:00
Craig Topper 44586dc4d6 Add missing 'override' keyword.
llvm-svn: 222911
2014-11-28 03:58:26 +00:00
Jason Molenda a6f75467da 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
2014-11-28 03:54:13 +00:00
Craig Topper f34dad9aa3 Use unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.
llvm-svn: 222909
2014-11-28 03:53:02 +00:00
Craig Topper 42bd819882 Use range-based for loops and const-correct a few things.
llvm-svn: 222908
2014-11-28 03:53:00 +00:00
Hongbin Zheng c5447f4c3b 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
2014-11-28 03:26:06 +00:00
Alexis Hunt 724f14e75c 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
2014-11-28 00:53:20 +00:00
Tim Northover a38e5cbf20 Stop using ArrayRef of a const type.
I *think* this is what the GCC bots are complaining about.

llvm-svn: 222905
2014-11-27 21:29:20 +00:00
Tim Northover b047bfae32 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
2014-11-27 21:02:49 +00:00
Tim Northover 3c55ccac48 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
2014-11-27 21:02:42 +00:00
Oleksiy Vyalov 2f206d6ee4 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
2014-11-27 20:51:24 +00:00
Zoran Jovanovic f9a02500b6 [mips][microMIPS] Implement SWM16 and LWM16 instructions
Differential Revision: http://reviews.llvm.org/D5579

llvm-svn: 222901
2014-11-27 18:28:59 +00:00
Jozef Kolek 56a6a7d3bd [mips][microMIPS] Implement BREAK16 and SDBBP16 instructions
Patch by Radovan Obradovic.

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

llvm-svn: 222900
2014-11-27 18:18:42 +00:00
Daniel Sanders b4484d62ad [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
2014-11-27 17:28:10 +00:00
Will Newton a7d232fe56 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
2014-11-27 17:20:48 +00:00
Rafael Espindola d11591b293 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
2014-11-27 17:13:56 +00:00
Rafael Espindola b3323f0bd9 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
2014-11-27 17:13:51 +00:00
Duncan P. N. Exon Smith c586eaa1f1 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
2014-11-27 17:01:10 +00:00
Aaron Ballman c7d4b8dcec 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
2014-11-27 15:45:59 +00:00
Daniel Jasper 41368e9e07 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
2014-11-27 15:37:42 +00:00
Daniel Jasper 4087432f8b 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
2014-11-27 15:24:48 +00:00
Erik Eckstein 0d86c7623f 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
2014-11-27 15:13:14 +00:00
Daniel Jasper 7912123893 clang-format: [JS] new and delete are valid function names.
Before:
  someObject.new ();
  someObject.delete ();

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

llvm-svn: 222890
2014-11-27 14:55:17 +00:00
Evgeniy Stepanov e402d9ef4c [msan] Remove indirect call wrapping code.
This functionality was only used in MSanDR, which is deprecated.

llvm-svn: 222889
2014-11-27 14:54:02 +00:00
Daniel Jasper 53c38f4e79 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
2014-11-27 14:46:03 +00:00
Jozef Kolek aa2b9278fe [mips][microMIPS] Implement disassembler support for 16-bit instructions LI16, ADDIUR1SP, ADDIUR2 and ADDIUS5
Differential Revision: http://reviews.llvm.org/D6419

llvm-svn: 222887
2014-11-27 14:41:44 +00:00
Daniel Jasper 13404dad0d clang-format: Don't use column layout with AlignAfterOpenBrackets.
This fixes llvm.org/PR21676.

llvm-svn: 222886
2014-11-27 14:40:48 +00:00
Viktor Kutuzov d977985e43 [Msan] Fix some interceptors to pass initialization on FreeBSD
Differential Revision: http://reviews.llvm.org/D6417

llvm-svn: 222885
2014-11-27 14:28:57 +00:00
Jason Molenda 671001cc66 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
2014-11-27 13:21:38 +00:00
Charlie Turner 8d43369163 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
2014-11-27 12:13:56 +00:00
Suyog Sarda f8516e1662 Use FileCheck instead of grep. Change by Ankur Garg.
Differential Revision: http://reviews.llvm.org/D6430

llvm-svn: 222879
2014-11-27 11:22:49 +00:00
Alexander Kornienko 15c5e6a597 [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
2014-11-27 11:11:47 +00:00
Erik Eckstein 2190cd9ffa Revert "Peephole optimization in switch table lookup: reuse the guarding table comparison if possible."
It is breaking the clang bootstrag.

llvm-svn: 222877
2014-11-27 10:59:08 +00:00
Suyog Sarda c3024c75e0 Use FileCheck instead of grep. Change by Sonam.
Differential Revision: http://reviews.llvm.org/D6432

llvm-svn: 222876
2014-11-27 10:57:24 +00:00
Tobias Grosser 68c497fb22 autoconf: Move libraries later to ensure that all symbols are found
This fixes llvm.org/PR19540

llvm-svn: 222874
2014-11-27 10:14:27 +00:00
Hafiz Abid Qadeer e7914cfb0e 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
2014-11-27 09:19:46 +00:00
Erik Eckstein e73e308ab9 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
2014-11-27 08:33:51 +00:00
David Majnemer 40157d5c4d 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
2014-11-27 07:25:21 +00:00
NAKAMURA Takumi 5d50b1a432 Add LLVMObject to LLVMExecutionEngine.
llvm-svn: 222869
2014-11-27 06:36:22 +00:00
David Majnemer c6a5e1dd4f 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
2014-11-27 06:32:46 +00:00
Lang Hames a5cd950c73 [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
2014-11-27 05:40:13 +00:00