Commit Graph

321432 Commits

Author SHA1 Message Date
Petar Avramovic 962524070a [MIPS GlobalISel] Skip copies in addUseDef and addDefUses
Skip copies between virtual registers during search for UseDefs
and DefUses.
Since each operand has one def search for UseDefs is straightforward.
But since operand can have many uses, we have to check all uses of
each copy we traverse during search for DefUses.

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

llvm-svn: 365744
2019-07-11 09:28:34 +00:00
Petar Avramovic e3bb0a72b6 [MIPS GlobalISel] RegBankSelect for chains of ambiguous instructions
When one of the uses/defs of ambiguous instruction is also ambiguous
visit it recursively and search its uses/defs for instruction with
only one mapping available.
When all instruction in a chain are ambiguous arbitrary mapping can
be selected. For s64 operands in ambiguous chain fprb is selected since
it results in less instructions then having to narrow scalar s64 to s32.
For s32 both gprb and fprb result in same number of instructions and
gprb is selected like a general purpose option.

At the moment we always avoid cross register bank copies.
TODO: Implement a model for costs calculations of different mappings
on same instruction and cross bank copies. Allow cross bank copies
when appropriate according to cost model.

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

llvm-svn: 365743
2019-07-11 09:22:49 +00:00
Haojian Wu e6695821e5 Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."
This reverts r365675 (git commit 43d75f9778)

The patch causes a crash in SupportTests (CommandLineTest.AliasesWithArguments).

llvm-svn: 365742
2019-07-11 08:54:28 +00:00
Jay Foad c1b7db9eda Remove some redundant code from r290372 and improve a comment.
llvm-svn: 365741
2019-07-11 08:49:52 +00:00
Sam Parker 85ad78b1cf [ARM][ParallelDSP] Change the search for smlads
Two functional changes have been made here:
- Now search up from any add instruction to find the chains of
  operations that we may turn into a smlad. This allows the
  generation of a smlad which doesn't accumulate into a phi.
- The search function has been corrected to stop it falsely searching
  up through an invalid path.
    
The bulk of the changes have been making the Reduction struct a class
and making it more C++y with getters and setters.

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

llvm-svn: 365740
2019-07-11 07:47:50 +00:00
Petr Hosek 274ad9c371 [ASan] Use __sanitizer_fill_shadow for FastPoisonShadow on Fuchsia
This is the optimized implementation for Fuchsia provided by the libc.

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

llvm-svn: 365739
2019-07-11 07:30:11 +00:00
Mikael Holmen 7618b2a5c2 [test] Silence gcc 7.4 warning [NFC]
Without this gcc 7.4.0 complains with
 ../unittests/Analysis/ValueTrackingTest.cpp:937:66: error: ISO C++11 requires at least one argument for the "..." in a variadic macro [-Werror]
                          ::testing::ValuesIn(IsBytewiseValueTests));
                                                                   ^

llvm-svn: 365738
2019-07-11 07:07:23 +00:00
Rui Ueyama 77565f7690 Fix build breakage on Win32.
llvm-svn: 365737
2019-07-11 06:56:44 +00:00
Mikael Holmen c593f5e671 [clang-doc] Silence compiler warning with gcc 7.4 [NFC]
Without the fix gcc 7.4.0 complains with

/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'llvm::SmallString<16> clang::doc::{anonymous}::HTMLTag::ToString() const':
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:165:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'bool clang::doc::{anonymous}::HTMLTag::HasInlineChildren() const':
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:142:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'bool clang::doc::{anonymous}::HTMLTag::IsSelfClosing() const':
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:126:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors

llvm-svn: 365736
2019-07-11 06:50:10 +00:00
Kamil Rytarowski 983d7ddd0b Add NetBSD LSan support
Summary:
Combine few relatively small changes into one:

 - implement internal_ptrace() and internal_clone() for NetBSD
 - add support for stoptheworld based on the ptrace(2) API
 - define COMPILER_RT_HAS_LSAN for NetBSD
 - enable tests for NetBSD/amd64

Inspired by the original implementation by Christos Zoulas in netbsd/src for GCC.

The implementation is in theory CPU independent through well defined macros
across all NetBSD ports, however only the x86_64 version was tested.

Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb

Reviewed By: vitalybuka

Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos

Tags: #llvm

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

llvm-svn: 365735
2019-07-11 06:22:35 +00:00
Rui Ueyama f4954b52e4 Fix build breakage on Darwin.
llvm-svn: 365734
2019-07-11 06:12:18 +00:00
Rui Ueyama bfaf64ae57 Update comments for r365730. NFC.
llvm-svn: 365733
2019-07-11 06:08:54 +00:00
Rui Ueyama 76c3f6cdff Fix build breakage on Win32.
llvm-svn: 365732
2019-07-11 06:00:40 +00:00
Heejin Ahn 54c136bbdf [WebAssembly] Print error message for llvm.clear_cache intrinsic
Summary:
Wasm does not currently support `llvm.clear_cache` intrinsic, and this
prints a proper error message instead of segfault.

Reviewers: dschuff, sbc100, sunfish

Subscribers: jgravelle-google, llvm-commits

Tags: #llvm

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

llvm-svn: 365731
2019-07-11 05:55:47 +00:00
Rui Ueyama 136d27ab4d [Coding style change][lld] Rename variables for non-ELF ports
This patch does the same thing as r365595 to other subdirectories,
which completes the naming style change for the entire lld directory.

With this, the naming style conversion is complete for lld.

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

llvm-svn: 365730
2019-07-11 05:40:30 +00:00
Huihui Zhang 51f5079191 [InstCombine][NFCI] Add test coverage to onehot_merge.ll
Prep work for upcoming patch D64275.

llvm-svn: 365729
2019-07-11 04:56:37 +00:00
Richard Trieu 9066e5f832 Increase the number of parser diagnostics.
The reserved range for parser diagnostics is getting close to being filled,
so increase the space for them.

llvm-svn: 365727
2019-07-11 02:54:15 +00:00
Chen Zheng 627095ec5b [SCEV] teach SCEV symbolical execution about overflow intrinsics folding.
Differential Revision: https://reviews.llvm.org/D64422

llvm-svn: 365726
2019-07-11 02:18:22 +00:00
Nico Weber e837847ec6 Change another test I missed in r365724
llvm-svn: 365725
2019-07-11 01:21:17 +00:00
Nico Weber da233838c9 clang-cl: Remove -O0 option
cl.exe doesn't understand it; there's /Od instead. See also the review
thread for r229575.

Update lots of compiler-rt tests to use -Od instead of -O0.
Ran `rg -l 'clang_cl.*O0' compiler-rt/test/ | xargs sed -i -c 's/-O0/-Od/'`

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

llvm-svn: 365724
2019-07-11 01:18:05 +00:00
Johannes Doerfert 3ed286a388 Replace three "strip & accumulate" implementations with a single one
This patch replaces the three almost identical "strip & accumulate"
implementations for constant pointer offsets with a single one,
combining the respective functionalities. The old interfaces are kept
for now.

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

llvm-svn: 365723
2019-07-11 01:14:48 +00:00
Johannes Doerfert 24830ea710 [NFC] Adjust "invalid.ll.bc" tests to check for AttrKind #255 not #63
We are about to add enum attributes with AttrKind numbers >= 63. This
means we cannot use AttrKind #63 to test for an invalid attribute number
in the RAW format anymore. This patch changes the number of an invalid
attribute to #255. There is no change to the character of the tests.

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

llvm-svn: 365722
2019-07-11 01:14:30 +00:00
Nico Weber 6765aa552a Various minor tweaks to CLCompatOptions.td
- Add back indentation I accidentally removed in r364901
- Wrap two lines to 80 cols
- Slightly tighten up help text for several flags
- Consistently use "Do not" instead of "Don't"
- Make every option description start with a verb
- Use "Set" instead of "Specify"
- Mark default values of options more consistently
- Remove text about "/Zi" not producing PDBs since it's confusing
  for people not intimately familiar with the implementation of
  the normal PDB pipeline. /Zi lets the linker produce PDBs, which
  is what most users want.
- Consistently use "file" over "filename" in meta var names,
  consistently use "file name" over "filename" in text
- Make all output setting options have consistent language

llvm-svn: 365721
2019-07-11 01:13:38 +00:00
Craig Topper 88729e3dec [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass.
We use the functions that convert to three address to do the
conversion, but changing an 8 or 16 bit will cause it to create
a virtual register. This can't be done after register allocation
where this pass runs.

I've switched the pass completely to a white list of instructions
that can be converted to LEA instead of a blacklist that was
incorrect. This will avoid surprises if we enhance the three
address conversion function to include additional instructions
in the future.

Fixes PR42565.

llvm-svn: 365720
2019-07-11 01:01:39 +00:00
Raphael Isemann df9051e7cf [lldb] Disable TestDollarInVariable.py on Windows
It seems on Windows we don't handle the lldb_expr_result variable correctly:

```
AssertionError: False is not True : 'expr $__lldb_expr_result' returns expected result, got '(int &) $0 = 0x0000000000000000'
```

I'll disable the test until I can find a way to debug this on Windows.

llvm-svn: 365719
2019-07-11 00:35:31 +00:00
Jonas Devlieghere 597dc0061f [swig] Add workaround for old swig
Apparently, when using swig 1.3.40, properties to set values do not work
without the `__swig_setmethods__` workaround. I conditionally added this
back for SBTypeCategory, as it's causing a test failure on GreenDragon,
while I investigate this further.

llvm-svn: 365718
2019-07-11 00:12:59 +00:00
Stanislav Mekhanoshin e93279fd1b [AMDGPU] gfx908 atomic fadd and atomic pk_fadd
Differential Revision: https://reviews.llvm.org/D64435

llvm-svn: 365717
2019-07-11 00:10:17 +00:00
Vedant Kumar 31c4d2a40d [CGDebugInfo] Fix -femit-debug-entry-values crash on os_log_helpers
An os_log_helper FunctionDecl may not have a body. Ignore these for the
purposes of debug entry value emission.

Fixes an assertion failure seen in a stage2 build of clang:

Assertion failed: (FD->hasBody() && "Functions must have body here"),
function analyzeParametersModification

llvm-svn: 365716
2019-07-11 00:09:16 +00:00
Stanislav Mekhanoshin c0ae1be066 [AMDGPU] gfx908 dot instruction support
Differential Revision: https://reviews.llvm.org/D64431

llvm-svn: 365715
2019-07-11 00:00:27 +00:00
Nico Weber 3daf58faa2 Attempt to fix bots after r365703
llvm-svn: 365714
2019-07-10 23:50:16 +00:00
Sterling Augustine 05630a3745 rL365634 adds a unique_ptr<CompilationDatabase> in GobalCompilationDatabase.h:108 but CompilationDatabase is only forward declared. This makes the header not compile standalone, because unique_ptrs expect to have the full-definition of the...
Summary:
...template argument.

Remove the forward declaration and include the appropriate header instead.
Remove CompileCommand too, which is also in the header.

llvm-svn: 365713
2019-07-10 23:38:00 +00:00
Jordan Rupprecht 77d3590a87 Revert [llvm-objcopy] Allow strip symtab from executables and DSOs
This reverts r365193 (git commit 194f16b354)

This patch doesn't work with binaries built w/ `--emit-relocs`, e.g.

```
$ echo 'int main() { return 0; }' | clang -Wl,--emit-relocs -x c - -o foo && llvm-objcopy --strip-unneeded foo
llvm-objcopy: error: 'foo': not stripping symbol '__gmon_start__' because it is named in a relocation
```

llvm-svn: 365712
2019-07-10 23:32:44 +00:00
Sanjay Patel 138328e45c [SDAG] commute setcc operands to match a subtract
If we have:

R = sub X, Y
P = cmp Y, X

...then flipping the operands in the compare instruction can allow using a subtract that sets compare flags.

Motivated by diffs in D58875 - not sure if this changes anything there,
but this seems like a good thing independent of that.

There's a more involved version of this transform already in IR (in instcombine
although that seems misplaced to me) - see "swapMayExposeCSEOpportunities()".

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

llvm-svn: 365711
2019-07-10 23:23:54 +00:00
Vitaly Buka 329d15b5df Add IsBytewiseValue unit test
Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 365710
2019-07-10 22:56:15 +00:00
Vitaly Buka d03bd1db59 NFC: Pass DataLayout into isBytewiseValue
Summary:
We will need to handle IntToPtr which I will submit in a separate patch as it's
not going to be NFC.

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 365709
2019-07-10 22:53:52 +00:00
Vitaly Buka e72676657f NFC: Convert large lambda into method
Reviewers: pcc, eugenis

Reviewed By: eugenis

Subscribers: cfe-commits, lldb-commits

Tags: #clang, #lldb

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

llvm-svn: 365708
2019-07-10 22:53:50 +00:00
Julian Lettner 6a155f52bc [TSan] Fix linker error on Linux/AArch64
llvm-svn: 365707
2019-07-10 22:50:07 +00:00
Vitaly Buka e26398849d GodeGen, NFC: Add test to track emitStoresForConstant behavior
Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 365706
2019-07-10 22:47:07 +00:00
Craig Topper 1c327c7e0a [X86] Add patterns with and_flag_nocf for BLSI and TBM instructions.
Fixes similar issues to r352306.

llvm-svn: 365705
2019-07-10 22:44:32 +00:00
Craig Topper 472ad62b70 [X86] Add a few more TBM and BLSI test cases that show the same issue that r352306 fixed for BLSR.
llvm-svn: 365704
2019-07-10 22:44:24 +00:00
Nico Weber 101c1afdfd driver: Don't warn about assembler flags being unused when not assembling
clang currently warns when passing flags for the assembler (e.g.
-Wa,-mbig-obj) to an invocation that doesn't run the assembler (e.g.
-E).

At first sight, that makes sense -- the flag really is unused. But many
other flags don't have an effect if no assembler runs (e.g.
-fno-integrated-as, -ffunction-sections, and many others), and those
currently don't warn. So this seems more like a side effect of how
CollectArgsForIntegratedAssembler() is implemented than like an
intentional feature.

Since it's a bit inconvenient when debugging builds and adding -E,
always call CollectArgsForIntegratedAssembler() to make sure assembler
args always get claimed. Currently, this affects only these flags:
-mincremental-linker-compatible, -mimplicit-it= (on ARM), -Wa, -Xassembler

It does have the side effect that assembler options now need to be valid
even if -E is passed. Previously, `-Wa,-mbig-obj` would error for
non-coff output only if the assembler ran, now it always errors. This
too makes assembler flags more consistent with all the other flags and
seems like a progression.

Fixes PR42066.

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

llvm-svn: 365703
2019-07-10 22:29:35 +00:00
Craig Topper d916f23b83 [X86] Add BLSR and BLSMSK to isUseDefConvertible.
Unfortunately subo formation in CGP prevents obvious ways of
testing this.

But we already have BLSI in here and the flag behavior is
well understood.

Might become more useful if we improve PR42571.

llvm-svn: 365702
2019-07-10 22:14:39 +00:00
David Tenty a2681296e0 [NFC]Fix IR/MC depency issue for function descriptor SDAG implementation
Summary: llvm/IR/GlobalValue.h can't be included in MC, that creates a circular dependency between MC and IR libraries. This circular dependency is causing an issue for build system that enforce layering.

Author: Xiangling_L

Reviewers: sfertile, jasonliu, hubert.reinterpretcast, gribozavr

Reviewed By: gribozavr

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 365701
2019-07-10 22:13:55 +00:00
Alex Lorenz 9a6c17b5b8 [clang-scan-deps] Dependency directives source minimizer:
single quotes are not digit separators after a valid character literal prefix

The single quote character can act as a c++ digit separator.
However, the minimizer shouldn't treat it as such when it's actually following
a valid character literal prefix, like L, U, u, or u8.

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

llvm-svn: 365700
2019-07-10 22:00:59 +00:00
Saar Raz d7aae33a95 [Concepts] Concept definitions (D40381)
First in a series of patches to land C++2a Concepts support.
This patch adds AST and parsing support for concept-declarations.

llvm-svn: 365699
2019-07-10 21:25:49 +00:00
Raphael Isemann 0171866672 [lldb] Fix handling of dollar characters in expr command
llvm-svn: 365698
2019-07-10 21:04:01 +00:00
Craig Topper 021ba49b31 [X86] Remove unused variable. NFC
llvm-svn: 365697
2019-07-10 21:01:34 +00:00
Alex Langford 461a9d98d7 [Expression] IR Instrumenters should have a UtilityFunction
Right now, IR Instrumenters take a DynamicCheckerFunctions object which
has all the UtilityFunctions used to instrument IR for expressions.
However, each Instrumenter (in practice) uses exactly one
UtilityFunction, so let's change the abstraction.

llvm-svn: 365696
2019-07-10 20:41:36 +00:00
Saar Raz cbe3ed17fa My first test commit.
llvm-svn: 365695
2019-07-10 20:01:44 +00:00
Roman Lebedev 61cc6df5dc [NFC][InstCombine] Comb through just-added "omit mask before left-shift" tests once more
llvm-svn: 365694
2019-07-10 19:58:13 +00:00