Commit Graph

254212 Commits

Author SHA1 Message Date
Bob Haarman d93d7754c4 [sanitizer] if WINAPI is already defined, do not redefine it
Summary: lib/sanitizer_common/sanitizer_win_defs.h defineds WINAPI, which is also defined by standard Windows headers. Redefining it causes warnings during compilation. This change causes us to only define WINAPI if it is not already defined, which avoids the warnings.

Reviewers: rnk, zturner, mpividori

Reviewed By: rnk, mpividori

Subscribers: kubamracek

Differential Revision: https://reviews.llvm.org/D29683

llvm-svn: 294497
2017-02-08 18:34:05 +00:00
Reid Kleckner e332a5b670 Fix inline-asm-diags.ll on Windows, give it a triple to avoid WoA thumb confusion
llvm-svn: 294496
2017-02-08 18:17:21 +00:00
Saleem Abdulrasool dea14b2902 llvm-objdump: make NoLeadingAddr work on more than just MachO
Support printing the disassembly without the address on all formats
rather than making it MachO specific.

Patch by Jeff Muizelaar!

llvm-svn: 294495
2017-02-08 18:11:31 +00:00
Artur Pilipenko 045ab08252 [DAGCombiner] NFC. Mark ByteProvider accessors as const
llvm-svn: 294494
2017-02-08 17:59:34 +00:00
Tim Northover e9600d861c GlobalISel: select G_VASTART on iOS AArch64.
The AAPCS ABI is substantially more complicated so that's coming in a separate
patch. For now we can generate correct code for iOS though.

llvm-svn: 294493
2017-02-08 17:57:27 +00:00
Tim Northover f19d467ff6 GlobalISel: translate @llvm.va_start intrinsic.
Because we need to preserve the memory access being performed we need a
separate instruction to represent this.

llvm-svn: 294492
2017-02-08 17:57:20 +00:00
Ehsan Akhgari 3bceebb0e0 [clang-tidy] Add -extra-arg and -extra-arg-before to clang-tidy-diff.py
Summary:
These flags allow specifying extra arguments to the tool's command
line which don't appear in the compilation database.

Reviewers: alexfh, klimek, bkramer

Subscribers: JDevlieghere, cfe-commits

Differential Revision: https://reviews.llvm.org/D29699

llvm-svn: 294491
2017-02-08 17:50:24 +00:00
Matt Arsenault 560665250f NVPTX: Extract mem intrinsic expansions into utilities
llvm-svn: 294490
2017-02-08 17:49:52 +00:00
Chad Rosier e22c992ba9 [Reassociate] Remove an unused argument. NFC.
llvm-svn: 294489
2017-02-08 17:45:27 +00:00
Adrian Prantl a5bf2d7003 Fix bitcode upgrade for DIGlobalVariables with a var: field.
This is a follow-up to https://reviews.llvm.org/D29349.  It turns out
that NeedUpgradeToDIGlobalVariableExpression is always necessary when
we encountered a version==0 record because it may always be referenced
via a list of globals in a DICompileUnit. My tests weren't good enough
to catch this though. To trigger this case, we need much older bitcode
produced by LLVM around version 3.7.

<rdar://problem/30404262>

Differential Revision: https://reviews.llvm.org/D29693

llvm-svn: 294488
2017-02-08 17:44:43 +00:00
Sanjay Patel d11a03b263 [InstCombine] add test for missed vector icmp fold; NFC
Also, move the related existing scalar test to a renamed file 
where I'm planning to add more icmp-add tests.

llvm-svn: 294487
2017-02-08 17:37:17 +00:00
Sanne Wouda fc674bcb12 Move inline asm diags tests to an ARM directory.
The assembler syntaxes (and parsers) differ too much to expect this test to
pass for all of them.

llvm-svn: 294475
2017-02-08 16:48:35 +00:00
Krzysztof Parzyszek 1df58fc2f9 [Hexagon] Fix decoding conflict between A2_zxtb and A4_ext
llvm-svn: 294472
2017-02-08 16:31:00 +00:00
Simon Dardis 3c82a64636 [mips] MUL macro variations
[mips] MUL macro variations

Adds support for MUL macro variations.

Patch by: Srdjan Obucina

Reviewers: zoran.jovanovic, vkalintiris, dsanders, sdardis, obucina, seanbruno

Differential Revision: https://reviews.llvm.org/D16807

llvm-svn: 294471
2017-02-08 16:25:05 +00:00
Sanjay Patel 6dd2eae76a [InstCombine] add local name for repeated calls; NFC
llvm-svn: 294470
2017-02-08 16:19:36 +00:00
George Rimar 82bd8be6d8 Recommit r294464 "[ELF] - Added partial support for --emit-relocs (no --gc-section case, no /DISCARD/ support) #3"
with temporarily file name fix in testcase.

Original commit message:

-q, --emit-relocs - Generate relocations in output

Simplest implementation: 
* no GC case, 
* no "/DISCARD/" linkerscript command support.

This patch is extracted from D28612 / D29636,

Relative to PR31579.

Differential revision: https://reviews.llvm.org/D29663

llvm-svn: 294469
2017-02-08 16:18:10 +00:00
Sanne Wouda 7e101936b6 Fix inline asm diagnostics test.
Don't depend on X86 everywhere. Fix the original problem with a reg-exp for the
column number.

llvm-svn: 294468
2017-02-08 16:14:01 +00:00
Alexander Kornienko 385c2a3134 [clang-tidy] hasErrorOccurred() -> hasUncompilableErrorOccurred()
hasErrorOccurred() -> hasUncompilableErrorOccurred(), since we only care about
errors that lead to invalid AST.

llvm-svn: 294467
2017-02-08 16:11:22 +00:00
George Rimar 0b2cc8190d Reverted r294464 "[ELF] - Added partial support for --emit-relocs (no --gc-section case, no /DISCARD/ support) #3"
Broked build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/5835/steps/test/logs/stdio

llvm-svn: 294466
2017-02-08 16:10:14 +00:00
Reid Kleckner a858981c1d [MS] Fix C++ destructor thunk line info for a declaration
Sometimes the MS ABI needs to emit thunks for declarations that don't
have bodies. Destructor thunks make calls to inlinable functions, so
they need line info or LLVM will complain.

Fixes PR31893

llvm-svn: 294465
2017-02-08 16:09:32 +00:00
George Rimar d6ae624552 [ELF] - Added partial support for --emit-relocs (no --gc-section case, no /DISCARD/ support) #3
-q, --emit-relocs - Generate relocations in output

Simplest implementation: 
* no GC case, 
* no "/DISCARD/" linkerscript command support.

This patch is extracted from D28612 / D29636,

Relative to PR31579.

Differential revision: https://reviews.llvm.org/D29663

llvm-svn: 294464
2017-02-08 15:53:33 +00:00
Daniel Berlin 9c92a469b4 LVI: Add a per-value worklist limit to LazyValueInfo.
Summary:
LVI is now depth first, which is optimal for iteration strategy in
terms of work per call.  However, the way the results get cached means
it can still go very badly N^2 or worse right now.  The overdefined
cache is per-block, because LVI wants to try to get different results
for the same name in different blocks (IE solve the problem
PredicateInfo solves).  This means even if we discover a value is
overdefined after going very deep, it doesn't cache this information,
causing it to end up trying to rediscover it again and again.  The
same is true for values along the way.  In practice, overdefined
anywhere should mean overdefined everywhere (this is how, for example,
SCCP works).

Until we get around to reworking the overdefined cache, we need to
limit the worklist size we process.  Note that permanently reverting
the DFS strategy exploration seems the wrong strategy (temporarily
seems fine if we really want).  BFS is clearly the wrong approach, it
just gets luckier on some testcases.  It's also very hard to design
an effective throttle for BFS. For DFS, the throttle is directly related
to the depth of the CFG.  So really deep CFGs will get cutoff, smaller
ones will not. As the CFG simplifies, you get better results.
In BFS, the limit is it's related to the fan-out times average block size,
which is harder to reason about or make good choices for.

Bug being filed about the overdefined cache, but it will require major
surgery to fix it (plumbing predicateinfo through CVP or LVI).

Note: I did not make this number configurable because i'm not sure
anyone really needs to tweak this knob.  We run CVP 3 times. On the
testcases i have the slow ones happen in the middle, where CVP is
doing cleanup work other things are effective at.  Over the course of
3 runs, we don't see to have any real loss of performance.

I haven't gotten a minimized testcase yet, but just imagine in your
head a testcase where, going *up* the CFG, you have branches, one of
which leads 50000 blocks deep, and the other, to something where the
answer is overdefined immediately.  BFS would discover the overdefined
faster than DFS, but do more work to do so.  In practice, the right
answer is "once DFS discovers overdefined for a value, stop trying to
get more info about that value" (and so, DFS would normally cache the
overdefined results for every value it passed through in those 50k
blocks, and never do that work again. But it don't, because of the
naming problem)

Reviewers: chandlerc, djasper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29715

llvm-svn: 294463
2017-02-08 15:22:52 +00:00
Sanjay Patel 28ef27e3dc [x86] add AVX512vl target for more coverage; NFC
llvm-svn: 294462
2017-02-08 15:22:52 +00:00
Igor Laevsky a9b6872908 [InstComobineCalls] Fix buildbot failures after r294453.
Some targets don't support uint64_t options. Change type to unsigned.

Differential Revision: https://reviews.llvm.org/D28909

llvm-svn: 294461
2017-02-08 15:21:48 +00:00
Rafael Espindola ea590d91a0 Revert "Simplify symbol computation for non alloc sections."
This reverts commit r294346. Looks like it regressed the build of
magenta.

llvm-svn: 294460
2017-02-08 15:19:03 +00:00
Alexander Kornienko bb64200e16 [clang-tidy] Supresses misc-move-constructor-init warning for const fields.
Patch by CJ DiMeglio!

Differential revision: https://reviews.llvm.org/D28973

llvm-svn: 294459
2017-02-08 14:56:16 +00:00
Sanne Wouda 2933875cc2 [Assembler] Enable nicer diagnostics for inline assembly.
Fixed test.

Summary:
Enables source location in diagnostic messages from the backend.  This
is after parsing, during finalization.  This requires the SourceMgr, the
inline assembly string buffer, and DiagInfo to still be alive after
EmitInlineAsm returns.

This patch creates a single SourceMgr for inline assembly inside the
AsmPrinter.  MCContext gets a pointer to this SourceMgr.  Using one
SourceMgr per call to EmitInlineAsm would make it difficult for
MCContext to figure out in which SourceMgr the SMLoc is located, while a
single SourceMgr can figure it out if it has multiple buffers.

The Str argument to EmitInlineAsm is copied into a buffer and owned by
the inline asm SourceMgr.  This ensures that DiagHandlers won't print
garbage.  (Clang emits a "note: instantiated into assembly here", which
refers to this string.)

The AsmParser gets destroyed before finalization, which means that the
DiagHandlers the AsmParser installs into the SourceMgr will be stale.
Restore the saved DiagHandlers.

Since now we're using just one SourceMgr for multiple inline asm
strings, we need to tell the AsmParser which buffer it needs to parse
currently.  Hand a buffer id -- returned from SourceMgr::
AddNewSourceBuffer -- to the AsmParser.

Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet

Reviewed By: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29441
    

llvm-svn: 294458
2017-02-08 14:48:05 +00:00
Krasimir Georgiev 2091a3a0b9 [clang-format] Move OriginalPrefix from base to subclass.
Summary:
OriginalPrefix is only needed for line comment sections. Moved from the base class to the child class.
No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D29716

llvm-svn: 294457
2017-02-08 14:45:19 +00:00
Simon Pilgrim dcd10344a3 [X86][SSE] Tidyup LowerBuildVectorv16i8 and LowerBuildVectorv8i16. NFCI.
Run clang-format and standardized variable names between functions.

llvm-svn: 294456
2017-02-08 14:44:45 +00:00
Amaury Sechet 887117fb3d Add test case for pr31890. NFC
llvm-svn: 294455
2017-02-08 14:35:48 +00:00
Konstantin Zhuravlyov b5acb8ec47 [AMDGPU][NFC] Assign IsaInfo to reference variable in order to shorten long lines
llvm-svn: 294454
2017-02-08 14:34:10 +00:00
Igor Laevsky 900ffa34c8 [InstCombineCalls] Unfold element atomic memcpy instruction
Differential Revision: https://reviews.llvm.org/D28909

llvm-svn: 294453
2017-02-08 14:32:04 +00:00
Igor Laevsky 4b317fa24e [InstCombineCalls] Remove zero length atomic memcpy intrinsics
Differential Revision: https://reviews.llvm.org/D28909

llvm-svn: 294452
2017-02-08 14:23:47 +00:00
Diana Picus e79e5ee244 Fix test to work on swift/cyclone too
I forgot to remove the neonfp target feature from the test, which means we'd
have trouble selecting VADDS on targets that have neonfp enabled by default.

llvm-svn: 294451
2017-02-08 14:23:30 +00:00
NAKAMURA Takumi 9c2d8102d1 asan_symbolize.py: [Py3] Get rid of "print" statement. Use print() or write() instead.
Differential Revision: https://reviews.llvm.org/D27404

llvm-svn: 294450
2017-02-08 14:07:39 +00:00
Konstantin Zhuravlyov 9f89ede107 [AMDGPU] Add target information that is required by tools to metadata
Differential Revision: https://reviews.llvm.org/D28760#fb670e28

llvm-svn: 294449
2017-02-08 14:05:23 +00:00
Diana Picus 79add417b4 Revert "[Assembler] Enable nicer diagnostics for inline assembly."
This reverts commit r294433 because it seems it broke the buildbots.

llvm-svn: 294448
2017-02-08 14:02:16 +00:00
NAKAMURA Takumi a3bc043caa Revert r294356, "DebugInfo: Track spilled variables in LiveDebugValues"
It caused undefined behavior in VarLoc. As far as I investigated,

  - VarLoc::VarLoc() treats negative offset value as InvalidKind.
    Consider the case that (int64_t)MI.getOperand(1).getImm() is negative and whether it satisfies ((uint64_t)Offset < (1ULL << 32)).

  - Comparison operators in VarLoc behave undefined since VarLoc::Loc.Hash is uninitialized in case of InvalidKind.

I guess Offset (in VarLoc) could be made aware of signed, but I am not sure.
So I have reverted it for now.

llvm-svn: 294447
2017-02-08 13:49:28 +00:00
Diana Picus e7ab088a0e Move test from r294430 to target-specific directory
The test is X86-specific, and it broke on the ARM bots because they don't build
the X86 target.

llvm-svn: 294446
2017-02-08 13:48:08 +00:00
Konstantin Zhuravlyov 27d64c3566 [AMDGPU][NFC] De-tabify
llvm-svn: 294445
2017-02-08 13:29:23 +00:00
Roman Gareev 772498dc68 [NFC] Make ScheduleTreeOptimizer::optimizeBand return a schedule node optimized
with optimizeMatMulPattern

This patch makes ScheduleTreeOptimizer::optimizeBand return a schedule node
optimized with optimizeMatMulPattern. Otherwise, it could not use the isolate
option, because standardBandOpts could try to tile a band node with anchored
subtree and get the error, since the use of the isolate option causes any tree
containing the node to be considered anchored. Furthermore, it is not intended
to apply standard optimizations, when the matrix multiplication has been
detected.

llvm-svn: 294444
2017-02-08 13:29:06 +00:00
Alexander Kornienko 2c0feec699 Adding virtual destructor for PredicateBase.
A virtual destructor is needed, since the derived classes are stored in
`iplist<PredicateBase> AllInfos;` and, apparently, ilist_node doesn't have a
virtual destructor.

llvm-svn: 294443
2017-02-08 13:28:27 +00:00
Diana Picus 4fa83c03fd [ARM] GlobalISel: Add FPR reg bank
Add a register bank for floating point values and select simple instructions
using them (add, copies from GPR).

This assumes that the hardware can cope with a single precision add (VADDS)
instruction, so the legalizer will treat G_FADD as legal and the instruction
selector will refuse to select if the hardware doesn't support it. In the future
we'll want to be more careful about this, and legalize to libcalls if we have to
use soft float.

llvm-svn: 294442
2017-02-08 13:23:04 +00:00
Konstantin Zhuravlyov e22fbcb264 [AMDGPU] Distinguish between S/VGPR allocation and encoding granularities
Differential Revision: https://reviews.llvm.org/D29633

llvm-svn: 294441
2017-02-08 13:18:40 +00:00
Konstantin Zhuravlyov e03b1d7b6a [AMDGPU] Move register related queries to subtarget class
Differential Revision: https://reviews.llvm.org/D29318

llvm-svn: 294440
2017-02-08 13:02:33 +00:00
Krasimir Georgiev fd0dda765e [clang-format] Move comment tests to their own file.
Summary: With a growing suite of comment-related tests, it makes sense to take them out of the main test file. No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek, mgorny

Differential Revision: https://reviews.llvm.org/D29713

llvm-svn: 294439
2017-02-08 12:53:18 +00:00
Michal Gorny 221532c00a [test] #ifdef new builtin tests for __arm__ platform
Add an #if that excludes the newly added aeabi* tests on non-ARM
platforms. This is consistent with other ARM tests, and aims to make
running builtin tests easier. Lacking a proper infrastructure to run
tests selectively, it is more convenient if we do not have to implement
directory-platform exclusions and can just rely on tests compiling to
no-op on other platforms.

Differential Revision: https://reviews.llvm.org/D29708

llvm-svn: 294438
2017-02-08 12:02:48 +00:00
Amara Emerson fecdb36f92 [AArch64][TableGen] Skip tied result operands for InstAlias
This patch checks the number of operands in the resulting
instruction instead of just the alias, then skips over
tied operands when generating the printing method.

This allows us to generate the preferred assembly syntax
for the AArch64 'ins' instruction, which should always be
displayed as 'mov' according to the ARMARM.

Several unit tests have changed as a result, but only to
reflect the preferred disassembly.

Some other InstAlias patterns (movk/bic/orr) needed a
slight adjustment to stop them becoming the default
and breaking other unit tests.

Patch by Graham Hunter.

Differential Revision: https://reviews.llvm.org/D29219

llvm-svn: 294437
2017-02-08 11:28:08 +00:00
Dylan McKay 47e38d6449 Update CODE_OWNERS with my new email address
llvm-svn: 294436
2017-02-08 10:38:06 +00:00
Krasimir Georgiev f62f958a58 [clang-format] Break before a sequence of line comments aligned with the next line.
Summary:
Make the comment alignment respect sections of line comments originally alinged
with the next token. Until now the decision how to break a continuous sequence
of line comments into sections was taken without reference to the next token.

source:
```
class A {
public: // comment about public
  // comment about a
  int a;
}
```

format before:
```
class A {
public: // comment about public
        // comment about a
  int a;
}
```

format after:
```
class A {
public: // comment about public
  // comment about a
  int a;
}
```

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D29626

llvm-svn: 294435
2017-02-08 10:30:44 +00:00