Commit Graph

174948 Commits

Author SHA1 Message Date
Matt Arsenault f37abc71de R600/SI: Move instruction pattern to instruction definition
llvm-svn: 209454
2014-05-22 17:45:20 +00:00
Diego Novillo 0b761a48cf Remove LLVMContextImpl::optimizationRemarkEnabledFor.
Summary:
This patch moves the handling of -pass-remarks* over to
lib/DiagnosticInfo.cpp. This allows the removal of the
optimizationRemarkEnabledFor functions from LLVMContextImpl, as they're
not needed anymore.

Reviewers: qcolombet

Subscribers: llvm-commits

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

llvm-svn: 209453
2014-05-22 17:19:01 +00:00
Todd Fiala fbce07ced0 Added gdbremote protocol test for $p and returned data size.
Each register returned by $qRegisterInfo is tested that it's
$p register read returns a representation that is the correct byte size
as indicated by $qRegisterInfo.

Currently enabled for debugserver, disabled for llgs.

The llgs branch will use this to verify $p implementation.

llvm-svn: 209452
2014-05-22 17:18:18 +00:00
Andrea Di Biagio c8dd1ad85b [X86] Improve the lowering of BITCAST from MVT::f64 to MVT::v4i16/MVT::v8i8.
This patch teaches the x86 backend how to efficiently lower ISD::BITCAST dag
nodes from MVT::f64 to MVT::v4i16 (and vice versa), and from MVT::f64 to
MVT::v8i8 (and vice versa).

This patch extends the logic from revision 208107 to also handle MVT::v4i16
and MVT::v8i8. Also, this patch correctly propagates Undef values when
performing the widening of a vector (example: when widening from v2i32 to
v4i32, the upper 64bits of the resulting vector are 'undef').

llvm-svn: 209451
2014-05-22 16:21:39 +00:00
Alexander Kornienko dad4acbc52 Add clang-tidy -line-filter option to filter findings by line ranges.
Summary:
This is going to be used for a clang-tidy-diff script to display
warnings in changed lines only. The option uses JSON, as its value is not
intended to be entered manually.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 209450
2014-05-22 16:07:11 +00:00
Hans Wennborg f436b2837c An inline function redeclaration does not drop the dllimport attribute
llvm-svn: 209449
2014-05-22 15:46:15 +00:00
Timur Iskhodzhanov d6ac15dd5f Quick-fix a copy-and-paste mistake in one of the ASan test
llvm-svn: 209448
2014-05-22 15:14:05 +00:00
Daniel Jasper 94ea5bb115 clang-format: Add basic test for -style=none.
llvm-svn: 209447
2014-05-22 15:13:48 +00:00
Daniel Jasper c64b09acc3 clang-format: Introduce DisableFormat that prevents formatting.
And "none" pseudo-style indicating that formatting should be not
applied.

(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.

(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.

Patch by Adam Strzelecki. Thank you!

llvm-svn: 209446
2014-05-22 15:12:22 +00:00
Kostya Serebryany e31d5b6a2c [asan] relax the test for long double
llvm-svn: 209445
2014-05-22 14:50:14 +00:00
Timur Iskhodzhanov b2eb3131f4 [ASan/Win] Make sure the list of wrappers exported by the main module and imported by the DLL thunk always matches
llvm-svn: 209444
2014-05-22 14:49:56 +00:00
Tim Northover b2a6fdb11a ARM64: remove '#' from annotation of add/sub immediate
The full string used to be "// =#12" for example, which looks too
busy.

llvm-svn: 209443
2014-05-22 14:20:05 +00:00
Diego Novillo 7f8af8bf91 Add support for missed and analysis optimization remarks.
Summary:
This adds two new diagnostics: -pass-remarks-missed and
-pass-remarks-analysis. They take the same values as -pass-remarks but
are intended to be triggered in different contexts.

-pass-remarks-missed is used by LLVMContext::emitOptimizationRemarkMissed,
which passes call when they tried to apply a transformation but
couldn't.

-pass-remarks-analysis is used by LLVMContext::emitOptimizationRemarkAnalysis,
which passes call when they want to inform the user about analysis
results.

The patch also:

1- Adds support in the inliner for the two new remarks and a
   test case.

2- Moves emitOptimizationRemark* functions to the llvm namespace.

3- Adds an LLVMContext argument instead of making them member functions
   of LLVMContext.

Reviewers: qcolombet

Subscribers: llvm-commits

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

llvm-svn: 209442
2014-05-22 14:19:46 +00:00
Timur Iskhodzhanov 8ff177ede3 [ASan/Win] Thread more library functions from the DLL thunk to the main module
llvm-svn: 209441
2014-05-22 13:57:22 +00:00
Daniel Jasper 565ed5ed08 clang-format: Don't use Allman brace breaking for ObjC blocks.
It just seems wrong. This fixes llvm.org/PR19736.

llvm-svn: 209440
2014-05-22 13:53:55 +00:00
Timur Iskhodzhanov 498e56adb6 [ASan/Win] Add more tests for operator new[]
llvm-svn: 209439
2014-05-22 13:28:27 +00:00
Daniel Jasper bd630737bd clang-format: Fix corner case in AllowShortBlocksOnASingleLine.
Before:
  template <int> struct A4 { A4() { }
  };

After:
  template <int i> struct A4 {
    A4() {}
  };

This fixes llvm.org/PR19813 (at least the part that isn't working as
intended).

llvm-svn: 209438
2014-05-22 13:25:26 +00:00
Tim Northover 15ff71deea MachO: look for nearby tools on all MachO platforms.
This brings "-arch armv7m" (etc) behaviour more in line with what's expected
for developers on OS X, and allows Clang to find an "ld" (for example) in the
same directory instead of using the default /usr/bin/ld.

Unfortunately no test because it relies on the specific place Clang is running
from.

rdar://problem/16427320

llvm-svn: 209437
2014-05-22 13:12:14 +00:00
Tim Northover f9e798ba6a Segmented stacks: omit __morestack call when there's no frame.
Patch by Florian Zeitz

llvm-svn: 209436
2014-05-22 13:03:43 +00:00
Tim Northover cc346a92e3 Revert "TMP"
This reverts r209433. Sorry about that, it needs a test & better message.

llvm-svn: 209435
2014-05-22 12:55:29 +00:00
Tim Northover e5c6f4c304 MachO: perform ARM ABI detection even for non-Darwin triples.
When "-arch armv7m" is specified, we want "aapcs", for example.

rdar://problem/16581138

llvm-svn: 209434
2014-05-22 12:54:30 +00:00
Tim Northover 36ce1e056c TMP
llvm-svn: 209433
2014-05-22 12:54:24 +00:00
Rafael Espindola 2d401f5bb5 Use stack protector strong by default on OpenBSD.
Use stack protector strong by default to match the base OS and ports/packages
compiler policy.

Patch by Brad Smith.

llvm-svn: 209432
2014-05-22 12:52:35 +00:00
Daniel Jasper 91b032ab55 clang-format: Fix braced list detection.
Before:
  static_assert(std::is_integral<int> {} + 0, "");
  int a = std::is_integral<int> {}
  + 0;

After:
  static_assert(std::is_integral<int>{} + 0, "");
  int a = std::is_integral<int>{} + 0;

llvm-svn: 209431
2014-05-22 12:46:38 +00:00
Tim Northover 2dce43c26f ARM64: these work too
llvm-svn: 209430
2014-05-22 12:14:49 +00:00
Tim Northover 5949b60550 Yes they do
llvm-svn: 209429
2014-05-22 12:14:02 +00:00
Daniel Jasper 438059e509 clang-format: Fix incorrect braced init identification.
Before:
  int foo(int i) {
    return fo1 {}
    (i);
  }
  int foo(int i) {
    return fo1 {}
    (i);
  }

After:
  int foo(int i) { return fo1{}(i); }
  int foo(int i) { return fo1{}(i); }

This fixes llvm.org/PR19812.

llvm-svn: 209428
2014-05-22 12:11:13 +00:00
Timur Iskhodzhanov 0c7c78f1d1 [ASan/Win] Use the new function interception approach to handle function wrappers too; wrap strlen() in DLLs
Reviewed at http://reviews.llvm.org/D3871

llvm-svn: 209427
2014-05-22 12:03:40 +00:00
Tim Northover 4a3ab28ac7 ARM64: model pre/post-indexed operations properly.
We should be keeping track of the writeback on these instructions,
otherwise we're relying on LLVM's stupidity for correct code.

Fortunately, the MC layer can now handle all required constraints,
which means we can get rid of the CodeGen only PseudoInsts too.

llvm-svn: 209426
2014-05-22 11:56:20 +00:00
Tim Northover c350acfda5 ARM64: separate load/store operands to simplify assembler
This changes ARM64 to use separate operands for each component of an
address, and look for separate '[', '$Rn, ..., ']' tokens when
parsing.

This allows us to do away with quite a bit of special C++ code to
handle monolithic "addressing modes" in the MC components. The more
incremental matching of the assembler operands also allows for better
diagnostics when LLVM is presented with invalid input.

Most of the complexity here is with the register-offset instructions,
which were extremely dodgy beforehand: even when the instruction used
wM, LLVM's model had xM as an operand. We papered over this
discrepancy before, but that approach doesn't work now so I split them
into separate X and W variants.

llvm-svn: 209425
2014-05-22 11:56:09 +00:00
Daniel Sanders 18b68e16af [mips] Make unalignedload.ll test stricter and easier to modify for MIPS32r6/MIPS64r6
Summary:
* Split into two functions, one to test each struct.
* R0 and R2 must be defined by an lw with a %got reference to the correct
  symbol.
* Test for $4 (first argument) where appropriate instead of accepting any
  register.
* Test that the two lbu's are correctly combined into $4

Depends on D3844

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209424
2014-05-22 11:55:04 +00:00
Daniel Sanders e1f46e58c9 [mips] Change lwl and lwr in inlineasm_constraint.ll to lw
Summary:
lwl and lwr are not available in MIPS32r6/MIPS64r6. The purpose of the test
is to check that the '$1' expands to '0($x)' rather than to test something related
to the lwl or lwr instructions so we can simply switch to lw.

Depends on D3842

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209423
2014-05-22 11:51:06 +00:00
Daniel Jasper 1f6c7e9358 clang-format: Store pointers to seen formatting states.
As the memory ownership is handled by the SpecificBumpPtrAllocator
anyway, there is no need to duplicate states when inserting them into
the Seen-set. This leads to an improvement of ~10% on the benchmark
formatting file.

No functional changes intended.

llvm-svn: 209422
2014-05-22 11:47:01 +00:00
Daniel Sanders b230595839 [mips] Use addiu in inline assembly tests since addi is not available in all ISA's
Summary:
This patch is necessary so that they do not fail on MIPS32r6/MIPS64r6 when
-integrated-as is enabled by default and we correctly detect the host CPU.

No functional change since these tests are testing the behaviour of the
constraint used for the third operand rather than the mnemonic.

Depends on D3842

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

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

llvm-svn: 209421
2014-05-22 11:46:58 +00:00
Bradley Smith 9288b2181f Extend sys::getHostCPUFeatures to work on AArch64 platforms
llvm-svn: 209420
2014-05-22 11:44:34 +00:00
Daniel Sanders 36ff7c2adc [mips][mips64r6] addi is not available on MIPS32r6/MIPS64r6
Summary: Depends on D3787. Tablegen will raise an assertion without it.

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

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

llvm-svn: 209419
2014-05-22 11:42:31 +00:00
Daniel Sanders a3566c633d [mips][mips64r6] Test that paired single instructions are invalid
Summary:
These emit the 'unknown instruction' instead of the correct error
because they have not been implemented in LLVM for any MIPS ISA.

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209418
2014-05-22 11:37:38 +00:00
Daniel Jasper 62f73ec1ef clang-format: Fix vim-integration for empty files.
Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.

llvm-svn: 209417
2014-05-22 11:37:05 +00:00
Timur Iskhodzhanov 94ffc5bc12 [ASan/Win] Don't use INTERCEPTOR_ATTRIBUTE for operator new/delete on Windows
Reviewed at http://reviews.llvm.org/D3870

llvm-svn: 209416
2014-05-22 11:31:21 +00:00
Daniel Sanders 5c582b2f6d [mips][mips64r6] Add b[on]vc
Summary:
This required me to implement the disassembler for MIPS64r6 since the encodings
are ambiguous with other instructions. This in turn revealed a few
assembly/disassembly bugs which I have fixed.

* da[ht]i only take two operands according to the spec, not three.
* DecodeBranchTarget2[16] correctly handles wider immediates than simm16
  * Also made non-functional change to DecodeBranchTarget and
    DecodeBranchTargetMM to keep implementation style consistent between
    them.
* Difficult encodings are handled by a custom decode method on the most
  general encoding in the group. This method will convert the MCInst to a
  different opcode if necessary.

DecodeBranchTarget is not currently the inverse of getBranchTargetOpValue
so disassembling some branch instructions emit incorrect output. This seems
to affect branches with delay slots on all MIPS ISA's. I've left this bug
for now and temporarily removed the check for the immediate on
bc[12]eqz/bc[12]nez in the MIPS32r6/MIPS64r6 tests.

jialc and jic crash the disassembler for some reason. I've left these
instructions commented out for the moment.

Depends on D3760

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209415
2014-05-22 11:23:21 +00:00
Timur Iskhodzhanov 818b2e8f71 [ASan/Win] Add a comment about DCL-using-static vs threads
llvm-svn: 209414
2014-05-22 10:24:48 +00:00
Daniel Jasper 49802ef93b clang-format: [JS] Understand line breaks in concatenated strings.
Before:
  var literal = 'hello ' + 'world';

After:
  var literal = 'hello ' +
                'world';

There is no reason to concatenated two string literals with a '+' unless
the line break is intended.

llvm-svn: 209413
2014-05-22 09:10:04 +00:00
Daniel Jasper 3948516a03 clang-format: Correctly identify multiplications in braces init lists.
Before:
  int i{a *b};

After:
  int i{a * b};

Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.

llvm-svn: 209412
2014-05-22 09:00:33 +00:00
Alexander Musman 515ad8c490 This patch adds a helper class (CGLoopInfo) for marking memory instructions with llvm.mem.parallel_loop_access metadata.
It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses).

Differential revision: http://reviews.llvm.org/D3644

llvm-svn: 209411
2014-05-22 08:54:05 +00:00
Daniel Jasper 5f3ea477cf clang-format: Correctly calculate line lenghts for nest blocks.
If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.

Before (in JavaScript but this also affects lambdas, etc.):
  var x = {
    valueOf: function() { return 1; }
  };

After:
  var x = {valueOf: function() { return 1; }};

llvm-svn: 209410
2014-05-22 08:36:53 +00:00
Tim Northover 0f6272271e ARM64: assert if we see i64 -> i64 extend in the DAG.
Should be no change in behaviour, but it makes the intended
functionality a bit clearer and means we only have to reason about
real extend operations.

llvm-svn: 209409
2014-05-22 07:41:37 +00:00
Tim Northover 71d04225cf AArch64/ARM64: enable more AArch64 tests.
llvm-svn: 209408
2014-05-22 07:40:55 +00:00
Justin Bogner c65a66ddfe Frontend: Propagate ASTReaderListener API in ChainedASTReaderListener
ASTReaderListener's documentation states that visitInputFile will be
called based on the return values of needsInputFileVisitation and
needsSystemInputFileVisitation, but ChainedASTReaderListener may call
these methods on a child listener based on the values returned by the
other child.

Even worse, the calls to visitInputFile may be short-circuited due to
the use of the boolean or, so the calls to visit may not occur at all
for the second listener.

This updates ChainedASTReaderListener::visitInputFile to propagate the
ASTReaderListener behaviour to both children.

llvm-svn: 209394
2014-05-22 06:04:59 +00:00
Saleem Abdulrasool 9dd60cfb64 MC: initialise MCAsmParser variable
Properly initialise HadError to false during construction.  Detected as
use-of-uninitialised variable by MSan!

llvm-svn: 209393
2014-05-22 06:02:59 +00:00
Craig Topper a13603a247 [C++11] Use 'nullptr'. Serialization edition.
llvm-svn: 209392
2014-05-22 05:54:18 +00:00