Kevin P. Neal [Tue, 28 May 2019 14:37:45 +0000 (14:37 +0000)]
Revert 361827. It broke the bots.
llvm-svn: 361831
Fangrui Song [Tue, 28 May 2019 14:34:28 +0000 (14:34 +0000)]
Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded
This is implemented by creating Undefined (instead of Defined) for such
local STT_SECTION symbols. It allows us to catch errors when there are
relocations to such discarded sections (e.g. in PR41693, ld.bfd and gold
error but we don't). Updated comdat-discarded-error.s checks we emit
friendly error message.
For relocatable-eh-frame.s, ld.lld -r a.o a.o will now error
"STT_SECTION symbol should be defined" because the section .eh_frame
refers to is now an Undefined instead of a Defined.
So I have to change `error()` to `warn()` to retain the output.
rLLD361144 inadvertently enabled the error for --gdb-index
(in LLDDwarfObj<ELFT>::findAux()).
Relocations from .debug_info (not in comdat) to .text.* (in comdat) for
DW_AT_low_pc are common. If an .text.* was discarded, rLLD361144 would error,
which was unexpected. (Note, if we don't error as this patch does,
InputSection::relocateNonAlloc() will resolve such relocations).
llvm-svn: 361830
Ilya Biryukov [Tue, 28 May 2019 14:33:16 +0000 (14:33 +0000)]
[CodeComplete] Consistently break after '{' in multi-line patterns
Summary:
Completion can return multi-line patterns in some cases, e.g.
for (<#init#>; <#cond#>; <#inc#>) {
<#body#>
}
However, most patterns break the line only before closing brace,
resulting in code like:
namespace <#name#> { <#decls#>
}
While some (e.g. the 'for' example above) are breaking lines after the
opening brace too.
This change ensures all patterns consistently break after the opening
brace, this leads to nicer UX when using those in an actual editor.
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62405
llvm-svn: 361829
Ilya Biryukov [Tue, 28 May 2019 14:23:00 +0000 (14:23 +0000)]
gn build: make clangd depend on clang resource headers
Summary:
clangd needs them to function properly, even though they are not
strictly required for the build.
Reviewers: thakis
Reviewed By: thakis
Subscribers: MaskRay, jkorous, arphaman, llvm-commits, kadircet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62480
llvm-svn: 361828
Kevin P. Neal [Tue, 28 May 2019 14:17:48 +0000 (14:17 +0000)]
Add constrained intrinsic tests for powerpc64 and powerpc64le.
Submitted by: Drew Wock
Reviewed by: Hal Finkel
Approved by: Hal Finkel
Differential Revision: https://reviews.llvm.org/D62388
llvm-svn: 361827
Alexandre Ganea [Tue, 28 May 2019 14:14:48 +0000 (14:14 +0000)]
[CMake] Default options for faster executables on MSVC
Differential Revision: https://reviews.llvm.org/D55056
llvm-svn: 361826
Michal Gorny [Tue, 28 May 2019 14:10:47 +0000 (14:10 +0000)]
[openmp] [test] Skip kernel-breaking tests on NetBSD
The omp_taskloop_num_tasks and omp_taskwait have deadlooped
on the NetBSD buildbot previously, practically hanging the host running
it. Disable them until we can find a good solution, or make the kernel
less fragile.
llvm-svn: 361825
Nico Weber [Tue, 28 May 2019 14:04:48 +0000 (14:04 +0000)]
Add release note entries for recent typo correction changes
Differential Revision: https://reviews.llvm.org/D62523
llvm-svn: 361824
Ilya Biryukov [Tue, 28 May 2019 13:56:21 +0000 (13:56 +0000)]
[clangd] Compute expected type for templates
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62515
llvm-svn: 361823
Sanjay Patel [Tue, 28 May 2019 13:54:17 +0000 (13:54 +0000)]
[x86] split 256-bit store of concatenated vectors
This shows up as a side issue to the main problem for the AVX target example from PR37428:
https://bugs.llvm.org/show_bug.cgi?id=37428 - https://godbolt.org/z/7tpRa3
But as we can see in the pile of existing test diffs, it's actually a widespread problem
that affects any AVX or later target. Apart from a couple of oddballs, I think these are
all improvements for the reasons stated in the code comment: we do not want to enable YMM
unnecessarily (avoid vzeroupper and frequency throttling) and some cores split 256-bit
stores anyway.
We could say that MergeConsecutiveStores() is going overboard on some of these examples,
but that won't solve the problem completely. But that is the reason I'm proposing this as
a lowering rather than a combine: we will infinite loop fighting the merge code if we try
this earlier.
Differential Revision: https://reviews.llvm.org/D62498
llvm-svn: 361822
Simon Pilgrim [Tue, 28 May 2019 13:46:26 +0000 (13:46 +0000)]
[DAG] LegalizeVectorTypes - reduce scope of local variables. NFCI.
Move the element index/count variables into the block where they are actually used - appeases cppcheck and helps avoid shadow variable warnings.
llvm-svn: 361821
David Stenberg [Tue, 28 May 2019 13:23:25 +0000 (13:23 +0000)]
Stop undef fragments from closing non-overlapping fragments
Summary:
When DwarfDebug::buildLocationList() encountered an undef debug value,
it would truncate all open values, regardless if they were overlapping or
not. This patch fixes so that it only does that for overlapping fragments.
This change unearthed a bug that I had introduced in D57511,
which I have fixed in this patch. The code in DebugHandlerBase that
changes labels for parameter debug values could break DwarfDebug's
assumption that the labels for the entries in the debug value history
are monotonically increasing. Before this patch, that bug could result
in location list entries whose ending address was lower than the
beginning address, and with the changes for undef debug values that this
patch introduces it could trigger an assertion, due to attempting to
emit location list entries with empty ranges. A reproducer for the bug
is added in param-reg-const-mix.mir.
Reviewers: aprantl, jmorse, probinson
Reviewed By: aprantl
Subscribers: javed.absar, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D62379
llvm-svn: 361820
Matt Arsenault [Tue, 28 May 2019 13:08:31 +0000 (13:08 +0000)]
MIR: Fix printer crashing on dead CSR frame indexes
llvm-svn: 361819
Adam Balogh [Tue, 28 May 2019 13:07:09 +0000 (13:07 +0000)]
[Analyzer] Replace `CXXSelfAssignmentBRVisitor` with `NoteTags`
The `cplusplus.SelfAssignment` checker has a visitor that is added
to every `BugReport` to mark the to branch of the self assignment
operator with e.g. `rhs == *this` and `rhs != *this`. With the new
`NoteTag` feature this visitor is not needed anymore. Instead the
checker itself marks the two branches using the `NoteTag`s.
Differential Revision: https://reviews.llvm.org/D62479
llvm-svn: 361818
Sjoerd Meijer [Tue, 28 May 2019 13:04:47 +0000 (13:04 +0000)]
Follow up of r361810: test case fix attempt for Windows builder
llvm-svn: 361817
Cameron McInally [Tue, 28 May 2019 13:00:52 +0000 (13:00 +0000)]
[IRBuilder] Add CreateUnOp(...) to the IRBuilder to support unary FNeg
Also update UnaryOperator to support isa, cast, and dyn_cast.
Differential Revision: https://reviews.llvm.org/D62417
llvm-svn: 361816
Sanjay Patel [Tue, 28 May 2019 12:58:07 +0000 (12:58 +0000)]
[x86] fix 256-bit vector store splitting to honor 'volatile'
Forking this out of the discussion in D62498
(and assuming that will be committed later, so adding the helper function here).
The LangRef says:
"the backend should never split or merge target-legal volatile load/store instructions."
Differential Revision: https://reviews.llvm.org/D62506
llvm-svn: 361815
Benjamin Kramer [Tue, 28 May 2019 12:52:57 +0000 (12:52 +0000)]
[X86] Custom lower CONCAT_VECTORS of v2i1
The generic legalizer cannot handle this. Add an assert instead of
silently miscompiling vectors with elements smaller than 8 bits.
llvm-svn: 361814
Graham Hunter [Tue, 28 May 2019 12:36:39 +0000 (12:36 +0000)]
[NFC] Test commit, delete trailing whitespace
llvm-svn: 361813
Hans Wennborg [Tue, 28 May 2019 12:30:35 +0000 (12:30 +0000)]
Cleanups for r361807 that I somehow failed to commit
llvm-svn: 361812
Hans Wennborg [Tue, 28 May 2019 12:19:38 +0000 (12:19 +0000)]
Re-commit r357452 (take 2): "SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)"
This was reverted in r360086 as it was supected of causing mysterious test
failures internally. However, it was never concluded that this patch was the
root cause.
> The code was previously checking that candidates for sinking had exactly
> one use or were a store instruction (which can't have uses). This meant
> we could sink call instructions only if they had a use.
>
> That limitation seemed a bit arbitrary, so this patch changes it to
> "instruction has zero or one use" which seems more natural and removes
> the need to special-case stores.
>
> Differential revision: https://reviews.llvm.org/D59936
llvm-svn: 361811
Sjoerd Meijer [Tue, 28 May 2019 12:06:26 +0000 (12:06 +0000)]
[ARM] Use CHECK-NEXT in CodeGen/ARM/O3-pipeline.ll. NFC.
Use CHECK-NEXT, like in other pipeline tests, so that we actually
notice when the pipeline is changed.
llvm-svn: 361810
Haojian Wu [Tue, 28 May 2019 11:54:01 +0000 (11:54 +0000)]
[clang-tidy] Fix null pointer dereference in readability-identifier-naming
Summary:
readability-identifier-naming causes a null pointer dereference when checking an identifier introduced by a structured binding whose right hand side is an undeclared identifier.
Running the check on a file that is just the following results in a crash:
```
auto [left] = right;
```
Patch by Mark Stegeman!
Reviewers: alexfh, hokein, aaron.ballman, JonasToth
Reviewed By: hokein, aaron.ballman
Subscribers: madsravn, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D62404
llvm-svn: 361809
Yevgeny Rouban [Tue, 28 May 2019 11:33:50 +0000 (11:33 +0000)]
[CorrelatedValuePropagation] Fix prof branch_weights metadata handling for SwitchInst
This patch fixes the CorrelatedValuePropagation pass to keep
prof branch_weights metadata of SwitchInst consistent.
It makes use of SwitchInstProfUpdateWrapper.
New tests are added.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D62126
llvm-svn: 361808
Hans Wennborg [Tue, 28 May 2019 11:24:20 +0000 (11:24 +0000)]
Fix some llvm-readelf tests after r361633
They were failing on 32-bit Windows. In the cases where I've changed
test expectations, I've checked that they match the output of GNU
readelf.
llvm-svn: 361807
Haojian Wu [Tue, 28 May 2019 11:21:59 +0000 (11:21 +0000)]
Revert [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded
This reverts r361792 (git commit
cfca5095df0209c60109696d6cc368d49e2c5939), the
revision causes link errors internally, will share more details with the
author.
llvm-svn: 361806
Simon Pilgrim [Tue, 28 May 2019 11:10:56 +0000 (11:10 +0000)]
[SLPVectorizer][X86] Add broadcast test case from D62427
llvm-svn: 361805
Simon Pilgrim [Tue, 28 May 2019 10:53:23 +0000 (10:53 +0000)]
[X86] X86CmovConverterPass::collectCmovCandidates - fix uninitialized variable warnings. NFCI.
llvm-svn: 361804
Kadir Cetinkaya [Tue, 28 May 2019 10:29:58 +0000 (10:29 +0000)]
[clangd] Introduce a structured hover response
Summary:
Change ClangdServer layer to output a structured response for Hover,
which can be rendered by client according to their needs.
Reviewers: sammccall, ilya-biryukov
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61497
llvm-svn: 361803
Fangrui Song [Tue, 28 May 2019 10:12:06 +0000 (10:12 +0000)]
[ELF] Replace two addSymbol() call sites with Symbol::resolve(). NFC
If we have a handle of the symbol, insert() called by addSymbol() is
redundant. Just call resolve().
llvm-svn: 361802
Cullen Rhodes [Tue, 28 May 2019 09:36:52 +0000 (09:36 +0000)]
[AArch64][SVE2] Asm: support SVE2 Floating Point Convert Group
Summary:
Patch adds support for the following intructions:
SVE2 floating-point convert precision:
* FCVTXNT, FCVTNT, FCVTLT
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D62382
llvm-svn: 361801
Ilya Biryukov [Tue, 28 May 2019 09:31:27 +0000 (09:31 +0000)]
[clangd] Never end command-line flag description with a period. NFC
For consistency. Not having a period at the end is much more common and
seems to be the preferred style for command-line options.
llvm-svn: 361800
Stefan Granitz [Tue, 28 May 2019 09:29:05 +0000 (09:29 +0000)]
[CMake] Folder structure for generated Xcode project to cover more targets
llvm-svn: 361799
Ilya Biryukov [Tue, 28 May 2019 09:20:57 +0000 (09:20 +0000)]
[clangd] Rename -run-synchronously to -sync
llvm-svn: 361798
Cullen Rhodes [Tue, 28 May 2019 09:13:17 +0000 (09:13 +0000)]
[AArch64][SVE2] Asm: support SVE2 Crypto Extensions Group
Summary:
Patch adds support for the following instructions:
SVE2 crypto constructive binary operations:
* SM4EKEY, RAX1
SVE2 crypto destructive binary operations:
* AESE, AESD, SM4E
SVE2 crypto unary operations:
* AESMC, AESIMC
AESE, AESD, AESMC and AESIMC are enabled with +sve2-aes. SM4E and
SM4EKEY are enabled with +sve2-sm4. RAX1 is enabled with +sve2-sha3.
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D62307
llvm-svn: 361797
Cullen Rhodes [Tue, 28 May 2019 08:51:59 +0000 (08:51 +0000)]
[AArch64][SVE2] Asm: support SVE2 Histogram Computation Groups
Summary:
Patch adds support for the following instructions:
SVE2 histogram generation (segment):
* HISTSEG
SVE2 histogram generation (vector):
* HISTCNT
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D62306
llvm-svn: 361796
Cullen Rhodes [Tue, 28 May 2019 08:42:22 +0000 (08:42 +0000)]
[AArch64][SVE2] Asm: support SVE2 Misc Group
Summary:
Patch adds support for the following instructions:
SVE2 bitwise exclusive-or interleaved:
* EORBT, EORTB
SVE2 bitwise permute:
* BEXT, BDEP, BGRP
SVE2 bitwise shift left long:
* SSHLLB, SSHLLT, USHLLB, USHLLT
SVE2 integer add/subtract interleaved long:
* SADDLBT, SSUBLBT, SSUBLTB
BDEP, BEXT and BGRP are enabled with SVE2 feature +bitperm, all other
instructions in this group are enabled with +sve2.
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D62304
llvm-svn: 361795
Craig Topper [Tue, 28 May 2019 07:25:27 +0000 (07:25 +0000)]
[InlineCost] Fix a couple comments. NFC
Replace "unary operator" with "unary instruction" in visitUnaryInstruction since
we now have a UnaryOperator class which might needs its own visit function.
Fix a copy/paste in visitCastInst that appears to have been copied from
visitPtrToInt.
llvm-svn: 361794
Don Hinton [Tue, 28 May 2019 06:38:16 +0000 (06:38 +0000)]
Revert [test] Fix plugin tests
This reverts r361790 (git commit
fe5eaab2b5b4523886bd63aebcfea8cfce586fa1)
It's causing buildbot breakage, so reverting while I investigate.
llvm-svn: 361793
Fangrui Song [Tue, 28 May 2019 06:34:52 +0000 (06:34 +0000)]
[ELF] Error on relocations to STT_SECTION symbols if the sections were discarded
This is implemented by creating Undefined (instead of Defined) for such
local STT_SECTION symbols. It allows us to catch errors when there are
relocations to such discarded sections (e.g. in PR41693, ld.bfd and gold
error but we don't). Updated comdat-discarded-error.s checks we emit
friendly error message.
For relocatable-eh-frame.s, ld.lld -r a.o a.o will now error
"STT_SECTION symbol should be defined" because the section .eh_frame
refers to is now an Undefined instead of a Defined.
So I have to change `error()` to `warn()` to retain the output.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D61583
llvm-svn: 361792
Rui Ueyama [Tue, 28 May 2019 06:33:06 +0000 (06:33 +0000)]
Use SymbolTable::insert() to implement --trace.
Differential Revision: https://reviews.llvm.org/D62381
llvm-svn: 361791
Don Hinton [Tue, 28 May 2019 06:26:58 +0000 (06:26 +0000)]
[test] Fix plugin tests
Summary:
The following changes were required to fix these tests:
1) Change LLVM_ENABLE_PLUGINS to an option and move it to
llvm/CMakeLists.txt with an appropriate default -- which matches
the original default behavior.
2) Move the plugins directory from clang/test/Analysis
clang/lib/Analysis. It's not enough to add an exclude to the
lit.local.cfg file because add_lit_testsuites recurses the tree and
automatically adds the appropriate `check-` targets, which don't
make sense for the plugins because they aren't tests and don't
have `RUN` statements.
Here's a list of the `clang-check-anlysis*` targets with this
change:
```
$ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
check-clang-analysis
check-clang-analysis-checkers
check-clang-analysis-copypaste
check-clang-analysis-diagnostics
check-clang-analysis-engine
check-clang-analysis-exploration_order
check-clang-analysis-html_diagnostics
check-clang-analysis-html_diagnostics-relevant_lines
check-clang-analysis-inlining
check-clang-analysis-objc
check-clang-analysis-unified-sources
check-clang-analysis-z3
```
3) Simplify the logic and only include the subdirectories under
clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.
Reviewed By: NoQ
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62445
llvm-svn: 361790
Rui Ueyama [Tue, 28 May 2019 05:17:21 +0000 (05:17 +0000)]
Merge ELFFileBase::{initSymtab,parseHeader} as ELFFileBase:init. NFC.
This patch simplifies ELFFile instance initialization by merging
two similar functions into a single function and call it from the
ctor.
llvm-svn: 361789
Craig Topper [Tue, 28 May 2019 04:09:18 +0000 (04:09 +0000)]
[CostModel] Add really basic support for being able to query the cost of the FNeg instruction.
Summary:
This reuses the getArithmeticInstrCost, but passes dummy values of the second
operand flags.
The X86 costs are wrong and can be improved in a follow up. I just wanted to
stop it from reporting an unknown cost first.
Reviewers: RKSimon, spatel, andrew.w.kaylor, cameron.mcinally
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62444
llvm-svn: 361788
Nico Weber [Tue, 28 May 2019 01:20:36 +0000 (01:20 +0000)]
llvm-undname: Remove unreachable statement
llvm-svn: 361786
Sanjay Patel [Mon, 27 May 2019 23:56:41 +0000 (23:56 +0000)]
[x86] add test to show volatile store splitting; NFC
From the LangRef:
"the backend should never split or merge target-legal
volatile load/store instructions."
See also:
D62498
llvm-svn: 361785
Petr Hosek [Mon, 27 May 2019 23:23:50 +0000 (23:23 +0000)]
[Driver] Change layout of per-target runtimes to resemble multiarch
This is a follow up to r361432, changing the layout of per-target
runtimes to more closely resemble multiarch. While before, we used
the following layout:
[RESOURCE_DIR]/<target>/lib/libclang_rt.<runtime>.<ext>
Now we use the following layout:
[RESOURCE_DIR]/lib/<target>/libclang_rt.<runtime>.<ext>
This also more closely resembles the existing "non-per-target" layout:
[RESOURCE_DIR]/lib/<os>/libclang_rt.<runtime>-<arch>.<ext>
This change will enable further simplification of the driver logic
in follow up changes.
Differential Revision: https://reviews.llvm.org/D62469
llvm-svn: 361784
Nico Weber [Mon, 27 May 2019 23:10:42 +0000 (23:10 +0000)]
llvm-undname: Extract demangleMD5Name() method; no behavior change
llvm-svn: 361783
Lang Hames [Mon, 27 May 2019 21:34:31 +0000 (21:34 +0000)]
[RuntimeDyld][ARM] Fix an incorrect assertion condition.
Fixes https://llvm.org/PR42036
llvm-svn: 361782
Matt Arsenault [Mon, 27 May 2019 20:37:31 +0000 (20:37 +0000)]
RegAllocFast: Set MayLiveAcrossBlocks when allocating uses
Setting mayLiveOut based only on use instructions after allocating the
def block did not work if the use block was allocated before the def
block, since the virtual register uses were already removed.
Fixes bug 41973.
llvm-svn: 361781
Sanjay Patel [Mon, 27 May 2019 20:26:21 +0000 (20:26 +0000)]
[SelectionDAG] fold concat of extract subvectors
This is derived from the related fold for build vectors.
We also have a version of this in DAGCombiner. The benefit of
having this fold at node creation time is (1) efficiency and
(2) preventing infinite looping from creating patterns that
should not exist in the first place.
Currently, the inf-loop could happen with MergeConsecutiveStores()
because it naively creates concat of extracts when forming a wider
vector store. That could fight with target-specific store narrowing.
llvm-svn: 361780
Volodymyr Sapsai [Mon, 27 May 2019 19:15:30 +0000 (19:15 +0000)]
[Preprocessor] Fix crash emitting note with framework location for "file not found" error.
A filename can be remapped with a header map to point to a framework
header and we can find the corresponding framework without the header.
But if the original filename doesn't have a remapped framework name,
we'll fail to find its location and will dereference a null pointer
during diagnostics emission.
Fix by tracking remappings better and emit the note only if a framework
is found before any of the remappings.
rdar://problem/
48883447
Reviewers: arphaman, erik.pilkington, jkorous
Reviewed By: arphaman
Subscribers: dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D61707
llvm-svn: 361779
Sanjay Patel [Mon, 27 May 2019 18:26:43 +0000 (18:26 +0000)]
[SelectionDAG] fix formatting and redundant comments; NFC
There's a possible missing fold here for extracting from the
same source vector. It's similar to a check that we use to
squash a build vector with all extracted elements from the
same source vector.
llvm-svn: 361778
Michael Liao [Mon, 27 May 2019 18:26:29 +0000 (18:26 +0000)]
[SelectionDAG] Enhance the simplification of `copyto` from `implicit-def`.
Summary:
- The current implementation simplifies the case where the source of
`copyto` is `implicit-def`ed. However, it only works when that
`implicit-def` is single-used since it detects that from
`implicit-def` and cannot determine which destination vreg should be
used if there are multiple uses.
- This patch changes that detection when `copyto` is being emitted. If
that `copyto`'s source is defined from `implicit-def`, it simplifies
it. Hence, it works even that `implicit-def` is multi-used.
- Except it simplifies the internal IR, it won't improve the quality of
code generation. However, it helps to detect 'implicit-def` in a
straight-forward manner in some passes, such as `si-i1-copies`. A test
case is added.
Reviewers: sunfish, nhaehnle
Subscribers: jvesely, hiraditya, asbirlea, llvm-commits, yaxunl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62342
llvm-svn: 361777
Alexander Timofeev [Mon, 27 May 2019 18:17:21 +0000 (18:17 +0000)]
[AMDGPU] Fix for the address sanitizer failure. Fixing typo
llvm-svn: 361776
Jacques Pienaar [Mon, 27 May 2019 17:38:41 +0000 (17:38 +0000)]
NFC: Change usage of 'DenseSet' to 'DenseSetImpl' in DenseSetImpl::ConstIterator.
Summary:
Change usage of 'DenseSet' to 'DenseSetImpl' in a friend declaration within DenseSetImpl::ConstIterator. 'ConstIterator' was never updated when DenseSet was split into an impl when adding support for DenseSetImpl.
This fixes build errors on MSVC when forward declaring DenseSet as this friend decl does not declare the template arguments as well.
Reviewers: jpienaar
Reviewed By: jpienaar
Subscribers: jpienaar, lebedev.ri, dexonsmith, kristina, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62467
llvm-svn: 361775
Dmitri Gribenko [Mon, 27 May 2019 17:03:57 +0000 (17:03 +0000)]
Include what you use in AArch64AsmBackend.cpp
AArch64AsmBackend.cpp was not using any APIs from AArch64.h, and was
only including it for transitive dependencies. Doing so is problematic
from include-what-you-use perspective, but it is also a layering issue
(it creates a dependency cycle between the primary AArch64 target
library and the MCTargetDesc library).
llvm-svn: 361774
Simon Pilgrim [Mon, 27 May 2019 16:39:25 +0000 (16:39 +0000)]
[SelectionDAG] GetDemandedBits - add demanded elements wrapper implementation
The DemandedElts variable is pretty much inert at the moment - the original GetDemandedBits implementation calls it with an 'all ones' DemandedElts value so the function is active and behaves exactly as it used to.
llvm-svn: 361773
Simon Pilgrim [Mon, 27 May 2019 16:33:15 +0000 (16:33 +0000)]
[LLParser] Fix uninitialized flag variable warnings. NFCI.
Fixes a large number of warnings in the scan-build report on llvm builds.
llvm-svn: 361772
Kadir Cetinkaya [Mon, 27 May 2019 16:20:45 +0000 (16:20 +0000)]
[clang] Respect TerseOutput when printing lambdas
Reviewers: ilya-biryukov, hokein, sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62487
llvm-svn: 361771
Alexander Timofeev [Mon, 27 May 2019 15:03:29 +0000 (15:03 +0000)]
[AMDGPU] Fix for the address sanitizer failure caused by the ifollowing commit:
1a8b2ea611cf4ca7cb09562e0238cfefa27c05b5 Divergence driven ISel. Assign register class for cross block values according to the divergence.
llvm-svn: 361770
Aaron Ballman [Mon, 27 May 2019 14:34:31 +0000 (14:34 +0000)]
When dumping the AST to JSON, dump the type information from a typeid expression with a type operand.
llvm-svn: 361769
Aaron Ballman [Mon, 27 May 2019 14:29:10 +0000 (14:29 +0000)]
When dumping the AST to JSON, dump whether a function is variadic or not.
llvm-svn: 361768
Aaron Ballman [Mon, 27 May 2019 14:25:04 +0000 (14:25 +0000)]
When dumping the AST to JSON, dump the declared name of a MemberExpr operand.
llvm-svn: 361767
Aaron Ballman [Mon, 27 May 2019 14:17:32 +0000 (14:17 +0000)]
When dumping the AST to JSON, dump the argument name to a sizeof pack expression.
llvm-svn: 361766
Pavel Labath [Mon, 27 May 2019 14:16:15 +0000 (14:16 +0000)]
DWARFDebugArangeSet: Remove references to SymbolFileDWARF
This class does not depend on SymbolFileDWARF. Instead, include more
appropriate low-level headers.
llvm-svn: 361765
Aaron Ballman [Mon, 27 May 2019 14:12:48 +0000 (14:12 +0000)]
Add test cases for dumping AST expression nodes to JSON; NFC.
llvm-svn: 361764
Dmitry Preobrazhensky [Mon, 27 May 2019 14:08:43 +0000 (14:08 +0000)]
[AMDGPU][MC] Enabled constant expressions as operands of s_waitcnt
See bug 40820: https://bugs.llvm.org/show_bug.cgi?id=40820
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D61017
llvm-svn: 361763
Xing Xue [Mon, 27 May 2019 13:57:28 +0000 (13:57 +0000)]
[MustExecute] Improve MustExecute to correctly handle loop nest
Summary:
for.outer:
br for.inner
for.inner:
LI <loop invariant load instruction>
for.inner.latch:
br for.inner, for.outer.latch
for.outer.latch:
br for.outer, for.outer.exit
LI is a loop invariant load instruction that post dominate for.outer, so LI should be able to move out of the loop nest. However, there is a bug in allLoopPathsLeadToBlock().
Current algorithm of allLoopPathsLeadToBlock()
1. get all the transitive predecessors of the basic block LI belongs to (for.inner) ==> for.outer, for.inner.latch
2. if any successors of any of the predecessors are not for.inner or for.inner's predecessors, then return false
3. return true
Although for.inner.latch is for.inner's predecessor, but for.inner dominates for.inner.latch, which means if for.inner.latch is ever executed, for.inner should be as well. It should not return false for cases like this.
Author: Whitney (committed by xingxue)
Reviewers: kbarton, jdoerfert, Meinersbur, hfinkel, fhahn
Reviewed By: jdoerfert
Subscribers: hiraditya, jsji, llvm-commits, etiotto, bmahjour
Tags: #LLVM
Differential Revision: https://reviews.llvm.org/D62418
llvm-svn: 361762
Nikola Prica [Mon, 27 May 2019 13:51:30 +0000 (13:51 +0000)]
Test commit (NFC)
Add blank line.
llvm-svn: 361761
Pavel Labath [Mon, 27 May 2019 13:43:01 +0000 (13:43 +0000)]
XFAIL prefer-debug-over-eh-frame.test on darwin
debug_frame does not seem to work on darwin, so there is nothing to
prefer.
Adding `-g` to the compiler command line is enough to get the
__debug_frame section added to the dsym file. Though lldb then finds the
section, and correctly assigns the section type to it, this does not
seem to be enough to get lldb to actually use this section for
unwinding.
llvm-svn: 361760
Pavel Labath [Mon, 27 May 2019 13:23:23 +0000 (13:23 +0000)]
DWARF: Add a simple test exercising debug_loc parsing
llvm-svn: 361759
Pavel Labath [Mon, 27 May 2019 11:53:24 +0000 (11:53 +0000)]
FuncUnwinders: prefer debug_frame over eh_frame
The two sections usually contain the same information, and we rarely
have both kinds of entries for a single function. However, in theory the
debug_frame plan can be more complete, whereas eh_frame is only required
to be correct at places where exceptions can be thrown.
Reviewers: jasonmolenda, clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D62374
llvm-svn: 361758
Yaxun Liu [Mon, 27 May 2019 11:19:07 +0000 (11:19 +0000)]
[OpenCL] Fix file-scope const sampler variable for 2.0
OpenCL spec v2.0 s6.13.14:
Samplers can also be declared as global constants in the program
source using the following syntax.
const sampler_t <sampler name> = <value>
This works fine for OpenCL 1.2 but fails for 2.0, because clang duduces
address space of file-scope const sampler variable to be in global address
space whereas spec v2.0 s6.9.b forbids file-scope sampler variable to be
in global address space.
The fix is not to deduce address space for file-scope sampler variables.
Differential Revision: https://reviews.llvm.org/D62197
llvm-svn: 361757
Diana Picus [Mon, 27 May 2019 10:32:34 +0000 (10:32 +0000)]
[ARM GlobalISel] Un-XFAIL some tests. NFC
It turns out we support big endian now (probably since r332449, but I
haven't bisected to confirm).
llvm-svn: 361756
Diana Picus [Mon, 27 May 2019 10:30:33 +0000 (10:30 +0000)]
[ARM GlobalISel] Cleanup CallLowering a bit
We never actually use the Offsets produced by ComputeValueVTs, so remove
them until we need them.
llvm-svn: 361755
Pavel Labath [Mon, 27 May 2019 10:10:59 +0000 (10:10 +0000)]
DWARF: Remove cu_idx variables from parsing functions
These variables were useful when looking up the compile unit index
required a binary search. Now that we can look up a compile unit index
in constant time, they are no longer needed.
llvm-svn: 361754
Ilya Biryukov [Mon, 27 May 2019 09:52:09 +0000 (09:52 +0000)]
[CodeComplete] Complete 'return true/false' in boolean functions
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62391
llvm-svn: 361753
Balazs Keri [Mon, 27 May 2019 09:36:00 +0000 (09:36 +0000)]
[ASTImporter] Added visibility context check for CXXRecordDecl.
Summary:
ASTImporter makes now difference between classes with same name in different
translation units if these are not visible outside. These classes are not linked
into one decl chain.
Reviewers: martong, a.sidorin, shafik
Reviewed By: shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62312
llvm-svn: 361752
Hans Wennborg [Mon, 27 May 2019 09:03:00 +0000 (09:03 +0000)]
Cmake: allow using LLVM_EXTERNAL_PROJECTS with LLVM_ENABLE_PROJECTS
The current code iterates over the combination of LLVM_EXTERNAL_PROJECTS
and LLVM_ENABLE_PROJECTS, but then disables projects that are only in
the former. If a project is in LLVM_EXTERNAL_PROJECTS, it should be
enabled.
See also llvm-commits thread on r354060.
Differential revision: https://reviews.llvm.org/D62289
llvm-svn: 361751
Serge Guelton [Mon, 27 May 2019 08:24:06 +0000 (08:24 +0000)]
Make llvm-as --help great again
This is a follow-up to https://reviews.llvm.org/D60411, but for llvm-as.
New output:
OVERVIEW: llvm .ll -> .bc assembler
USAGE: llvm-as [options] <input .llvm file>
OPTIONS:
Generic Options:
-help - Display available options (-help-hidden for more)
-help-list - Display list of available options (-help-list-hidden for more)
-version - Display the version of this program
llvm-as Options:
-data-layout=<layout-string> - data layout string to use
-disable-output - Disable output
-f - Enable binary output on terminals
-module-hash - Emit module hash
-o=<filename> - Override output filename
Differential Revision: https://reviews.llvm.org/D60603
llvm-svn: 361750
Haojian Wu [Mon, 27 May 2019 08:09:02 +0000 (08:09 +0000)]
[clang-tidy] Fix unused-variable warning after r361647.
Summary:
A range-for was added in r361647 where the range variable was only used in an
assertion. As a result, it warned for Release builds. This revision
restructures the assertion to avoid the problem.
Patch by Yitzhak Mandelbaum.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D62412
llvm-svn: 361749
Djordje Todorovic [Mon, 27 May 2019 07:48:28 +0000 (07:48 +0000)]
[test commit] Add my name to the CREDITS.TXT
This is my test commit. (NFC)
llvm-svn: 361748
Rui Ueyama [Mon, 27 May 2019 07:26:13 +0000 (07:26 +0000)]
Remove elf::createSharedFile and move its code to SharedFile's ctor. NFC.
llvm-svn: 361747
David L. Jones [Mon, 27 May 2019 06:00:00 +0000 (06:00 +0000)]
Revert r361356: "[MIR] Add simple PRE pass to MachineCSE"
This is problematic on buildbots, as discussed here: https://reviews.llvm.org/rL361356
It seems like the plan already was to revert, but that hasn't happened yet.
llvm-svn: 361746
Craig Topper [Mon, 27 May 2019 05:27:57 +0000 (05:27 +0000)]
[X86] Add test cases for D62444. NFC
llvm-svn: 361745
Nico Weber [Mon, 27 May 2019 00:48:59 +0000 (00:48 +0000)]
llvm-undname: Make demangling of MD5 names more robust
Demangler::parse() for MD5 names would:
1. Put all remaining text into the MD5 name sight unseen
2. Not modify MangledName
This meant that if the demangler recursively called parse() (e.g. in
demangleLocallyScopedNamePiece()), every recursive call that started on
an MD5 name would add all remaining bytes to the output buffer but
only advance the input by a byte. For valid inputs, MD5 types are
never (well, see comments for 2 exceptions) nested, but for invalid
input this could cause memory use quadratic in the input size.
llvm-svn: 361744
Florian Hahn [Sun, 26 May 2019 23:38:25 +0000 (23:38 +0000)]
[LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches.
The code to preserve LCSSA PHIs currently only properly supports
reduction PHIs and PHIs for values defined outside the latches.
This patch improves the LCSSA PHI handling to cover PHIs for values
defined in the latches.
Fixes PR41725.
Reviewers: efriedma, mcrosier, davide, jdoerfert
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D61576
llvm-svn: 361743
Yonghong Song [Sun, 26 May 2019 21:26:06 +0000 (21:26 +0000)]
[BPF] generate R_BPF_NONE relocation for BTF DataSec variables
The variables in BTF DataSec type encode in-section offset.
R_BPF_NONE should be generated instead of R_BPF_64_32.
Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D62460
llvm-svn: 361742
Alexander Timofeev [Sun, 26 May 2019 20:33:26 +0000 (20:33 +0000)]
[AMDGPU] Divergence driven ISel. Assign register class for cross block values according to the divergence.
Details: To make instruction selection really divergence driven it is necessary to assign
the correct register classes to the cross block values beforehand. For the divergent targets
same value type requires different register classes dependent on the value divergence.
Reviewers: rampitec, nhaehnle
Differential Revision: https://reviews.llvm.org/D59990
This commit was reverted because of the build failure.
The reason was mlformed patch.
Build failure fixed.
llvm-svn: 361741
Andrea Di Biagio [Sun, 26 May 2019 19:50:31 +0000 (19:50 +0000)]
[MCA][Scheduler] Improved critical memory dependency computation.
This fixes a problem where back-pressure increases caused by register
dependencies were not correctly notified if execution was also delayed by memory
dependencies.
llvm-svn: 361740
Simon Pilgrim [Sun, 26 May 2019 18:58:14 +0000 (18:58 +0000)]
[SelectionDAG] GetDemandedBits - cleanup to more closely match SimplifyDemandedBits. NFCI.
Prep work before adding demanded elts support.
llvm-svn: 361739
Simon Pilgrim [Sun, 26 May 2019 18:43:44 +0000 (18:43 +0000)]
[SelectionDAG] MaskedValueIsZero - add demanded elements implementation
Will be used in an upcoming patch but I've updated the original implementation to call this to ensure test coverage.
llvm-svn: 361738
Andrea Di Biagio [Sun, 26 May 2019 18:41:35 +0000 (18:41 +0000)]
[MCA] Refactor the logic that computes the critical memory dependency info. NFCI
CriticalRegDep has been renamed CriticalDependency, and it is now used by class
Instruction to store information about the critical register dependency and the
critical memory dependency. No functional change intendend.
llvm-svn: 361737
Shawn Landden [Sun, 26 May 2019 18:15:51 +0000 (18:15 +0000)]
[SimplifyCFG] back out all SwitchInst commits
They caused the sanitizer builds to fail.
My suspicion is the change the countLeadingZeros().
llvm-svn: 361736
Mads Ravn [Sun, 26 May 2019 17:00:38 +0000 (17:00 +0000)]
DeleteNullPointerCheck now deletes until the end brace of the condition.
Patch by Jonathan Camilleri
Differential Revision https://reviews.llvm.org/D61861
llvm-svn: 361735
Simon Pilgrim [Sun, 26 May 2019 16:00:35 +0000 (16:00 +0000)]
[X86][SSE] Add shuffle combining support for ISD::ANY_EXTEND_VECTOR_INREG
Reuses what we already have in place for ISD::ZERO_EXTEND_VECTOR_INREG just with a different sentinel
llvm-svn: 361734
Shawn Landden [Sun, 26 May 2019 15:29:10 +0000 (15:29 +0000)]
[SimplifyCFG] NFC, one more fixed test from previous push.
The old test was checking for a stupid subtract one that is a transform that
makes the code woorse.
The constant-islands-jump-table.ll test wants the code a specific way,
that makes sense, so I will submit code to fix that one.
Sorry that I really didn't know how to run the test suite before this.
llvm-svn: 361733
Simon Pilgrim [Sun, 26 May 2019 15:08:45 +0000 (15:08 +0000)]
Revert rL361731 : [LLParser] Fix uninitialized variable warnings. NFCI.
These 3 variables cause quite a few warnings in the scan-build report on llvm.
........
Revert accidental commit.
llvm-svn: 361732
Simon Pilgrim [Sun, 26 May 2019 15:05:12 +0000 (15:05 +0000)]
[LLParser] Fix uninitialized variable warnings. NFCI.
These 3 variables cause quite a few warnings in the scan-build report on llvm.
llvm-svn: 361731