Evgeniy Stepanov [Wed, 13 Dec 2017 01:16:34 +0000 (01:16 +0000)]
[hwasan] Inline instrumentation & fixed shadow.
Summary: This brings CPU overhead on bzip2 down from 5.5x to 2x.
Reviewers: kcc, alekseyshl
Subscribers: kubamracek, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D41137
llvm-svn: 320538
Petr Hosek [Wed, 13 Dec 2017 01:14:27 +0000 (01:14 +0000)]
[lldb] Set component when invoking add_llvm_install_targets
This is needed to ensure that the distribution and install-distribution
targets work properly.
Differential Revision: https://reviews.llvm.org/D41144
llvm-svn: 320537
Stephan T. Lavavej [Wed, 13 Dec 2017 00:51:31 +0000 (00:51 +0000)]
[libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.
benchmarks/util_smartptr.bench.cpp
Change CRLF to LF.
test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
Consistently comment "\u20ac" as EURO SIGN, its Unicode name, instead of the actual Unicode character.
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
Avoid non-ASCII dash.
Fixes D40991.
llvm-svn: 320536
Stephan T. Lavavej [Wed, 13 Dec 2017 00:51:27 +0000 (00:51 +0000)]
[libcxx] [test] Fix MSVC warnings, null pointer deref.
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
Silence MSVC warning C4244. This is expected when passing
floating-point values for size.
test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
Avoid MSVC "warning C4293: '<<': shift count negative or too big,
undefined behavior". MSVC sees (1ULL << N) and warns - being guarded
by const bool canFit is insufficient. A small change to the code
avoids the warning without the need for a pragma.
Remove a spurious printf() declaration from to_ullong.pass.cpp.
Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was
probably copy-pasted.
test/std/utilities/tuple/tuple.general/ignore.pass.cpp
Use LIBCPP_STATIC_ASSERT for consistency with other files.
test/support/container_test_types.h
Fix a null pointer dereference, found by MSVC /analyze
warning C6011 "Dereferencing NULL pointer 'm_expected_args'."
Fixes D41030.
llvm-svn: 320535
Michael Trent [Wed, 13 Dec 2017 00:36:13 +0000 (00:36 +0000)]
reverting out -r320532 because a warning is breaking the lld build
llvm-svn: 320534
Eli Friedman [Wed, 13 Dec 2017 00:14:17 +0000 (00:14 +0000)]
[Coverage] Always emit unused coverage mappings in the same order.
Non-determinism is confusing at best.
Differential Revision: https://reviews.llvm.org/D41140
llvm-svn: 320533
Michael Trent [Tue, 12 Dec 2017 23:53:46 +0000 (23:53 +0000)]
Updated llvm-objdump to display local relocations in Mach-O binaries
Summary:
llvm-objdump's Mach-O parser was updated in r306037 to display external
relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O
parser to display local relocations for MH_PRELOAD files. When used with
the -macho option relocations will be displayed in a historical format.
rdar://
35778019
Reviewers: enderby
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41061
llvm-svn: 320532
Kostya Serebryany [Tue, 12 Dec 2017 23:11:28 +0000 (23:11 +0000)]
[libFuzzer] change the strategy for -experimental_len_control to grow max_len slower
llvm-svn: 320531
Sanjay Patel [Tue, 12 Dec 2017 22:23:09 +0000 (22:23 +0000)]
[EarlyCSE] add tests for commuted min/max; NFC
See PR35642: https://bugs.llvm.org/show_bug.cgi?id=35642
llvm-svn: 320530
Krzysztof Parzyszek [Tue, 12 Dec 2017 21:44:04 +0000 (21:44 +0000)]
[Hexagon] Relax some checks in testcases, NFC
llvm-svn: 320529
John Baldwin [Tue, 12 Dec 2017 21:43:36 +0000 (21:43 +0000)]
[libunwind][MIPS]: Add support for unwinding in O32 and N64 processes.
This supports the soft-float ABI only and has been tested with both clang
and gcc on FreeBSD.
Reviewed By: sdardis, compnerd
Differential Revision: https://reviews.llvm.org/D38110
llvm-svn: 320528
Gheorghe-Teodor Bercea [Tue, 12 Dec 2017 21:38:43 +0000 (21:38 +0000)]
[OpenMP] Add function attribute for triggering data sharing.
Summary:
The backend should only emit data sharing code for the cases where it is needed.
A new function attribute is used by Clang to enable data sharing only for the cases where OpenMP semantics require it and there are variables that need to be shared.
Reviewers: hfinkel, Hahnfeld, ABataev, carlo.bertolli, caomhin
Reviewed By: ABataev
Subscribers: cfe-commits, jholewinski
Differential Revision: https://reviews.llvm.org/D41123
llvm-svn: 320527
Rui Ueyama [Tue, 12 Dec 2017 20:34:38 +0000 (20:34 +0000)]
Use the standard error handling mechanism in MinGW driver.
Differential Revision: https://reviews.llvm.org/D41127
llvm-svn: 320526
Alexey Bataev [Tue, 12 Dec 2017 20:28:46 +0000 (20:28 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320525
Raoul Wols [Tue, 12 Dec 2017 20:25:06 +0000 (20:25 +0000)]
[clangd] (Attempt to) read clang-format file for document formatting
Summary:
Takes into account the clang-format file of the project, if any.
Reverts to LLVM if nothing is found. Replies with an error if any error occured.
For instance, a parse error in the clang-format YAML file.
Reviewers: ilya-biryukov, sammccall, Nebiroth, malaperle, krasimir
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D41031
llvm-svn: 320524
Krzysztof Parzyszek [Tue, 12 Dec 2017 20:23:12 +0000 (20:23 +0000)]
[Hexagon] Better detection of identity and undef masks in shuffles
llvm-svn: 320523
Vedant Kumar [Tue, 12 Dec 2017 20:19:40 +0000 (20:19 +0000)]
Add an #include to appease an older clang, NFC
Add in a missing #include that AppleClang-900 complains about when
building with -DLLVM_ENABLE_MODULES.
llvm-svn: 320522
Kelvin Li [Tue, 12 Dec 2017 20:08:12 +0000 (20:08 +0000)]
[OpenMP] Diagnose function name on the link clause
This patch is to add diagnose when a function name is
specified on the link clause. According to the OpenMP
spec, only the list items that exclude the function
name are allowed on the link clause.
Differential Revision: https://reviews.llvm.org/D40968
llvm-svn: 320521
Rui Ueyama [Tue, 12 Dec 2017 20:00:30 +0000 (20:00 +0000)]
Remove trailing whitespace.
llvm-svn: 320520
Don Hinton [Tue, 12 Dec 2017 19:47:40 +0000 (19:47 +0000)]
[cmake] Follow-up to rL320494.
EXISTS requires full paths.
llvm-svn: 320519
Martin Storsjo [Tue, 12 Dec 2017 19:39:18 +0000 (19:39 +0000)]
[MinGW] Don't pass -dynamicbase:no by default for arm/arm64
The linker refuses using -dynamicbase:no on these architectures.
Stop passing -dynamicbase (which just reinforces the lld-link
default) for simplicity.
Differential Revision: https://reviews.llvm.org/D41052
llvm-svn: 320518
Martin Storsjo [Tue, 12 Dec 2017 19:39:13 +0000 (19:39 +0000)]
[COFF] Disallow -dynamicbase:no for arm and arm64
This matches what MSVC link.exe does.
Differential Revision: https://reviews.llvm.org/D41051
llvm-svn: 320517
Krzysztof Parzyszek [Tue, 12 Dec 2017 19:32:41 +0000 (19:32 +0000)]
[Hexagon] Fix wrong order of operands for vmux
Shuffle generation uses vmux to collapse vectors resulting from two
individual shuffles into one. The indexes of the elements selected
from the first operand were indicated by 0xFF in the constant vector
used in the compare instruction, but the compare (veqb) set the bits
corresponding to the 0x00 elements, thus inverting the selection.
Reverse the order of operands to vmux to get the correct output.
llvm-svn: 320516
Fiona Glaser [Tue, 12 Dec 2017 19:18:02 +0000 (19:18 +0000)]
Reassociate: add global reassociation algorithm
This algorithm (explained more in the source code) takes into account
global redundancies by building a "pair map" to find common subexprs.
The primary motivation of this is to handle situations like
foo = (a * b) * c
bar = (a * d) * c
where we currently don't identify that "a * c" is redundant.
Accordingly, it prioritizes the emission of a * c so that CSE
can remove the redundant calculation later.
Does not change the actual reassociation algorithm -- only the
order in which the reassociated operand chain is reconstructed.
Gives ~1.5% floating point math instruction count reduction on
a large offline suite of graphics shaders.
llvm-svn: 320515
Roman Lebedev [Tue, 12 Dec 2017 19:17:52 +0000 (19:17 +0000)]
[msan] LIT: Add lld testing config
Summary: A follow-up for D39508, with memory sanitizer changes.
Reviewers: eugenis, vitalybuka
Reviewed By: eugenis
Subscribers: mgorny, mehdi_amini, kcc, #sanitizers, llvm-commits
Tags: #sanitizers, #lld
Differential Revision: https://reviews.llvm.org/D40768
llvm-svn: 320514
Alexey Bataev [Tue, 12 Dec 2017 19:12:34 +0000 (19:12 +0000)]
Revert "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
This reverts commit r320510 - again sanitizers bbots.
llvm-svn: 320513
Sanjoy Das [Tue, 12 Dec 2017 19:11:31 +0000 (19:11 +0000)]
Reapply "[X86] Flag BroadWell scheduler model as complete"
This reverts commit r320508, in effect re-applying r320308. Simon has already
reverted the parts that caused the crash that motivated the revert in r320492.
llvm-svn: 320512
Hiroshi Yamauchi [Tue, 12 Dec 2017 19:07:43 +0000 (19:07 +0000)]
Split IndirectBr critical edges before PGO gen/use passes.
Summary:
The PGO gen/use passes currently fail with an assert failure if there's a
critical edge whose source is an IndirectBr instruction and that edge
needs to be instrumented.
To avoid this in certain cases, split IndirectBr critical edges in the PGO
gen/use passes. This works for blocks with single indirectbr predecessors,
but not for those with multiple indirectbr predecessors (splitting an
IndirectBr critical edge isn't always possible.)
Reviewers: davidxl, xur
Reviewed By: davidxl
Subscribers: efriedma, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D40699
llvm-svn: 320511
Alexey Bataev [Tue, 12 Dec 2017 18:47:00 +0000 (18:47 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320510
Zhihao Yuan [Tue, 12 Dec 2017 18:42:04 +0000 (18:42 +0000)]
[libcxx] P0604, invoke_result and is_invocable
Summary:
Introduce a new form of `result_of` without function type encoding.
Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly)
Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists.
Reviewers: EricWF, mclow.lists, bebuch
Reviewed By: EricWF, bebuch
Subscribers: lichray, bebuch, cfe-commits
Differential Revision: https://reviews.llvm.org/D38831
llvm-svn: 320509
Sanjoy Das [Tue, 12 Dec 2017 18:40:58 +0000 (18:40 +0000)]
Revert "[X86] Flag BroadWell scheduler model as complete"
This reverts commit r320308. r320308 crashes LLC, please see the llvm-commits
thread for a reproducer.
llvm-svn: 320508
Craig Topper [Tue, 12 Dec 2017 18:39:04 +0000 (18:39 +0000)]
[X86] Add a couple TODOs about missing coverage/features motivated by D40335
D40335 was wanting to add FMSUBADD support, but it discovered that there are two pieces of code to make FMADDSUB and only one of those is tested. So I've asked that review to implement the one path until we get tests that test the existing code.
llvm-svn: 320507
Kelvin Li [Tue, 12 Dec 2017 18:33:39 +0000 (18:33 +0000)]
Add --cuda-path to mock a CUDA Toolkit installation to avoid
unexpected error messages for incompatibility between the
default SM level and the support in the installed toolkit.
Differential Revision: https://reviews.llvm.org/D40996
llvm-svn: 320506
Nirav Dave [Tue, 12 Dec 2017 18:25:48 +0000 (18:25 +0000)]
[X86] Cleanup type conversion of 64-bit load-store pairs.
Summary:
Simplify and generalize chain handling and search for 64-bit load-store pairs.
Nontemporal test now converts 64-bit integer load-store into f64 which it realizes directly instead of splitting into two i32 pairs.
Reviewers: craig.topper, spatel
Reviewed By: craig.topper
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D40918
llvm-svn: 320505
Alexandre Ganea [Tue, 12 Dec 2017 18:00:43 +0000 (18:00 +0000)]
Test commit.
llvm-svn: 320504
Geoff Berry [Tue, 12 Dec 2017 17:53:59 +0000 (17:53 +0000)]
[MachineOperand][MIR] Add isRenamable to MachineOperand.
Summary:
Add isRenamable() predicate to MachineOperand. This predicate can be
used by machine passes after register allocation to determine whether it
is safe to rename a given register operand. Register operands that
aren't marked as renamable may be required to be assigned their current
register to satisfy constraints that are not captured by the machine
IR (e.g. ABI or ISA constraints).
Reviewers: qcolombet, MatzeB, hfinkel
Subscribers: nemanjai, mcrosier, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D39400
llvm-svn: 320503
Rafael Espindola [Tue, 12 Dec 2017 17:37:01 +0000 (17:37 +0000)]
Fix line endings. NFC.
llvm-svn: 320502
Alexey Bataev [Tue, 12 Dec 2017 17:35:29 +0000 (17:35 +0000)]
Revert "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
This reverts commit r320499 again to resolve the problem with the
sanitizers bbots.
llvm-svn: 320501
Casey Carter [Tue, 12 Dec 2017 17:22:24 +0000 (17:22 +0000)]
workaround PR 28385 in __find_exactly_one_checked
Fixes #35578.
Differential Revision: D41048
llvm-svn: 320500
Alexey Bataev [Tue, 12 Dec 2017 17:19:15 +0000 (17:19 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320499
Alexey Bataev [Tue, 12 Dec 2017 17:08:48 +0000 (17:08 +0000)]
Revert "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
This reverts commit r320496 to solve the problems with sanitizer
buildbots.
llvm-svn: 320498
Don Hinton [Tue, 12 Dec 2017 17:06:08 +0000 (17:06 +0000)]
[cmake] Support moving debuginfo-tests to llvm/projects
Differential Revision: https://reviews.llvm.org/D40972
llvm-svn: 320497
Alexey Bataev [Tue, 12 Dec 2017 16:58:48 +0000 (16:58 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320496
Don Hinton [Tue, 12 Dec 2017 16:54:20 +0000 (16:54 +0000)]
[debuginfo-tests] Support moving debuginfo-tests to llvm/projects
Summary:
Add cmake and lit files needed to run these tests as an
external project. Also, copy test_debuginfo.pl from llvm/utils since
it's only used here. The copy in llvm/utils must be maintained as
long as bots continue to include debuginfo-tests in clang/test.
This patch depends on clang patch https://reviews.llvm.org/D41055.
Reviewers: zturner, aprantl
Reviewed By: aprantl
Subscribers: mgorny, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D40971
llvm-svn: 320495
Don Hinton [Tue, 12 Dec 2017 16:48:35 +0000 (16:48 +0000)]
[debuginfo-tests] Add support for moving debuginfo-tests from clang/test to llvm/projects or monorepo.
Summary:
The new version of debuginfo-tests will have it's own
lit.cfg.py file which is incompatible with the one in clang/test.
This change supports both the old and new versions, and can be used
until the bots actually move debuginfo-tests to either clang/test or
the monorepo.
This is a prerequisite for D40971.
Reviewers: zturner, aprantl
Subscribers: mgorny, JDevlieghere, llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D41055
llvm-svn: 320494
Erich Keane [Tue, 12 Dec 2017 16:22:31 +0000 (16:22 +0000)]
Revert a part of 320489 that was submitted unintentionally.
llvm-svn: 320493
Simon Pilgrim [Tue, 12 Dec 2017 16:12:53 +0000 (16:12 +0000)]
[X86] Remove CompleteModel tags from CPU targets until we have better error checking (PR35636)
The checks we have for complete models are not great and miss many cases - e.g. in PR35636 it failed to recognise that only the first output (of 2) was actually tagged by the InstRW
Raised PR35639 and PR35643 as examples
llvm-svn: 320492
Alex Bradbury [Tue, 12 Dec 2017 16:10:21 +0000 (16:10 +0000)]
[RISCV][NFC] Formatting fix in RISCVInstrInfo.td
llvm-svn: 320491
Alexey Bataev [Tue, 12 Dec 2017 16:05:52 +0000 (16:05 +0000)]
Revert "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
This reverts commit r320488 because of the failed asan buildbots..
llvm-svn: 320490
Erich Keane [Tue, 12 Dec 2017 16:02:06 +0000 (16:02 +0000)]
Fix ICE when __has_unqiue_object_representations called with invalid decl
llvm-svn: 320489
Alexey Bataev [Tue, 12 Dec 2017 15:54:49 +0000 (15:54 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320488
Alex Bradbury [Tue, 12 Dec 2017 15:46:15 +0000 (15:46 +0000)]
[RISCV] Implement assembler pseudo instructions for RV32I and RV64I
Adds the assembler pseudo instructions of RV32I and RV64I which can
be mapped to a single canonical instruction. The missing pseudo
instructions (e.g., call, tail, ...) are marked as TODO. Other
things, like for example PCREL_LO, have to be implemented first.
Currently, alias emission is disabled by default to keep the patch
minimal. Alias emission by default will be enabled in a subsequent
patch which also updates all affected tests. Note that this patch
should actually break the floating point MC tests. However, the
used FileCheck configuration is not tight enought to detect the
breakage.
Differential Revision: https://reviews.llvm.org/D40902
Patch by Mario Werner.
llvm-svn: 320487
Haojian Wu [Tue, 12 Dec 2017 15:42:10 +0000 (15:42 +0000)]
[clangd] Introduce a "Symbol" class.
Summary:
* The "Symbol" class represents a C++ symbol in the codebase, containing all the
information of a C++ symbol needed by clangd. clangd will use it in clangd's
AST/dynamic index and global/static index (code completion and code
navigation).
* The SymbolCollector (another IndexAction) will be used to recollect the
symbols when the source file is changed (for ASTIndex), or to generate
all C++ symbols for the whole project.
In the long term (when index-while-building is ready), clangd should share a
same "Symbol" structure and IndexAction with index-while-building, but
for now we want to have some stuff working in clangd.
Reviewers: ioeric, sammccall, ilya-biryukov, malaperle
Reviewed By: sammccall
Subscribers: malaperle, klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40897
llvm-svn: 320486
Alexey Bataev [Tue, 12 Dec 2017 15:24:17 +0000 (15:24 +0000)]
Revert "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
This reverts commit r320483 because of the failed Windows buildbots.
llvm-svn: 320485
Alex Bradbury [Tue, 12 Dec 2017 15:17:45 +0000 (15:17 +0000)]
[RISCV] MC layer support for the instructions added in the privileged spec
Adds support for the instructions added in the RISC-V privileged ISA
(https://content.riscv.org/wp-content/uploads/2017/05/riscv-privileged-v1.10.pdf):
uret, sret, mret, wfi, and sfence.vma.
Note from the committer: I made very minor formatting changes prior to commit,
which didn't seem worth creating another review round-trip for.
Differential Revision: https://reviews.llvm.org/D40383
Patch by David Craven.
llvm-svn: 320484
Alexey Bataev [Tue, 12 Dec 2017 15:03:17 +0000 (15:03 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320483
Ilya Biryukov [Tue, 12 Dec 2017 14:15:01 +0000 (14:15 +0000)]
[clangd] Removed unused variable. NFC
llvm-svn: 320482
Ayman Musa [Tue, 12 Dec 2017 14:13:51 +0000 (14:13 +0000)]
[X86] Recognize constant arrays with special values and replace loads from it with subtract and shift instructions, which then will be replaced by X86 BZHI machine instruction.
Recognize constant arrays with the following values:
0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, .... , 2^(size - 1) -1
where //size// is the size of the array.
the result of a load with index //idx// from this array is equivalent to the result of the following:
(0xFFFFFFFF >> (sub 32, idx)) (assuming the array of type 32-bit integer).
And the result of an 'AND' operation on the returned value of such a load and another input, is exactly equivalent to the X86 BZHI instruction behavior.
See test cases in the LIT test for better understanding.
Differential Revision: https://reviews.llvm.org/D34141
llvm-svn: 320481
Anna Thomas [Tue, 12 Dec 2017 14:12:33 +0000 (14:12 +0000)]
[InstComineLoadStoreAlloca] Optimize stores to GEP off null base
Summary:
Currently, in InstCombineLoadStoreAlloca, we have simplification
rules for the following cases:
1. load off a null
2. load off a GEP with null base
3. store to a null
This patch adds support for the fourth case which is store into a
GEP with null base. Since this is UB as well (and directly analogous to
the load off a GEP with null base), we can substitute the stored val
with undef in instcombine, so that SimplifyCFG can optimize this code
into unreachable code.
Note: Right now, simplifyCFG hasn't been taught about optimizing
this to unreachable and adding an llvm.trap (this is already done for
the above 3 cases).
Reviewers: majnemer, hfinkel, sanjoy, davide
Reviewed by: sanjoy, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41026
llvm-svn: 320480
Krasimir Georgiev [Tue, 12 Dec 2017 13:43:59 +0000 (13:43 +0000)]
[clang-format] Improve ObjC headers detection.
This patch improves detection of ObjC header files.
Right now many ObjC headers, especially short ones, are categorized as C/C++.
Way of filtering still isn't the best, as most likely it should be token-based.
Contributed by jolesiak!
llvm-svn: 320479
Peter Smith [Tue, 12 Dec 2017 13:38:51 +0000 (13:38 +0000)]
[ELF] Refactor to remove loop copying all Sections in OS->finalize() [NFC]
Moving the SHF_LINK_ORDER processing out of OutputSection::finalize()
means that we no longer need to copy all InputSections as we now only need
the first one.
Differential Revision: https://reviews.llvm.org/D40966
llvm-svn: 320478
Peter Smith [Tue, 12 Dec 2017 13:30:44 +0000 (13:30 +0000)]
[ELF] Move SHF_LINK_ORDER processing earlier in Writer.cpp [NFC]
By moving this step before thunk creation and other processing that depends
on the size of sections, we permit removal of duplicates in the .ARM.exidx
section.
Differential Revision: https://reviews.llvm.org/D40964
llvm-svn: 320477
Ilya Biryukov [Tue, 12 Dec 2017 12:56:46 +0000 (12:56 +0000)]
[clangd] clang-format the code. NFC
llvm-svn: 320476
Nemanja Ivanovic [Tue, 12 Dec 2017 12:33:09 +0000 (12:33 +0000)]
[PowerPC] Add branch flag on asm parser-only branch instructions
This flag was missing but it wasn't an issue as nothing depended on it
for these asm parser-only instructions. Now that LLDB support is slowly
landing, it is important to get this right.
Committing on behalf of Leonardo Bianconi.
Differential revision: https://reviews.llvm.org/D40846
llvm-svn: 320475
Ilya Biryukov [Tue, 12 Dec 2017 12:27:47 +0000 (12:27 +0000)]
[clangd] Document highlights for clangd
Summary: Implementation of Document Highlights Request as described in
LSP.
Contributed by William Enright (nebiroth).
Reviewers: malaperle, krasimir, bkramer, ilya-biryukov
Reviewed By: malaperle
Subscribers: mgrang, sammccall, klimek, ioeric, rwols, cfe-commits, arphaman, ilya-biryukov
Differential Revision: https://reviews.llvm.org/D38425
llvm-svn: 320474
Nemanja Ivanovic [Tue, 12 Dec 2017 12:09:34 +0000 (12:09 +0000)]
[PowerPC] Follow-up to r318436 to get the missed CSE opportunities
The last of the three patches that https://reviews.llvm.org/D40348 was
broken up into.
Canonicalize the materialization of constants so that they are more likely
to be CSE'd regardless of the bit-width of the use. If a constant can be
materialized using PPC::LI, materialize it the same way always.
For example:
li 4, -1
li 4, 255
li 4, 65535
are equivalent if the uses only use the low byte. Canonicalize it to the
first form.
Differential Revision: https://reviews.llvm.org/D40348
llvm-svn: 320473
James Henderson [Tue, 12 Dec 2017 11:51:13 +0000 (11:51 +0000)]
[ELF] Reset OutputSection size prior to processing linker script commands
The size of an OutputSection is calculated early, to aid handling of compressed
debug sections. However, subsequent to this point, unused synthetic sections are
removed. In the event that an OutputSection, from which such an InputSection is
removed, is still required (e.g. because it has a symbol assignment), and no longer
has any InputSections, dot assignments, or BYTE()-family directives, the size
member is never updated when processing the commands. If the removed InputSection
had a non-zero size (such as a .got.plt section), the section ends up with the
wrong size in the output.
The fix is to reset the OutputSection size prior to processing the linker script
commands relating to that OutputSection. This ensures that the size is correct even
in the above situation.
Additionally, to reduce the risk of developers misusing OutputSection Size and
InputSection OutSecOff, they are set to simply the number of InputSections in an
OutputSection, and the corresponding index respectively. We cannot completely
stop using them, due to SHF_LINK_ORDER sections requiring them.
Compressed debug sections also require the full size. This is now calculated in
maybeCompress for these kinds of sections.
Reviewers: ruiu, rafael
Differential Revision: https://reviews.llvm.org/D38361
llvm-svn: 320472
Eric Liu [Tue, 12 Dec 2017 11:35:46 +0000 (11:35 +0000)]
[SemaCodeComplete] Allow passing out scope specifiers in qualified-id completions via completion context.
Reviewers: ilya-biryukov, arphaman
Reviewed By: arphaman
Subscribers: nik, cfe-commits
Differential Revision: https://reviews.llvm.org/D40563
llvm-svn: 320471
Simon Pilgrim [Tue, 12 Dec 2017 11:34:25 +0000 (11:34 +0000)]
Revert r320461 - causing ICE in windows buildss
[X86] Use regular expressions more aggressively to reduce the number of scheduler entries needed for FMA3 instructions.
When the scheduler tables are generated by tablegen, the instructions are divided up into groups based on their default scheduling information and how they are referenced by groups for each processor. For any set of instructions that are matched by a specific InstRW line, that group of instructions is guaranteed to not be in a group with any other instructions. So in general, the more InstRW class definitions are created, the more groups we end up with in the generated files. Particularly if a lot of the InstRW lines only match to single instructions, which is true of a large number of the Intel scheduler models.
This change alone reduces the number of instructions groups from ~6000 to ~5500. And there's lots more we could do.
llvm-svn: 320470
Jonas Devlieghere [Tue, 12 Dec 2017 11:32:21 +0000 (11:32 +0000)]
[dsymutil] Accept line tables up to DWARFv5.
This patch removes the hard-coded check for DWARFv2 line tables. Now
dsymutil accepts line tables for DWARF versions 2 to 5 (inclusive).
Differential revision: https://reviews.llvm.org/D41084
rdar://
35968319
llvm-svn: 320469
Ilya Biryukov [Tue, 12 Dec 2017 11:16:45 +0000 (11:16 +0000)]
[clangd] Introduced a Context that stores implicit data
Summary:
It will be used to pass around things like Logger and Tracer throughout
clangd classes.
Reviewers: sammccall, ioeric, hokein, bkramer
Reviewed By: sammccall
Subscribers: klimek, bkramer, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40485
llvm-svn: 320468
Eugene Leviant [Tue, 12 Dec 2017 10:12:46 +0000 (10:12 +0000)]
Revert r320464 as it breaks gold plugin tests
llvm-svn: 320467
Igor Laevsky [Tue, 12 Dec 2017 10:03:39 +0000 (10:03 +0000)]
Revert r320049, r320014 and r319894
They were causing failures of the piglit OpenGL tests with AMD GPUs using the
Mesa radeonsi driver.
llvm-svn: 320466
Serguei Katkov [Tue, 12 Dec 2017 09:44:41 +0000 (09:44 +0000)]
[NFC][SafepointIRVerifier] Add alias for set of available values
Introduces usage of AvailableValueSet alias name instead of
DenseSet<const Value *> for better reading.
Patch Author: Daniil Suchkov
Reviewers: mkazantsev, anna, apilipenko
Reviewed By: anna
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41002
llvm-svn: 320465
Eugene Leviant [Tue, 12 Dec 2017 09:12:32 +0000 (09:12 +0000)]
[ThinLTO] Remove unused code from thinLTOInternalizeModule
Differential revision: https://reviews.llvm.org/D40970
llvm-svn: 320464
Dorit Nuzman [Tue, 12 Dec 2017 08:57:43 +0000 (08:57 +0000)]
[LV] Ignore the cost of values that will not appear in the vectorized loop
VecValuesToIgnore holds values that will not appear in the vectorized loop.
We should therefore ignore their cost when VF > 1.
Differential Revision: https://reviews.llvm.org/D40883
llvm-svn: 320463
Martin Storsjo [Tue, 12 Dec 2017 08:22:29 +0000 (08:22 +0000)]
[COFF] Don't error out on undefined references to __enclave_config
This is required for linking the CRT from MSVC 2017 15.5.
Differential Revision: https://reviews.llvm.org/D41089
llvm-svn: 320462
Craig Topper [Tue, 12 Dec 2017 08:17:04 +0000 (08:17 +0000)]
[X86] Use regular expressions more aggressively to reduce the number of scheduler entries needed for FMA3 instructions.
When the scheduler tables are generated by tablegen, the instructions are divided up into groups based on their default scheduling information and how they are referenced by groups for each processor. For any set of instructions that are matched by a specific InstRW line, that group of instructions is guaranteed to not be in a group with any other instructions. So in general, the more InstRW class definitions are created, the more groups we end up with in the generated files. Particularly if a lot of the InstRW lines only match to single instructions, which is true of a large number of the Intel scheduler models.
This change alone reduces the number of instructions groups from ~6000 to ~5500. And there's lots more we could do.
llvm-svn: 320461
Mikael Holmen [Tue, 12 Dec 2017 07:29:57 +0000 (07:29 +0000)]
[CallSiteSplitting] Don't let debug intrinsics affect optimizations
Summary:
This solves PR35616.
We don't want the compiler to generate different code when we compile
with/without -g, so we now ignore debug intrinsics when determining if
the optimization can trigger or not.
Reviewers: junbuml
Subscribers: davide, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D41068
llvm-svn: 320460
Craig Topper [Tue, 12 Dec 2017 07:06:35 +0000 (07:06 +0000)]
[X86] Use Ld scheduler classes for instructions with folded loads.
llvm-svn: 320459
Craig Topper [Tue, 12 Dec 2017 07:06:32 +0000 (07:06 +0000)]
[X86] Correct the FMA3 regular expressions in the znver1 scheduler model.
llvm-svn: 320458
Tony Tye [Tue, 12 Dec 2017 05:47:00 +0000 (05:47 +0000)]
[AMDGPU] Rename Bonaire target to be gfx704; remove gfx800 and make Iceland and Tonga both use gfx802; update target feature handling
Correct committed version to match intended accepted review D40051 id=123417
- Rename Bonaire target to be gfx704.
- Eliminate gfx800 and make Iceland and Tonga both use gfx802 as they use the same code.
- List target features supported by each processor in the processor table together with the default value.
- Add xnack flag to e_flags.
- Remove xnack from kernel metadata and kernel descriptor since it is now a whole code object property.
Differential Revision: https://reviews.llvm.org/D40051
llvm-svn: 320457
Vedant Kumar [Tue, 12 Dec 2017 03:27:13 +0000 (03:27 +0000)]
Avoid module import in a textual header, NFC
This unbreaks the lldb modules build (-DLLVM_ENABLE_MODULES=On).
llvm-svn: 320456
Artem Dergachev [Tue, 12 Dec 2017 02:59:09 +0000 (02:59 +0000)]
[analyzer] StackAddrEscape: For now, disable the new async escape checks.
The new check introduced in r318705 is useful, but suffers from a particular
class of false positives, namely, it does not account for
dispatch_barrier_sync() API which allows one to ensure that the asyncronously
executed block that captures a pointer to a local variable does not actually
outlive that variable.
The new check is split into a separate checker, under the name of
alpha.core.StackAddressAsyncEscape, which is likely to get enabled by default
again once these positives are fixed. The rest of the StackAddressEscapeChecker
is still enabled by default.
Differential Revision: https://reviews.llvm.org/D41042
llvm-svn: 320455
Davide Italiano [Tue, 12 Dec 2017 02:52:01 +0000 (02:52 +0000)]
[TestModulesInlineFunctions] This test now passes.
Remove yet another spurious unexpected success.
Ack'ed by Jim Ingham.
Fixes PR25743.
llvm-svn: 320454
Davide Italiano [Tue, 12 Dec 2017 02:32:49 +0000 (02:32 +0000)]
[TestCppScope] This test now passes on Darwin.
I tested on x86-64 and Jason on embedded architectures.
This cleans up another couple of reported unexpected successes.
<rdar://problem/
28623427>
llvm-svn: 320452
Artem Dergachev [Tue, 12 Dec 2017 02:27:55 +0000 (02:27 +0000)]
[analyzer] In getSVal() API, disable auto-detection of void type as char type.
This is a follow-up from r314910. When a checker developer attempts to
dereference a location in memory through ProgramState::getSVal(Loc) or
ProgramState::getSVal(const MemRegion *), without specifying the second
optional QualType parameter for the type of the value he tries to find at this
location, the type is auto-detected from location type. If the location
represents a value beyond a void pointer, we thought that auto-detecting the
type as 'char' is a good idea. However, in most practical cases, the correct
behavior would be to specify the type explicitly, as it is available from other
sources, and the few cases where we actually need to take a 'char' are
workarounds rather than an intended behavior. Therefore, try to fail with an
easy-to-understand assertion when asked to read from a void pointer location.
Differential Revision: https://reviews.llvm.org/D38801
llvm-svn: 320451
Davide Italiano [Tue, 12 Dec 2017 02:10:23 +0000 (02:10 +0000)]
[testsuite] Remove even more testing vestiges.
With this one, the number of unexpected successes for the LLDB
test suite when building with clang ToT goes down to 18.
llvm-svn: 320450
Rafael Espindola [Tue, 12 Dec 2017 01:45:49 +0000 (01:45 +0000)]
Compact symbols from 96 to 88 bytes.
By using an index instead of a pointer for verdef we can put the index
next to the alignment field. This uses the otherwise wasted area and
reduces the shared symbol size.
By itself the performance change of this is in the noise, but I have a
followup patch to remove another 8 bytes that improves performance
when combined with this.
llvm-svn: 320449
Rafael Espindola [Tue, 12 Dec 2017 01:36:24 +0000 (01:36 +0000)]
Add an option for ICFing data.
An internal linker has support for merging identical data and in some
cases it can be a significant win.
This is behind an off by default flag so it has to be requested
explicitly.
llvm-svn: 320448
Davide Italiano [Tue, 12 Dec 2017 01:21:43 +0000 (01:21 +0000)]
Rollback [Testsuite] Rename this file from *m -> *mm.
After discussing this with Jim and Jason, I think my commit was
actually sweeping the issue under the carpet rather than fixing it.
I'll take a closer look between tonight and tomorrow.
llvm-svn: 320447
Petr Hosek [Tue, 12 Dec 2017 01:20:52 +0000 (01:20 +0000)]
[CMake] Support runtimes and monorepo layouts when looking for libcxx
This also slightly refactors the code that's checking the directory
presence which allows eliminating one unnecessary variable.
Differential Revision: https://reviews.llvm.org/D40637
llvm-svn: 320446
Petr Hosek [Tue, 12 Dec 2017 01:20:37 +0000 (01:20 +0000)]
[libcxxabi] Pass LIBCXXABI_SYSROOT and LIBCXXABI_GCC_TOOLCHAIN to lit
These are expected to be set by the shared lit scripts used from libc++.
Differential Revision: https://reviews.llvm.org/D40818
llvm-svn: 320445
Davide Italiano [Tue, 12 Dec 2017 01:14:11 +0000 (01:14 +0000)]
[testsuite] Remove testing failures vestiges.
Some tests are failing on macOS when building with the in-tree
clang, and this is because they're conditional on the version released.
Apple releases using a different versioning number, but as these are
conditional on clang < 7, they fail for clang ToT (which is 6.0).
As a general solution, we actually need either a mapping between
Apple internal release version and public ones.
That said, I discussed this with Fred , and Apple Clang 6.0 seems
to be old enough that we can remove this altogether (which means I
can delay implementing the general purpose solution for a bit).
Differential Revision: https://reviews.llvm.org/D41101
llvm-svn: 320444
Shoaib Meenai [Tue, 12 Dec 2017 00:47:07 +0000 (00:47 +0000)]
[lldb] Switch to add_llvm_install_targets
This adds the install-*-stripped targets to LLDB, which are required for
the install-distribution-stripped option. We also need to create some
install-*-stripped targets manually, which are modeled after their
corresponding install-* targets.
Differential Revision: https://reviews.llvm.org/D41099
llvm-svn: 320443
Petr Hosek [Tue, 12 Dec 2017 00:31:46 +0000 (00:31 +0000)]
[ELF] Use shell to check the file permissions
This is less error-prone to mask settings than stat.
Differential Revision: https://reviews.llvm.org/D41097
llvm-svn: 320442
Sam Clegg [Tue, 12 Dec 2017 00:22:21 +0000 (00:22 +0000)]
[WebAssembly] Check more details in call-indirect test. NFC.
Also make function bodies unique so they can be distinguished
in the output. This is helpful for adding support for --gc-sections.
Differential Revision: https://reviews.llvm.org/D41093
llvm-svn: 320441
Vedant Kumar [Mon, 11 Dec 2017 23:34:50 +0000 (23:34 +0000)]
[llvm-cov] Simplify a test case. NFC.
llvm-svn: 320439
Petr Hosek [Mon, 11 Dec 2017 23:30:54 +0000 (23:30 +0000)]
[ELF] Don't set the executable bit for relocatable files
These are not executable files so they shouldn't be marked as such.
Differential Revision: https://reviews.llvm.org/D41041
llvm-svn: 320438
Jake Ehrlich [Mon, 11 Dec 2017 23:25:27 +0000 (23:25 +0000)]
[ELF] Change default output section type to SHT_NOBITS
When an output section has no byte commands and has no input sections then it
would be ideal if the type of the section is SHT_NOBITS so that the file can
take up less space. This change sets the default type of of output sections to
SHT_NOBITS instead of SHT_PROGBITS to allow this. This required some minor test
changes (which double as tests for this new behavior) but extend-pt-load.s had
be changed in a non-trivial way. Since it seems to me that the point of the
test is to point out the consequences of how flags are assigned to output
sections that don't have input sections I changed the test to work and still
show how the memsize of the executable segment was changed.
Differential Revision: https://reviews.llvm.org/D41082
llvm-svn: 320437