Commit Graph

276599 Commits

Author SHA1 Message Date
Zhen Cao 4cb299407e [MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737

This is the second attempt to commit this. The test was broken on Linux in the first attempt.

llvm-svn: 318560
2017-11-17 21:59:43 +00:00
Reid Kleckner 66f58909f8 Fix coverage test on Windows bot
llvm-svn: 318559
2017-11-17 21:55:23 +00:00
Rafael Espindola d0929caa21 Don't use llvm/Config/config.h.
It is private to llvm. Instead use llvm/Config/llvm-config.h and check
LLVM_ON_UNIX. That is the same guard that clang uses before including
unistd.h.

llvm-svn: 318558
2017-11-17 21:40:38 +00:00
Matt Arsenault a41351e37c AMDGPU: Move hazard avoidance out of waitcnt pass.
This is mostly moving VMEM clause breaking into
the hazard recognizer. Also move another hazard
currently handled in the waitcnt pass.

Also stops breaking clauses unless xnack is enabled.

llvm-svn: 318557
2017-11-17 21:35:32 +00:00
Reid Kleckner c0a81071d3 Loosen -Wempty-body warning
Do not show it when `if` or `else` come from macros.
E.g.,

    #define USED(A) if (A); else
    #define SOME_IF(A) if (A)

    void test() {
      // No warnings are shown in those cases now.
      USED(0);
      SOME_IF(0);
    }

Patch by Ilya Biryukov!

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

llvm-svn: 318556
2017-11-17 21:33:28 +00:00
Vedant Kumar 188efda585 [llvm-profdata] Don't treat non-fatal merge errors as fatal
This fixes an issue seen on the coverage bot:
http://lab.llvm.org:8080/green/view/Experimental/job/clang-stage2-coverage-R/1930

Profile merging shouldn't fail if a single counter mismatch is detected.

llvm-svn: 318555
2017-11-17 21:18:32 +00:00
Alexander Shaposhnikov f413c7852e [lldb] Ensure that dwo/dwp are not double-indexed
DWO/DWP should not be indexed directly.
Instead, the corresponding base file should be used.
This diff adds an assert to DWARFCompileUnit::Index
and adjusts the methods 
SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE,
SymbolFileDWARF::GetObjCMethodDIEOffsets accordingly.

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

llvm-svn: 318554
2017-11-17 20:50:54 +00:00
Jonas Hahnfeld c6b7af2b4d llvm-demangle-fuzzer: Link in Support
The refactoring in r318407 transiently includes abi-breaking.h
which defines EnableABIBreakingChecks. This breaks my Debug
build because this fuzzer did not link in Support with the symbol.

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

llvm-svn: 318553
2017-11-17 20:46:55 +00:00
Alex Lorenz 42a97a94ca [ObjC][ARC] Honor noescape attribute for -Warc-retain-cycles
rdar://35409566

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

llvm-svn: 318552
2017-11-17 20:44:25 +00:00
Jun Bum Lim 0f90672ae9 [LICM] Fix PR35342
Summary: This change fix PR35342 by replacing only the current use with undef in unreachable blocks.

Reviewers: efriedma, mcrosier, igor-laevsky

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 318551
2017-11-17 20:38:25 +00:00
Rafael Espindola 51c63bb7ef Use TempFile in the implementation of LockFileManager.
This move some of the complexity over to the lower level TempFile.

It also makes it a bit more explicit where errors are ignored since we
now have a call to consumeError.

llvm-svn: 318550
2017-11-17 20:06:41 +00:00
Chandler Carruth 693eedb138 [PM/Unswitch] Teach SimpleLoopUnswitch to do non-trivial unswitching,
making it no longer even remotely simple.

The pass will now be more of a "full loop unswitching" pass rather than
anything substantively simpler than any other approach. I plan to rename
it accordingly once the dust settles.

The key ideas of the new loop unswitcher are carried over for
non-trivial unswitching:
1) Fully unswitch a branch or switch instruction from inside of a loop to
   outside of it.
2) Update the CFG and IR. This avoids needing to "remember" the
   unswitched branches as well as avoiding excessively cloning and
   reliance on complex parts of simplify-cfg to cleanup the cfg.
3) Update the analyses (where we can) rather than just blowing them away
   or relying on something else updating them.

Sadly, #3 is somewhat compromised here as the dominator tree updates
were too complex for me to want to reason about. I will need to make
another attempt to do this now that we have a nice dynamic update API
for dominators. However, we do adhere to #3 w.r.t. LoopInfo.

This approach also adds an important principls specific to non-trivial
unswitching: not *all* of the loop will be duplicated when unswitching.
This fact allows us to compute the cost in terms of how much *duplicate*
code is inserted rather than just on raw size. Unswitching conditions
which essentialy partition loops will work regardless of the total loop
size.

Some remaining issues that I will be addressing in subsequent commits:
- Handling unstructured control flow.
- Unswitching 'switch' cases instead of just branches.
- Moving to the dynamic update API for dominators.

Some high-level, interesting limitationsV that folks might want to push
on as follow-ups but that I don't have any immediate plans around:
- We could be much more clever about not cloning things that will be
  deleted. In fact, we should be able to delete *nothing* and do
  a minimal number of clones.
- There are many more interesting selection criteria for which branch to
  unswitch that we might want to look at. One that I'm interested in
  particularly are a set of conditions which all exit the loop and which
  can be merged into a single unswitched test of them.

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

llvm-svn: 318549
2017-11-17 19:58:36 +00:00
Peter Collingbourne 5e80bdebd2 COFF: Stop emitting a non-standard COFF symbol table into PEs.
Now that our support for PDB emission is reasonably good, there is
no longer a need to emit a COFF symbol table.

Also fix a bug where we would fail to emit a string table for long
section names if /debug was not specified.

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

llvm-svn: 318548
2017-11-17 19:51:20 +00:00
Reid Kleckner d99ac29a24 All .xdata sections are eligble for ICF
Summary:
Many small functions have identical unwind info because they push the
same sets of CSRs in the same order and have the same stack and prologue
size. The VC linker merges duplicate .xdata, and so should LLD.

This reduces the .xdata section size of clang.exe from 1.8MB to 94KB.

Reviewers: pcc, ruiu

Subscribers: llvm-commits

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

llvm-svn: 318547
2017-11-17 19:50:10 +00:00
Peter Collingbourne dd01ddbe67 Enable PDB generation with lld in asan and cfi tests on Windows.
PDB emission now works well enough that we can rely on it for these
tests to pass.

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

llvm-svn: 318546
2017-11-17 19:49:41 +00:00
Ahmed Bougacha 5d0199a218 [CodeGen] Compute the objc EH vtable address point using inbounds GEP.
The object is provided by the objc runtime and is never visible in the
module itself, but even so, the address point we compute points into it,
and "+16" is guaranteed not to overflow.

This matches the c++ vtable IRGen.

Note that I'm not entirely convinced the 'i8*' type is correct here: at
the IR level, we're accessing memory that's outside the global object.
But we don't control the allocation, so it's not obviously wrong either.
But either way, this is only in a global initializer, so I don't think
it's going to be mucked with.  Filed PR35352 to discuss that.

llvm-svn: 318545
2017-11-17 19:46:47 +00:00
Ilya Biryukov 11a0252888 [clangd] Release the old preamble before building a new one.
llvm-svn: 318544
2017-11-17 19:05:56 +00:00
Justin Bogner 6c7663fd54 MIRParser: Avoid reading uninitialized memory on generic vregs
If a vreg's bank is specified in the registers block and one of its
defs or uses also specifies the bank, we end up checking that the
RegBank is equal to diagnose conflicting banks. The problem comes up
for generic vregs, where we weren't fully initializing the VRegInfo
when parsing the registers block, so we'd end up comparing a null
pointer to uninitialized memory.

This fixes a non-deterministic failure when round tripping through MIR
with generic vregs.

llvm-svn: 318543
2017-11-17 18:51:20 +00:00
Simon Pilgrim 7834009726 [X86] Merge scheduling tests for SHLD/SHRD
Reduces spsce used and makes it easier to compare the 2 values for the equivalent instructions

llvm-svn: 318541
2017-11-17 18:35:49 +00:00
Volodymyr Sapsai 8b46ff1648 [ThinLTO] Remove too aggressive assertion in building function call graph.
The assertion was introduced in r317853 but there are cases when a call
isn't handled either as direct or indirect. In this case we add a
reference graph edge but not a call graph edge.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: mehdi_amini, inglorion, eraman, hiraditya, efriedma, llvm-commits

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

llvm-svn: 318540
2017-11-17 18:28:05 +00:00
Sam Clegg c94d393ad5 [WebAssembly] Initial wasm linker implementation
This linker backend is still a work in progress but is
enough to link simple programs including linking against
library archives.

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

llvm-svn: 318539
2017-11-17 18:14:09 +00:00
Eugene Zelenko ae304b0717 [AST] Partially revert r318341 to fix two broken tests on llvm-clang-x86_64-expensive-checks-win (NFC).
llvm-svn: 318538
2017-11-17 18:09:48 +00:00
Martin Probst a004b3f50f clang-format: remove trailing lines in lamdas and arrow functions.
Summary:
clang-format already removes empty lines at the beginning & end of
blocks:

    int x() {

      foo();  // lines before and after will be removed.

    }

However because lamdas and arrow functions are parsed as expressions,
the existing logic to remove empty lines in UnwrappedLineFormatter
doesn't handle them.

This change special cases arrow functions in ContinuationIndenter to
remove empty lines:

    x = []() {

      foo();  // lines before and after will now be removed.

    };

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 318537
2017-11-17 18:06:33 +00:00
Alexey Bataev f836537516 [OPENMP] Codegen for `target simd` construct.
Added codegen support for `target simd` directive.

llvm-svn: 318536
2017-11-17 17:57:25 +00:00
Rafael Espindola e28e9c0d9b Try to fix the windows build.
llvm-svn: 318535
2017-11-17 17:46:39 +00:00
Rafael Espindola a78286f924 Use TempFile in dsymutil.
I don't think there is any functionality change, but the code is
easier to understand IMHO.

llvm-svn: 318534
2017-11-17 17:33:09 +00:00
Rafael Espindola e827024134 Revert "[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true."
This reverts commit r318528.

MC/AsmParser/preserve-comments-crlf.s fails on linux.

llvm-svn: 318533
2017-11-17 17:31:20 +00:00
Michal Gorny 0eaaf27fc3 [CMake] Allow for Solaris ld -V output on stdout
In recent versions of Solaris 11.4 (previously 12), ld -V output went to
stdout instead of stderr. Since AddLLVM.cmake only expects it on stderr,
Solaris ld wasn't properly detected and options not understood by it are
passed during the build.

The following patch fixes this, allowing for both variants.

Tested on i386-pc-solaris2.11.4 (on top of D35755 which is needed for
proper Solaris support).

Patch by Rainer Orth.

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

llvm-svn: 318532
2017-11-17 17:12:14 +00:00
Evandro Menezes 4b964f2b95 [AArch64] Adjust the cost model for Exynos M1 and M2
Improve the accuracy of the model by specifying the proper number of uops.

llvm-svn: 318531
2017-11-17 16:42:15 +00:00
Stephan Bergmann 15b87c6de3 Indent code blocks so they are actually treated as such
llvm-svn: 318530
2017-11-17 16:34:36 +00:00
Dave Lee 984964a04f Fix skipping of flags in getClangStripDependencyFileAdjuster
Summary:
The ArgumentsAdjuster returned from `getClangStripDependencyFileAdjuster` will
skip dependency flags, and also their associated values for those flags that
take an argument. This change corrects the handling of the `-MD` and `-MMD`
flags, which do not take an argument.

Reviewers: saugustine, klimek, alexshap

Reviewed By: alexshap

Subscribers: cfe-commits

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

llvm-svn: 318529
2017-11-17 16:27:21 +00:00
Zhen Cao ac358137f7 [MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737

llvm-svn: 318528
2017-11-17 16:17:56 +00:00
Jonas Hahnfeld 0924094e34 [OMPT] Fix inaccuracies in worksharing tests
These tests were failing rarely on my MacBook when there was some
activity in the background. Read: one of a thousand executions?

 * sections.c missed the sorting based on thread ids. This worked
   as long as the master thread finished its section before the
   worker thread started the second one but failed if the master
   thread was put to sleep by the OS.
 * The checks in single.c assumed that the master thread executes
   the single region which works most of the time because it is
   usually faster than the newly spawned worker thread.

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

llvm-svn: 318527
2017-11-17 15:26:44 +00:00
Dmitry Preobrazhensky 682a654758 [AMDGPU][MC][GFX9][disassembler] Corrected decoding of op_sel_hi for v_mad_mix*
See bug 35148: https://bugs.llvm.org//show_bug.cgi?id=35148

Reviewers: tamazov, SamWot, arsenm

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

llvm-svn: 318526
2017-11-17 15:15:40 +00:00
Krasimir Georgiev 6649665d5a [clang-format] Add text proto filename detection
Summary: Adds text proto filename detection.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 318525
2017-11-17 15:10:49 +00:00
Ben Dunbobbin cac52140bc [Support][CachePruning] Fix regression in pruning interval
Fixed broken comparison.
borked by: rL284966 (see: https://reviews.llvm.org/D25730).

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

This is a second attempt to commit this.
The first attempt broke lld and gold tests that had been written against
the incorrect behaivour.

llvm-svn: 318524
2017-11-17 14:42:18 +00:00
Gabor Horvath 024d0b3bb9 [clang-tidy] Fix an oversight after renaming a check
llvm-svn: 318523
2017-11-17 12:28:58 +00:00
Gabor Horvath d984e33b1e [clang-tidy] Add a check for undelegated copy of base classes
Finds copy constructors where the constructor don't call
the copy constructor of the base class.

```
class X : public Copyable {
    X(const X &other) {} // Copyable(other) is missing
};
```

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

llvm-svn: 318522
2017-11-17 12:23:30 +00:00
Andrew Ng 727157ea68 [gold] Fix broken thin LTO cache test NFC
Fix test as it is assuming that the cache pruning is always being
performed by default. Explicitly set prune interval to 0s to ensure
pruning is always performed.

llvm-svn: 318520
2017-11-17 12:00:57 +00:00
George Rimar 5f928ff133 [ELF] - Teach LLD to use information from .debug_str for error reporting.
Recently we teached LLD to report line numbers for duplicate variables
definitions, though currently LLD is unable to do that for case when
strings are not built in .debug_info, but stored in .debug_str instead.
That is because out LLDDwarfObj does not handle .debug_str yet. 
Patch fixes that.

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

llvm-svn: 318519
2017-11-17 11:57:47 +00:00
George Rimar 690a811df1 [ELF] - Fix BB after r318516
Test did not run under windows because uses zlib.

Content of section changed because now strings
merging is applied.

llvm-svn: 318518
2017-11-17 11:39:26 +00:00
Philip Pfaffe 2813ce228b [nfc] Iwyu: forward-declare/include raw_ostream in zone algo
llvm-svn: 318517
2017-11-17 11:34:29 +00:00
George Rimar 80355234f7 [ELF] - Allow applying SHF_MERGE optimization for relocatable output.
This fixes PR35223.

Here I enabled SHF_MERGE section content merging for -r like
we do for regular linking.

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

llvm-svn: 318516
2017-11-17 11:27:57 +00:00
Manuel Klimek 7786614350 Implement more accurate penalty & trade-offs while breaking protruding tokens.
For each line that we break in a protruding token, compute whether the
penalty of breaking is actually larger than the penalty of the excess
characters. Only break if that is the case.

llvm-svn: 318515
2017-11-17 11:17:15 +00:00
Ilya Biryukov dd9ea751e1 Use llvm-config.h instead of config.h
To fix standalone builds broken by r318411 (config.h is private to llvm).

llvm-svn: 318514
2017-11-17 10:09:02 +00:00
Rui Ueyama 11adb536e1 Ignore -no-ctors-in-init-array.
Patch by dxf@google.com.

llvm-svn: 318513
2017-11-17 08:17:36 +00:00
Rui Ueyama 7212f0ff11 Add a missing #include.
llvm-svn: 318512
2017-11-17 08:17:21 +00:00
Martin Storsjo ec82128971 [MinGW] Define __ARM_DWARF_EH__ for MinGW/ARM
Since SVN r318510, the MinGW/ARM configuration defaults to
dwarf exception handling.

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

llvm-svn: 318511
2017-11-17 08:06:49 +00:00
Martin Storsjo b4c907edd7 [ARM] Use dwarf exception handling on MinGW
Enabling and using dwarf exceptions seems like an easier path
to take, than to make the COFF/ARM backend output EHABI directives.
Previously, no EH model was enabled at all on this target.

There's no point in setting UseIntegratedAssembler to false since
GNU binutils doesn't support Windows on ARM, and since we don't
need to support external assembler, we don't need to use register
numbers in cfi directives.

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

llvm-svn: 318510
2017-11-17 08:04:40 +00:00
Craig Topper e9a6456ab3 [SelectionDAG] Allow custom vector widening through ReplaceNodeResults to handle nodes with chain outputs.
Previously we were assuming all results were vectors and calling SetWidenedVector, but if its a chain result we should just replace uses instead.

This fixes an error found by expensive checks after r318368.

llvm-svn: 318509
2017-11-17 07:03:57 +00:00