Simon Pilgrim [Fri, 12 Jul 2019 17:42:32 +0000 (17:42 +0000)]
[X86][AVX] Add PR34359 shuffle test case.
llvm-svn: 365926
Stefan Stipanovic [Fri, 12 Jul 2019 17:42:14 +0000 (17:42 +0000)]
[Attributor] Removing unnecessary `virtual` keywords.
Some function in the Attributor framework are unnecessarily
marked virtual. This patch removes virtual keyword
Reviewers: jdoerfert
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D64637
llvm-svn: 365925
Hideto Ueno [Fri, 12 Jul 2019 17:38:51 +0000 (17:38 +0000)]
[Attributor] Deduce "nofree" function attribute
Summary: Deduce "nofree" function attribute. A more concise description of "nofree" is on D49165.
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: homerdin, hfinkel, lebedev.ri, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62687
llvm-svn: 365924
Louis Dionne [Fri, 12 Jul 2019 17:30:57 +0000 (17:30 +0000)]
[libc++] Add XFAILs for CTAD tests on older compilers
llvm-svn: 365923
Shoaib Meenai [Fri, 12 Jul 2019 17:23:35 +0000 (17:23 +0000)]
Revert [clang-shlib] Fix clang-shlib for PRIVATE dependencies
This reverts r365825 (git commit
3173c60f96c3ccfc17d403a192ae58e720153c23)
This is breaking BUILD_SHARED_LIBS=ON builds. Reverting while I rethink it.
llvm-svn: 365922
Vitaly Buka [Fri, 12 Jul 2019 17:21:55 +0000 (17:21 +0000)]
CodeGet: Init 32bit pointers with 0xFFFFFFFF
Summary:
Patch makes D63967 effective for 32bit platforms and improves pattern
initialization there. It cuts size of 32bit binary compiled with
-ftrivial-auto-var-init=pattern by 2% (3% with -Os).
Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options)
```
master patch diff
Os pattern 7.915580e+05 7.698424e+05 -0.028387
O3 pattern 9.953688e+05 9.752952e+05 -0.019325
```
Zero vs Pattern on master
```
zero pattern diff
Os 7.689712e+05 7.915580e+05 0.031380
O3 9.744796e+05 9.953688e+05 0.021133
```
Zero vs Pattern with the patch
```
zero pattern diff
Os 7.689712e+05 7.698424e+05 0.000789
O3 9.744796e+05 9.752952e+05 0.000742
```
Reviewers: pcc, eugenis, glider, jfb
Reviewed By: jfb
Subscribers: hubert.reinterpretcast, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64597
llvm-svn: 365921
Philip Reames [Fri, 12 Jul 2019 17:05:35 +0000 (17:05 +0000)]
[IndVars] Use exit count reasoning to discharge obviously untaken exits
Continue in the spirit of D63618, and use exit count reasoning to prove away loop exits which can not be taken since the backedge taken count of the loop as a whole is provably less than the minimal BE count required to take this particular loop exit.
As demonstrated in the newly added tests, this triggers in a number of cases where IndVars was previously unable to discharge obviously redundant exit tests. And some not so obvious ones.
Differential Revision: https://reviews.llvm.org/D63733
llvm-svn: 365920
Aaron Ballman [Fri, 12 Jul 2019 16:53:57 +0000 (16:53 +0000)]
Dump actual line numbers when dumping the AST to JSON.
The "line" attribute is now the physical line within the source file for the location. A "presumedLine" attribute is printed when the presumed line number does not match the given source line number. We continue to not print repeated line information in subsequent source locations, but we track presumed and actual lines separately.
llvm-svn: 365919
James Y Knight [Fri, 12 Jul 2019 16:41:28 +0000 (16:41 +0000)]
Fix some minor coding-style issues in git-llvm.
llvm-svn: 365918
James Y Knight [Fri, 12 Jul 2019 16:40:46 +0000 (16:40 +0000)]
Allow the 'git-llvm' tool to push to svn from the split repositories
for 'test-suite', 'lnt', 'zorg', and 'www'.
This is done by looking at the pathname of the git remote named
'origin', which is not 100% reliable, but should work in most cases.
llvm-svn: 365917
Hideto Ueno [Fri, 12 Jul 2019 16:29:14 +0000 (16:29 +0000)]
[FunctionAttrs] Add a test for "nofree" function attribute
This patch adds a test for nofree function attribute.
llvm-svn: 365916
Fangrui Song [Fri, 12 Jul 2019 16:23:25 +0000 (16:23 +0000)]
[Support] Move the static initializer install_out_memory_new_handler to InitLLVM
An application linking against LLVMSupport should not get the gratuitous
set::std_new_handler call.
Reviewed By: jfb
Differential Revision: https://reviews.llvm.org/D64505
llvm-svn: 365915
Simon Pilgrim [Fri, 12 Jul 2019 16:16:23 +0000 (16:16 +0000)]
Add missing <atomic> include to appease MSVC builds.
llvm-svn: 365914
Artem Belevich [Fri, 12 Jul 2019 16:13:29 +0000 (16:13 +0000)]
Minor cleanup.
Simplify things a bit by removing unnecessary full type qualification.
This also happens to avoid a build break with now-unsupported
Visual Studio 2015.
Differential Review: https://reviews.llvm.org/D64588
llvm-svn: 365913
Hideto Ueno [Fri, 12 Jul 2019 16:08:32 +0000 (16:08 +0000)]
Test commit
llvm-svn: 365912
Jordan Rose [Fri, 12 Jul 2019 16:05:09 +0000 (16:05 +0000)]
Support for dumping current PrettyStackTrace on SIGINFO (Ctrl-T)
Support SIGINFO (and SIGUSR1 for POSIX purposes) to tell what
long-running jobs are doing, as inspired by BSD tools (including on
macOS), by dumping the current PrettyStackTrace.
This adds a new kind of signal handler for non-fatal "info" signals,
similar to the "interrupt" handler that already exists for SIGINT
(Ctrl-C). It then uses that handler to update a "generation count"
managed by the PrettyStackTrace infrastructure, which is then checked
whenever a PrettyStackTraceEntry is pushed or popped on each
thread. If the generation has changed---i.e. if the user has pressed
Ctrl-T---the stack trace is dumped, though unfortunately it can't
include the deepest entry because that one is currently being
constructed/destructed.
https://reviews.llvm.org/D63750
llvm-svn: 365911
Jay Foad [Fri, 12 Jul 2019 15:59:40 +0000 (15:59 +0000)]
[AMDGPU] Fix DPP combiner check for exec modification
Summary:
r363675 changed the exec modification helper function, now called
execMayBeModifiedBeforeUse, so that if no UseMI is specified it checks
all instructions in the basic block, even beyond the last use. That
meant that the DPP combiner no longer worked in any basic block that
ended with a control flow instruction, and in particular it didn't work
on code sequences generated by the atomic optimizer.
Fix it by reinstating the old behaviour but in a new helper function
execMayBeModifiedBeforeAnyUse, and limiting the number of instructions
scanned.
Reviewers: arsenm, vpykhtin
Subscribers: kzhuravl, nemanjai, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kbarton, MaskRay, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64393
llvm-svn: 365910
Rafael Stahl [Fri, 12 Jul 2019 15:56:18 +0000 (15:56 +0000)]
[clang-format][tests] Explicitly specify style in some tests
Summary: This fixes broken tests when doing an out-of-source build that picks up a random .clang-format on the file system due to the default "file" style.
Reviewers: djasper, klimek, MyDeveloperDay, krasimir
Reviewed By: MyDeveloperDay
Subscribers: lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61001
llvm-svn: 365909
Raphael Isemann [Fri, 12 Jul 2019 15:30:55 +0000 (15:30 +0000)]
[lldb] Let table gen create command option initializers.
Summary:
We currently have man large arrays containing initializers for our command options.
These tables are tricky maintain as we don't have any good place to check them for consistency and
it's also hard to read (`nullptr, {}, 0` is not very descriptive).
This patch fixes this by letting table gen generate those tables. This way we can have a more readable
syntax for this (especially for all the default arguments) and we can let TableCheck check them
for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.).
Also refactoring the related data structures can now be done without changing the hundred of option initializers.
For example, this line:
```
{LLDB_OPT_SET_ALL, false, "hide-aliases", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."},
```
becomes this:
```
def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">;
```
For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other
option initializers tables in separate patches.
Reviewers: JDevlieghere, davide, sgraenitz
Reviewed By: JDevlieghere
Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64365
llvm-svn: 365908
Fangrui Song [Fri, 12 Jul 2019 15:18:29 +0000 (15:18 +0000)]
[LegacyPassManager] Small ModuleCount cleanup
llvm-svn: 365907
Russell Gallop [Fri, 12 Jul 2019 15:15:56 +0000 (15:15 +0000)]
Revert "[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands."
New test is failing on Windows bot
This reverts commit
9c0391b36a76f8e3949588de3f44b7314c2318bf.
llvm-svn: 365906
Tom Stellard [Fri, 12 Jul 2019 15:11:28 +0000 (15:11 +0000)]
cmake: Fix install of libclang-cpp.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON
Summary:
If CLANG_LINK_CLANG_DYLIB is also enabled, then this library needs to be
installed.
Fixes PR42575.
Reviewers: beanz, smeenai
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64582
Conflicts:
clang/tools/clang-shlib/CMakeLists.txt
llvm-svn: 365905
Jay Foad [Fri, 12 Jul 2019 15:02:59 +0000 (15:02 +0000)]
[AMDGPU] Restrict v_cndmask_b32 abs/neg modifiers to f32
Summary:
D64497 allowed abs/neg source modifiers on v_cndmask_b32 but it doesn't
make any sense to apply them to f16 operands; they would interpret the
bits of the value as an f32, giving nonsensical results. This patch
restricts them to f32 operands.
Reviewers: arsenm, hakzsam
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64636
llvm-svn: 365904
Fangrui Song [Fri, 12 Jul 2019 14:58:15 +0000 (14:58 +0000)]
Delete dead stores
llvm-svn: 365903
Tom Stellard [Fri, 12 Jul 2019 14:40:18 +0000 (14:40 +0000)]
cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros
Summary:
This will simplify the macros by allowing us to remove the hard-coded
list of libraries that should be installed when
LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.
Reviewers: beanz, smeenai
Reviewed By: beanz
Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64580
llvm-svn: 365902
Fangrui Song [Fri, 12 Jul 2019 14:04:34 +0000 (14:04 +0000)]
Delete dead stores
llvm-svn: 365901
Aaron Ballman [Fri, 12 Jul 2019 13:57:41 +0000 (13:57 +0000)]
Dump floating-point values as strings when dumping to JSON.
This fixes a bug where we would have an invalid JSON attribute (e.g., "value": inf). It also increases the precision of the values because they're not represented as approximate doubles with the host architecture's floating-point model.
llvm-svn: 365900
Russell Gallop [Fri, 12 Jul 2019 13:35:58 +0000 (13:35 +0000)]
Revert "[clangd] Implement typeHierarchy/resolve for subtypes"
Causing test failure on Windows bot
This reverts commit
5b9484e559d44bd923fc290e335891b1dd2e17c4.
llvm-svn: 365899
Fangrui Song [Fri, 12 Jul 2019 13:21:58 +0000 (13:21 +0000)]
[Driver] Delete dead code
llvm-svn: 365898
Bryant Wong [Fri, 12 Jul 2019 13:09:39 +0000 (13:09 +0000)]
[gn] Tag unneeded variable.
When only building targets without assembly parsers (e.g. `llvm_targets_to_build
= ["NVPTX"]`), `all_targets` is empty and causes GN to warn about an
assigned-but-unused variable.
Differential Revision: https://reviews.llvm.org/D31727
llvm-svn: 365897
Simon Pilgrim [Fri, 12 Jul 2019 13:00:35 +0000 (13:00 +0000)]
[DAGCombine] narrowExtractedVectorBinOp - wrap subvector extraction in helper. NFCI.
First step towards supporting 'free' subvector extractions other than concat_vectors.
llvm-svn: 365896
Alexey Bader [Fri, 12 Jul 2019 12:48:43 +0000 (12:48 +0000)]
[LIT] Emit timeout error message only if timeout was reached
Summary:
This improves readability of LIT output: previously
error messages gets emitted that say that there was no error:
error: command reached timeout: False
Patch by Alexey Sachkov.
Reviewers: ddunbar, mgorny, modocache
Reviewed By: mgorny
Subscribers: delcypher, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64240
llvm-svn: 365895
Shaurya Gupta [Fri, 12 Jul 2019 11:42:31 +0000 (11:42 +0000)]
[clangd] Fixed toHalfOpenFileRange
Summary:
- Fixed toHalfOpenFileRange to work for macros as well as template
instantiations
- Added unit tests
Breaking test case for older version of toHalfOpenFileRange:
\# define FOO(X) X++
int a = 1;
int b = FOO(a);
toHalfOpenFileRange for the sourceRange of VarDecl for b returned the
wrong Range.
Reviewers: sammccall, kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64562
llvm-svn: 365894
David Bolvansky [Fri, 12 Jul 2019 11:31:16 +0000 (11:31 +0000)]
[InstCombine] Fold select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y) to ashr (X, Y))
Summary:
(select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y)) -> ashr (X, Y))
(select (icmp slt x, 1), ashr (X, Y), lshr (X, Y)) -> ashr (X, Y))
Fixes PR41173
Alive proof by @lebedev.ri (thanks)
Name: PR41173
%cmp = icmp slt i32 %x, 1
%shr = lshr i32 %x, %y
%shr1 = ashr i32 %x, %y
%retval.0 = select i1 %cmp, i32 %shr1, i32 %shr
=>
%retval.0 = ashr i32 %x, %y
Optimization: PR41173
Done: 1
Optimization is correct!
Reviewers: lebedev.ri, spatel
Reviewed By: lebedev.ri
Subscribers: nikic, craig.topper, llvm-commits, lebedev.ri
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64285
llvm-svn: 365893
Alex Brachet [Fri, 12 Jul 2019 10:44:06 +0000 (10:44 +0000)]
Fix test case of llvm-nm using implicit a.out
llvm-svn: 365892
George Rimar [Fri, 12 Jul 2019 10:29:29 +0000 (10:29 +0000)]
[test/Object, obj2yaml] - Move test cases from test/Object and cleanup.
test/Object is not correct place to have tests that check obj2yaml
functionality, because we have test/tools/obj2yaml folder for that.
In this patch I merged a few test cases with their YAMLs from Inputs
folder, converted one of binary inputs and moved them to
tools/obj2yaml folder.
There are still another tests that might need the same, so it is initial step.
Differential revision: https://reviews.llvm.org/D64555
llvm-svn: 365891
Jonas Hahnfeld [Fri, 12 Jul 2019 10:21:55 +0000 (10:21 +0000)]
[libomptarget] Fix typos and grammar in error messages, NFC.
llvm-svn: 365890
Alex Brachet [Fri, 12 Jul 2019 10:20:01 +0000 (10:20 +0000)]
[tools] [llvm-nm] Default to reading from stdin not a.out
Summary: This moves away from defaulting to a.out and uses stdin only if stdin has a file redirected to it. This has been discussed on the llvm-dev mailing list [[ https://lists.llvm.org/pipermail/llvm-dev/2019-July/133642.html | here ]].
Reviewers: jhenderson, rupprecht, MaskRay, chrisjackson
Reviewed By: jhenderson, MaskRay
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64290
llvm-svn: 365889
Sam McCall [Fri, 12 Jul 2019 10:18:42 +0000 (10:18 +0000)]
[clangd] Prioritize indexing of files that share a basename with the open file.
Summary:
In practice, opening Foo.h will still often result in Foo.cpp making the
second index build instead of the first, as the rebuild policy doesn't
know to wait.
Reviewers: kadircet
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64575
llvm-svn: 365888
Sam McCall [Fri, 12 Jul 2019 10:11:40 +0000 (10:11 +0000)]
[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.
Summary:
It's common to use compiler wrappers by setting CC="gomacc clang++".
This results in both args appearing in compile_commands.json, and clang's driver
can't handle this.
This patch attempts to recognize this pattern (by looking for well-known
wrappers) and dropping argv0 in this case.
It conservatively ignores other cases for now:
- wrappers with unknown names
- wrappers that accept -flags
- wrappers where the compiler to use is implied (usually cc or gcc)
This is done at the JSONCompilationDatabase level rather than somewhere more
fundamental, as (hopefully) this isn't a general conceptual problem, but a messy
aspect of the nature of the ecosystem around compile_commands.json.
i.e. compilation databases more tightly tied to the build system should not have
this problem.
Reviewers: phosek, klimek
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64297
llvm-svn: 365887
Djordje Todorovic [Fri, 12 Jul 2019 09:45:12 +0000 (09:45 +0000)]
Revert "[DwarfDebug] Dump call site debug info"
A build failure was found on the SystemZ platform.
This reverts commit
9e7e73578e54cd22b3c7af4b54274d743b6607cc.
llvm-svn: 365886
Haojian Wu [Fri, 12 Jul 2019 09:38:53 +0000 (09:38 +0000)]
[clangd] Move the expandAuto tweak from global namespace into annoymous namespace.
llvm-svn: 365885
George Rimar [Fri, 12 Jul 2019 09:29:12 +0000 (09:29 +0000)]
[Object/ELF] - Improve error reporting for notes.
This patch improves the error messages reported for
note sections and phdrs and also makes a cleanup for
existent test case.
Differential revision: https://reviews.llvm.org/D64470
llvm-svn: 365884
Kai Luo [Fri, 12 Jul 2019 09:10:35 +0000 (09:10 +0000)]
[NFC][PowerPC] Added test for MachinePRE.
llvm-svn: 365883
Haojian Wu [Fri, 12 Jul 2019 08:50:20 +0000 (08:50 +0000)]
[clangd] Don't run the prepare for tweaks that are disabled.
Summary: Previously, we ran the prepare, even for the tweaks that are disabled.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64565
llvm-svn: 365882
Sam Elliott [Fri, 12 Jul 2019 08:36:07 +0000 (08:36 +0000)]
[RISCV] Allow parsing dot '.' in assembly
Summary:
Useful for jumps, such as `j .`.
I am not sure who should review this. Do not hesitate to change the reviewers if needed.
Reviewers: asb, jrtc27, lenary
Reviewed By: lenary
Subscribers: MaskRay, lenary, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63669
Patch by John LLVM (JohnLLVM)
llvm-svn: 365881
Rainer Orth [Fri, 12 Jul 2019 08:30:17 +0000 (08:30 +0000)]
Enable compiler-rt on SPARC
This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward:
- Add 32 and 64-bit sparc to compiler-rt
- lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc)
There's one issue of note: many asan tests fail to compile on Solaris/SPARC:
fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported.
Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The
goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc,
which doesn't have the problem above and works just fine.
With this patch, sparcv9-sun-solaris2.11 test results are pretty good:
Failing Tests (9):
Builtins-sparc-sunos :: divtc3_test.c
Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c
Builtins-sparcv9-sunos :: divtc3_test.c
[...]
UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp
UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp
The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal
patches either currently in review or about to be submitted.
Tested on sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D40943
llvm-svn: 365880
Rainer Orth [Fri, 12 Jul 2019 08:27:50 +0000 (08:27 +0000)]
[Sanitizers] Fix SanitizerCommon-Unit :: ./Sanitizer-*-Test/MemoryMappingLayout.DumpListOfModules on Solaris
The MemoryMappingLayout.DumpListOfModules currently FAILs on Solaris:
[ RUN ] MemoryMappingLayout.DumpListOfModules
/vol/llvm/src/compiler-rt/local/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc:52: Failure
Value of: found
Actual: false
Expected: true
[ FAILED ] MemoryMappingLayout.DumpListOfModules (22 ms)
The problem is that the test expects the executable name from modules[i].full_name(),
however the pr_mapname field of struct prmap is just the entry in /proc/<pid>/object,
which is "a.out" instead of "Sanitizer-i386-Test". Fortunately, the real name can
be determined by looking in proc/<pid>/path where "a.out" is a symlink to the
real path.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64559
llvm-svn: 365879
Bryant Wong [Fri, 12 Jul 2019 08:25:59 +0000 (08:25 +0000)]
Test commit. NFC.
Formatting fix.
llvm-svn: 365878
Fangrui Song [Fri, 12 Jul 2019 06:46:47 +0000 (06:46 +0000)]
[Driver] Delete --no-add-needed for RHEL7 or newer
This is really not needed. gcc driver doesn't add this option.
BTW, since binutils 2.22, --no-copy-dt-needed-entries (new name of
--no-add-needed) is the default.
llvm-svn: 365877
Fangrui Song [Fri, 12 Jul 2019 06:23:24 +0000 (06:23 +0000)]
[YAMLIO] Wrap explicit specialization in llvm::yaml to appease build bots
llvm-svn: 365876
Rui Ueyama [Fri, 12 Jul 2019 06:12:27 +0000 (06:12 +0000)]
Fix odd variable names.
llvm-svn: 365875
Fangrui Song [Fri, 12 Jul 2019 06:01:37 +0000 (06:01 +0000)]
[test] Delete trailing spaces from YAML tests after D65566/r365869
llvm-svn: 365874
Fangrui Song [Fri, 12 Jul 2019 05:59:28 +0000 (05:59 +0000)]
[test] Delete trailing spaces from YAML tests
llvm-svn: 365873
Fangrui Song [Fri, 12 Jul 2019 05:51:36 +0000 (05:51 +0000)]
test/Driver/fsanitize.c: delete -target x86_64-linux-gnu from tests that should always be available
Follow-up of D64317/r365587.
llvm-svn: 365872
Stanislav Mekhanoshin [Fri, 12 Jul 2019 05:13:10 +0000 (05:13 +0000)]
[AMDGPU] Fixed comment. NFC.
llvm-svn: 365871
Simon Atanasyan [Fri, 12 Jul 2019 04:58:45 +0000 (04:58 +0000)]
[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6
There is not match for the `MipsJmpLink texternalsym` and `MipsJmpLink
tglobaladdr` patterns for microMIPS R6. As a result LLVM incorrectly
selects the `JALRC16` compact 2-byte instruction which takes a target
instruction address from a register only and assign `R_MIPS_32` relocation
for this instruction. This relocation completely overwrites `JALRC16`
and nearby instructions.
This patch adds missed matching patterns, selects `BALC` instruction and
assign a correct `R_MICROMIPS_PC26_S1` relocation.
Differential Revision: https://reviews.llvm.org/D64552
llvm-svn: 365870
Fangrui Song [Fri, 12 Jul 2019 04:51:31 +0000 (04:51 +0000)]
[YAMLIO] Remove trailing spaces when outputting maps
llvm::yaml::Output::paddedKey unconditionally outputs spaces, which
are superfluous if the value to be dumped is a sequence or map.
Change `bool NeedsNewLine` to `StringRef Padding` so that it can be
overridden to `\n` if the value is a sequence or map.
An empty map/sequence is special. It is printed as `{}` or `[]` without
a newline, while a non-empty map/sequence follows a newline. To handle
this distinction, add another variable `PaddingBeforeContainer` and does
the special handling in endMapping/endSequence.
Reviewed By: grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D64566
llvm-svn: 365869
Nathan Lanza [Fri, 12 Jul 2019 04:43:46 +0000 (04:43 +0000)]
[windows] re-call signal in sigint_handler for Windows
Summary:
Windows requires re-setting the signal handler each time it is used
and thus ctrl-c was not behaving properly on Windows
Reviewers: jfb
Differential Revision: https://reviews.llvm.org/D64046
llvm-svn: 365868
Nathan Ridge [Fri, 12 Jul 2019 03:26:32 +0000 (03:26 +0000)]
[clangd] Implement typeHierarchy/resolve for subtypes
Summary:
This allows the client to resolve subtypes one level at a time.
For supertypes, this is not necessary, because we eagerly compute
supertypes and return all levels.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64308
llvm-svn: 365867
Fangrui Song [Fri, 12 Jul 2019 02:32:15 +0000 (02:32 +0000)]
[X86][PowerPC] Support -mlong-double-128
This patch makes the driver option -mlong-double-128 available for X86
and PowerPC. The CC1 option -mlong-double-128 is available on all targets
for users to test on unsupported targets.
On PowerPC, -mlong-double-128 uses the IBM extended double format
because we don't support -mabi=ieeelongdouble yet (D64283).
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D64277
llvm-svn: 365866
Tom Stellard [Fri, 12 Jul 2019 02:31:50 +0000 (02:31 +0000)]
docs/GithubMove.rst: Add link to GitHub migration status page
llvm-svn: 365865
Vitaly Buka [Fri, 12 Jul 2019 02:23:07 +0000 (02:23 +0000)]
Return Undef from isBytewiseValue for empty arrays or structs
Reviewers: pcc, eugenis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64052
llvm-svn: 365864
Artem Dergachev [Fri, 12 Jul 2019 02:16:56 +0000 (02:16 +0000)]
NFC: Unforget a colon in a few CHECK: directives.
Differential Revision: https://reviews.llvm.org/D64526
llvm-svn: 365863
Fangrui Song [Fri, 12 Jul 2019 02:14:08 +0000 (02:14 +0000)]
[PowerPC] Default to -fomit-frame-pointer when optimization is enabled
NetBSD, Linux, CloudABI and Hurd already omit frame pointer for PowerPC.
Make it do so for other platforms.
llvm-svn: 365862
Artem Dergachev [Fri, 12 Jul 2019 02:10:33 +0000 (02:10 +0000)]
[analyzer] exploded-graph-rewriter: Improve source location dumps.
- Correctly display macro expansion and spelling locations.
- Use the same procedure to display location context call site locations.
- Display statement IDs for program points.
llvm-svn: 365861
Fangrui Song [Fri, 12 Jul 2019 02:01:51 +0000 (02:01 +0000)]
[Driver] Refactor interaction between -f(no-)?omit-frame-pointer and -m(no-)?omit-leaf-frame-pointer
Use a tri-state enum to represent shouldUseFramePointer() and
shouldUseLeafFramePointer().
This simplifies the logic and fixes PR9825:
-fno-omit-frame-pointer doesn't imply -mno-omit-leaf-frame-pointer.
and PR24003:
/Oy- /O2 should not omit leaf frame pointer: this matches MSVC x86-32.
(/Oy- is a no-op on MSVC x86-64.)
and:
when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer
can also be omitted.
The new behavior matches GCC:
-fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer
-fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer
The behavior makes lots of sense. We have 4 states:
- 00) leaf retained, non-leaf retained
- 01) leaf retained, non-leaf omitted (this is invalid)
- 10) leaf omitted, non-leaf retained (what -momit-leaf-frame-pointer was designed for)
- 11) leaf omitted, non-leaf omitted
"omit" options taking precedence over "no-omit" options is the only way
to make 3 valid states representable with -f(no-)?omit-frame-pointer and
-m(no-)?omit-leaf-pointer.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D64294
llvm-svn: 365860
Jinsong Ji [Fri, 12 Jul 2019 01:59:42 +0000 (01:59 +0000)]
[MachinePipeliner] Fix order for nodes with Anti dependence in same cycle
Summary:
Problem exposed in PowerPC functional testing.
We did not consider Anti dependence for nodes in same cycle,
so we may end up generating bad machine code.
eg: the reduced test won't verify.
*** Bad machine code: Using an undefined physical register ***
- function: lame_encode_buffer_interleaved
- basic block: %bb.4 (0x4bde4e12928)
- instruction: %29:gprc = ADDZE %27:gprc, implicit-def dead $carry, implicit $carry
- operand 3: implicit $carry
Reviewers: bcahoon, kparzysz, hfinkel
Subscribers: MaskRay, wuzish, nemanjai, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64192
llvm-svn: 365859
Vitaly Buka [Fri, 12 Jul 2019 01:42:03 +0000 (01:42 +0000)]
Handle IntToPtr in isBytewiseValue
Summary:
This helps with more efficient use of memset for pattern initialization
From @pcc prototype for -ftrivial-auto-var-init=pattern optimizations
Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options)
```
master patch diff
Os 8.238864e+05 8.238864e+05 0.0
O3 1.054797e+06 1.054797e+06 0.0
Os zero 8.292384e+05 8.292384e+05 0.0
O3 zero 1.062626e+06 1.062626e+06 0.0
Os pattern 8.579712e+05 8.338048e+05 -0.030299
O3 pattern 1.090502e+06 1.067574e+06 -0.020481
```
Zero vs Pattern on master
```
zero pattern diff
Os 8.292384e+05 8.579712e+05 0.036578
O3 1.062626e+06 1.090502e+06 0.025124
```
Zero vs Pattern with the patch
```
zero pattern diff
Os 8.292384e+05 8.338048e+05 0.003333
O3 1.062626e+06 1.067574e+06 0.003193
```
Reviewers: pcc, eugenis
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D63967
llvm-svn: 365858
Vitaly Buka [Fri, 12 Jul 2019 01:36:11 +0000 (01:36 +0000)]
Codegen, NFC: 32bit test in auto-var-init.cpp
llvm-svn: 365857
Eric Fiselier [Fri, 12 Jul 2019 01:16:08 +0000 (01:16 +0000)]
Mark destroying delete test as UNSUPPORTED with clang 7
llvm-svn: 365856
Eric Fiselier [Fri, 12 Jul 2019 01:13:05 +0000 (01:13 +0000)]
Tolerate import errors in "not.py" implementation
llvm-svn: 365855
Marshall Clow [Fri, 12 Jul 2019 01:01:55 +0000 (01:01 +0000)]
Reorganize the 'bit' header to make most of the facilities available for internal use pre-C++20. NFC for external users
llvm-svn: 365854
Alex Langford [Fri, 12 Jul 2019 00:58:02 +0000 (00:58 +0000)]
[Expression] Move IRDynamicChecks to ClangExpressionParser
Summary:
IRDynamicChecks in its current form is specific to Clang since it deals
with the C language family. It is possible that we may want to
instrument code generated for other languages, but we can factor in a
more general mechanism to do so at a later time.
This decouples ObCLanguageRuntime from Expression!
Reviewers: compnerd, clayborg, jingham, JDevlieghere
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D64591
llvm-svn: 365853
Alex Lorenz [Fri, 12 Jul 2019 00:48:53 +0000 (00:48 +0000)]
NFC: lit: python3 compatibility for functions
usePlatformSdkOnDarwin/findPlatformSdkVersionOnMacOS
These functions should decode subprocess output
llvm-svn: 365852
Evandro Menezes [Fri, 12 Jul 2019 00:33:49 +0000 (00:33 +0000)]
[InstCombine] Reorder pow() transformations (NFC)
Move the transformation from `powf(x, itofp(y))` to `powi(x, y)` to the
group of transformations related to the exponent.
llvm-svn: 365851
Jordan Rupprecht [Fri, 12 Jul 2019 00:32:08 +0000 (00:32 +0000)]
Re-Revert Devirtualize destructor of final class.
This reverts r365509 (git commit
d088720edad9c29ee0d622b5d69092e18a9ac0bd)
This is a second revert[1] due to failures in internal test cases (shared offline) found during more thorough testing.
[1] Original patch commited as r364100, reverted as r364359, recommitted as r365509
llvm-svn: 365850
Nathan Ridge [Fri, 12 Jul 2019 00:24:45 +0000 (00:24 +0000)]
[clangd] Add a missing early return in getTypeHierarchy()
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64307
llvm-svn: 365849
Eric Fiselier [Fri, 12 Jul 2019 00:16:38 +0000 (00:16 +0000)]
Add another buildbot username to the workaround list
llvm-svn: 365848
Eric Fiselier [Fri, 12 Jul 2019 00:02:49 +0000 (00:02 +0000)]
Attempt to override broken buildbot config for libc++abi.
The buildbots were changed to pass -DLIBCXX_CXX_ABI=libcxxabi, but
they don't provide an include path for the library, so cxxabi.h is
never found while building libc++.
This is a temporary change until the buildbots are updated or until
D63883 lands in a form that unbreaks the bots
llvm-svn: 365847
Michael Liao [Thu, 11 Jul 2019 23:53:30 +0000 (23:53 +0000)]
[AMDGPU] Skip calculating callee saved registers for entry function.
Reviewers: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64596
llvm-svn: 365846
Petr Hosek [Thu, 11 Jul 2019 23:49:39 +0000 (23:49 +0000)]
[CMake][Fuchsia] Use RelWithDebInfo to build runtimes
We want to preserve debug info in our runtimes to aid symbolization and
debugging; for shared libraries this will be stripped away during
install-stripped step and distributed via .build-id, for static archives
it's part of the archive and it's a responsibility of the consumer to
strip it away in the final binary if not needed.
Differential Revision: https://reviews.llvm.org/D64605
llvm-svn: 365845
Paul Robinson [Thu, 11 Jul 2019 23:48:06 +0000 (23:48 +0000)]
[clangd] Fix MSVC build failure.
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/26898
llvm-svn: 365844
Alex Langford [Thu, 11 Jul 2019 23:45:35 +0000 (23:45 +0000)]
[Target] Replace Plugin headers with non-plugin headers
llvm-svn: 365843
Matt Arsenault [Thu, 11 Jul 2019 23:42:57 +0000 (23:42 +0000)]
AMDGPU: s_waitcnt field should be treated as unsigned
Also make it an ImmLeaf, so it should work with global isel as well,
which was part of the point of moving it in the first place.
llvm-svn: 365842
Reid Kleckner [Thu, 11 Jul 2019 23:20:04 +0000 (23:20 +0000)]
Use clang driver for libfuzzer tests on Windows
Summary:
There's no real reason to use clang-cl on Windows, the clang driver
works just as well. This fixes a test which uses the -O0 flag, which was
recently removed from clang-cl to match MSVC, which lacks this flag.
While I'm here, remove the explicit -std=c++11 flag. Previously, this
flag was necessary when the default C++ standard was C++98. Now that the
default is C++14, this is no longer necessary. It's problematic on
Windows, because the Visual C++ standard library relies on C++14
features, and attempting to compile it with C++11 results in errors.
Rather than adding logic to conditionally set the standard to C++11 only
on non-Win, this flag can be removed.
See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and
https://reviews.llvm.org/D64506.
Reviewers: morehouse, thakis
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D64587
llvm-svn: 365841
Eric Fiselier [Thu, 11 Jul 2019 23:13:38 +0000 (23:13 +0000)]
Fix memory leak in set and map.
When assigning an initializer list into set/map, libc++ would
leak memory if the initializer list contained equivalent keys
because we failed to check if the insertion was successful.
llvm-svn: 365840
Petr Hosek [Thu, 11 Jul 2019 22:59:23 +0000 (22:59 +0000)]
[sancov] Ignore PC samples with value 0
The sancov runtime for the (Fuchsia) Zircon kernel delivers results
in the standard format, but as the full array of possible samples
with 0 in uncovered slots. That runtime delivers "live" data and
has no final "export" pass to compactify out the uncovered slots,
and it seems silly to require another offline tool just for that.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D63695
llvm-svn: 365839
Leonard Chan [Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)]
[NewPM] Port Sancov
This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.
Changes:
- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.
Differential Revision: https://reviews.llvm.org/D62888
llvm-svn: 365838
Stanislav Mekhanoshin [Thu, 11 Jul 2019 22:30:11 +0000 (22:30 +0000)]
[AMDGPU] Fixed asan error with agpr spilling
Instruction was used after it was erased.
llvm-svn: 365837
Diego Novillo [Thu, 11 Jul 2019 22:08:35 +0000 (22:08 +0000)]
Fix build errors LLVM tests are disabled.
Original patch from alanbaker@google.com
Fixes the error:
CMake Error in <...>/llvm/cmake/modules/CMakeLists.txt:
export called with target "LLVMTestingSupport" which requires target
"gtest" that is not in the export set.
This occurs when LLVM is embedded in a larger project, but is configured not to
include tests. If testing is disabled gtest isn't available and LLVM fails to
configure.
Differential revision: https://reviews.llvm.org/D63097
llvm-svn: 365836
Vitaly Buka [Thu, 11 Jul 2019 21:59:09 +0000 (21:59 +0000)]
CodeGen: Suppress c++ warnings in test
llvm-svn: 365835
Simon Atanasyan [Thu, 11 Jul 2019 21:55:56 +0000 (21:55 +0000)]
[mips] Simplify test case. NFC
Before rL295040 the linker just crashed when a GOT relocation (R_MIPS_GOT16)
comes from a merge section. To ensure that this bug still fixed it's enough
to check that the linker does not crash and create GOT entries.
llvm-svn: 365834
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:54:13 +0000 (21:54 +0000)]
[AMDGPU] gfx908 agpr spilling
Differential Revision: https://reviews.llvm.org/D64594
llvm-svn: 365833
Azharuddin Mohammed [Thu, 11 Jul 2019 21:45:48 +0000 (21:45 +0000)]
Fix a Python3 compatibility error
File "clang/test/lit.cfg.py", line 186, in <module>
config.available_features.add('macos-sdk-' + macOSSDKVersion)
TypeError: must be str, not bytes
llvm-svn: 365832
Sylvestre Ledru [Thu, 11 Jul 2019 21:42:55 +0000 (21:42 +0000)]
Rename libclang_shared to libclang-cpp
Summary: Fix bug 42475
Reviewers: beanz, tstellar
Reviewed By: beanz
Subscribers: kimgr, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64278
llvm-svn: 365831
Stefan Stipanovic [Thu, 11 Jul 2019 21:37:40 +0000 (21:37 +0000)]
[Attributor] Deduce "nosync" function attribute.
Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.
Reviewers: jdoerfert, jfb, nhaehnle, arsenm
Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D62766
llvm-svn: 365830
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:30:34 +0000 (21:30 +0000)]
[AMDGPU] gfx908 hazard recognizer
Differential Revision: https://reviews.llvm.org/D64593
llvm-svn: 365829
Huihui Zhang [Thu, 11 Jul 2019 21:28:25 +0000 (21:28 +0000)]
[InstCombine][NFCI] Add more test coverage to onehot_merge.ll
Prep work for upcoming patch D64275.
llvm-svn: 365828
Artem Dergachev [Thu, 11 Jul 2019 21:27:42 +0000 (21:27 +0000)]
[analyzer] exploded-graph-rewriter: Fix filenames in program point.
Fix a typo in JSON field name.
llvm-svn: 365827