Sanjay Patel [Thu, 28 Jun 2018 20:52:43 +0000 (20:52 +0000)]
[InstCombine] fix opcode check in shuffle fold
There's no way to expose this difference currently,
but we should use the updated variable because the
original opcodes can go stale if we transform into
something new.
llvm-svn: 335920
Petr Hosek [Thu, 28 Jun 2018 20:33:18 +0000 (20:33 +0000)]
[CMake] Don't build Linux targets on Darwin in Fuchsia toolchain
This is currently breaking because Linux target sysroots rely on
case sensitive filesystem which is not by default enabled on macOS.
Differential Revision: https://reviews.llvm.org/D48710
llvm-svn: 335919
Martin Storsjo [Thu, 28 Jun 2018 20:28:29 +0000 (20:28 +0000)]
[COFF] Fix constant sharing regression for MinGW
This fixes a regression since SVN r334523, where the object files
built targeting MinGW were rejected by GNU binutils tools. Prior to
that commit, we only put constants in comdat for MSVC configurations.
Differential Revision: https://reviews.llvm.org/D48567
llvm-svn: 335918
Petr Hosek [Thu, 28 Jun 2018 20:19:11 +0000 (20:19 +0000)]
[CMake] Build static runtimes for host in Fuchsia first stage
First stage build is only a minimal build where we don't need
a complete multiarch support, but we need enough to build the
second stage.
Differential Revision: https://reviews.llvm.org/D48707
llvm-svn: 335917
Pirama Arumuga Nainar [Thu, 28 Jun 2018 20:16:45 +0000 (20:16 +0000)]
Configure ELAST for MinGW
Summary:
Use _LIBCPP_MSVCRT_LIKE while configuring ELAST, so MinGW gets the same
configuration as MSVC.
Reviewers: compnerd, srhines, danalbert, mstorsjo
Subscribers: christof, ldionne, cfe-commits
Differential Revision: https://reviews.llvm.org/D48731
llvm-svn: 335916
Zachary Turner [Thu, 28 Jun 2018 20:09:37 +0000 (20:09 +0000)]
Fix padding with custom character in formatv.
The format string for formatv allows to specify a custom padding
character instead of the default space. This custom character was
parsed correctly, but not passed on to the formatter.
Patch by Marcel Köppe
Differential Revision: https://reviews.llvm.org/D48140
llvm-svn: 335915
Teresa Johnson [Thu, 28 Jun 2018 20:07:47 +0000 (20:07 +0000)]
[ThinLTO] Port InlinerFunctionImportStats handling to new PM
Summary:
The InlinerFunctionImportStats will collect and dump stats regarding how
many function inlined into the module were imported by ThinLTO.
Reviewers: wmi, dexonsmith
Subscribers: mehdi_amini, inglorion, llvm-commits, eraman
Differential Revision: https://reviews.llvm.org/D48729
llvm-svn: 335914
Benjamin Kramer [Thu, 28 Jun 2018 20:05:35 +0000 (20:05 +0000)]
[NVPTX] Delete dead code
No functionality change.
llvm-svn: 335913
Jim Ingham [Thu, 28 Jun 2018 20:02:11 +0000 (20:02 +0000)]
Add a way to load an image using a library name and list of paths.
This provides an efficient (at least on Posix platforms) way to offload to the
target process the search & loading of a library when all we have are the
library name and a set of potential candidate locations.
<rdar://problem/
40905971>
llvm-svn: 335912
Joel E. Denny [Thu, 28 Jun 2018 19:54:49 +0000 (19:54 +0000)]
[OPENMP] Fix incomplete type check for array reductions
A reduction for an incomplete array type used to produce an assert
fail during codegen. Now it produces a diagnostic.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D48735
llvm-svn: 335911
Joel E. Denny [Thu, 28 Jun 2018 19:54:27 +0000 (19:54 +0000)]
Revert r335907: [OPENMP] Fix incomplete type check for array reductions
Sorry, forgot to add commit log attributes again.
llvm-svn: 335910
Eli Friedman [Thu, 28 Jun 2018 19:53:12 +0000 (19:53 +0000)]
[ARM] Add missing Thumb2 assembler diagnostics.
Mostly just adding checks for Thumb2 instructions which correspond to
ARM instructions which already had diagnostics. While I'm here, also fix
ARM-mode strd to check the input registers correctly.
Differential Revision: https://reviews.llvm.org/D48610
llvm-svn: 335909
Sterling Augustine [Thu, 28 Jun 2018 19:47:23 +0000 (19:47 +0000)]
Some targets don't have lld built, so just use a binary copy
of the input file.
llvm-svn: 335908
Joel E. Denny [Thu, 28 Jun 2018 19:46:10 +0000 (19:46 +0000)]
[OPENMP] Fix incomplete type check for array reductions
A reduction for an incomplete array type used to produce an assert
fail during codegen. Now it produces a diagnostic.
llvm-svn: 335907
Stella Stamenova [Thu, 28 Jun 2018 19:42:30 +0000 (19:42 +0000)]
[lldbsuite] Fix TestBreakpointHitCount on Windows
Summary: On Windows, the newer DIA SDKs end up producing function names that contain the return type as well. This means that the function name returned in the test will contain the return type (int) in addition to the name of the function and the type of the input (a(int)). To account for the possibility of both, the test should pass if the function name matches either pattern.
Reviewers: zturner, asmith
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48654
llvm-svn: 335906
Raphael Isemann [Thu, 28 Jun 2018 19:34:49 +0000 (19:34 +0000)]
Added test case for: r334978 - Fixed file completion for paths that start with '~'
Reviewers: labath
Reviewed By: labath
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D48665
llvm-svn: 335905
Anastasis Grammenos [Thu, 28 Jun 2018 18:58:30 +0000 (18:58 +0000)]
[SROA] Preserve DebugLoc when rewriting alloca partitions
When rewriting an alloca partition copy the DL from the
old alloca over the the new one.
Differential Revision: https://reviews.llvm.org/D48640
llvm-svn: 335904
Sterling Augustine [Thu, 28 Jun 2018 18:57:13 +0000 (18:57 +0000)]
Handle absolute symbols as branch targets in disassembly.
https://reviews.llvm.org/D48554
llvm-svn: 335903
Zachary Turner [Thu, 28 Jun 2018 18:49:09 +0000 (18:49 +0000)]
Add a flag to FileOutputBuffer that allows modification.
FileOutputBuffer creates a temp file and on commit atomically
renames the temp file to the destination file. Sometimes we
want to modify an existing file in place, but still have the
atomicity guarantee. To do this we can initialize the contents
of the temp file from the destination file (if it exists), that
way the resulting FileOutputBuffer can have only selective
bytes modified. Committing will then atomically replace the
destination file as desired.
llvm-svn: 335902
Simon Pilgrim [Thu, 28 Jun 2018 18:37:16 +0000 (18:37 +0000)]
Remove unnecessary semicolon. NFCI.
Fixes -Wpedantic warning.
llvm-svn: 335901
Justin Bogner [Thu, 28 Jun 2018 18:36:52 +0000 (18:36 +0000)]
[CMake] Respect CMAKE_STRIP and CMAKE_DSYMUTIL on apple platforms
This allows overriding the strip and dsymutil tools, and updates
iOS.cmake to do so. I've also added libtool to iOS.cmake, but it was
already respecting CMAKE_LIBTOOL if set.
llvm-svn: 335900
Ahmed Bougacha [Thu, 28 Jun 2018 18:35:35 +0000 (18:35 +0000)]
[CMake] Rename cxx_headers back to cxx-headers.
r334477 renamed the cxx-headers target to cxx_headers, but various
pieces sort-of expect the target names to match the component (e.g.,
LLVM_DISTRIBUTION_COMPONENTS in the various bootstrap caches, which, via
some magic foreign to me, seems to expect cxx-headers,
install-cxx-headers, and install-cxx-headers-stripped to exist.)
Revert back to cxx-headers.
Differential Revision: https://reviews.llvm.org/D48701
llvm-svn: 335899
Ahmed Bougacha [Thu, 28 Jun 2018 18:35:25 +0000 (18:35 +0000)]
[CMake] Make bootstrap and compiler-rt depend on cxx-headers.
Since r334468, we no longer always copy the libcxx headers by virtue of
their presence when cmake runs.
This makes some of the later stages (compiler-rt, and the bootstrapped
stages) depend on them being copied, via the cxx-headers target.
Differential Revision: https://reviews.llvm.org/D48700
llvm-svn: 335898
Vedant Kumar [Thu, 28 Jun 2018 18:21:11 +0000 (18:21 +0000)]
[Debugify] Do not report line 0 locations as errors
The checking logic should not treat artificial locations as being
somehow problematic. Producing these locations can be the desired
behavior of some passes.
See llvm.org/PR37961.
llvm-svn: 335897
Aaron Ballman [Thu, 28 Jun 2018 18:03:00 +0000 (18:03 +0000)]
Set the line ending of clang.natvis to CRLF.
This corresponds to r335889, which does the same thing for llvm.natvis.
llvm-svn: 335896
Craig Topper [Thu, 28 Jun 2018 17:58:01 +0000 (17:58 +0000)]
[X86] Suppress load folding into and/or/xor if it will prevent matching btr/bts/btc.
This is a follow up to r335753. At the time I forgot about isProfitableToFold which makes this pretty easy.
Differential Revision: https://reviews.llvm.org/D48706
llvm-svn: 335895
Jonas Devlieghere [Thu, 28 Jun 2018 17:56:43 +0000 (17:56 +0000)]
Revert "Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models""
Reverting because this is causing failures in the LLDB test suite on
GreenDragon.
LLVM ERROR: unsupported relocation with subtraction expression, symbol
'__GLOBAL_OFFSET_TABLE_' can not be undefined in a subtraction
expression
llvm-svn: 335894
Jonas Devlieghere [Thu, 28 Jun 2018 17:56:27 +0000 (17:56 +0000)]
Revert "[OrcMCJIT] Fix test after r335508 causing it to fail on green dragon"
This reverts commit
a6b904daa1d55e31187c85e5b54ef2ddc37fa713.
llvm-svn: 335893
Zachary Turner [Thu, 28 Jun 2018 17:55:54 +0000 (17:55 +0000)]
2 VS natvis improvements.
Optional<T> was broken due to a change in the class's internals.
That is fixed, and additionally a visualizer is added for
Expected<T>.
llvm-svn: 335892
Vedant Kumar [Thu, 28 Jun 2018 17:53:43 +0000 (17:53 +0000)]
[Darwin] Add an integration test for PGO + symbol exports
rdar://
41470205
llvm-svn: 335891
Vedant Kumar [Thu, 28 Jun 2018 17:53:35 +0000 (17:53 +0000)]
[Darwin] Remove _VPMergeHook from the auto-export list
Remove _VPMergeHook from Darwin's automatically-exported symbol list for
PGO. As of r328987 this symbol is no longer weak.
An integration test in compiler-rt will follow.
rdar://
41470205
llvm-svn: 335890
Zachary Turner [Thu, 28 Jun 2018 17:52:06 +0000 (17:52 +0000)]
Set line ending style of llvm.natvis to CRLF.
This file is used by MSVC which is obviously a Windows-only tool and prefers windows line endings.
llvm-svn: 335889
Sanjay Patel [Thu, 28 Jun 2018 17:48:04 +0000 (17:48 +0000)]
[InstCombine] allow shl+mul combos with shuffle (select) fold (PR37806)
This is an enhancement to D48401 that was discussed in:
https://bugs.llvm.org/show_bug.cgi?id=37806
We can convert a shift-left-by-constant into a multiply (we canonicalize IR in the other
direction because that's generally better of course). This allows us to remove the shuffle
as we do in the regular opcodes-are-the-same cases.
This requires a small hack to make sure we don't introduce any extra poison:
https://rise4fun.com/Alive/ZGv
Other examples of opcodes where this would work are add+sub and fadd+fsub, but we already
canonicalize those subs into adds, so there's nothing to do for those cases AFAICT. There
are planned enhancements for opcode transforms such or -> add.
Note that there's a different fold needed if we've already managed to simplify away a binop
as seen in the test based on PR37806, but we manage to get that one case here because this
fold is positioned above the demanded elements fold currently.
Differential Revision: https://reviews.llvm.org/D48485
llvm-svn: 335888
Jessica Paquette [Thu, 28 Jun 2018 17:45:43 +0000 (17:45 +0000)]
[MachineOutliner] Define MachineOutliner support in TargetOptions
Targets should be able to define whether or not they support the outliner
without the outliner being added to the pass pipeline. Before this, the
outliner pass would be added, and ask the target whether or not it supports the
outliner.
After this, it's possible to query the target in TargetPassConfig, before the
outliner pass is created. This ensures that passing -enable-machine-outliner
will not modify the pass pipeline of any target that does not support it.
https://reviews.llvm.org/D48683
llvm-svn: 335887
Simon Pilgrim [Thu, 28 Jun 2018 17:33:41 +0000 (17:33 +0000)]
[DAGCombiner] Ensure we use the correct CC result type in visitSDIV (REAPPLIED)
We could get away with it for constant folded cases, but not for rL335719.
Thanks to Krzysztof Parzyszek for noticing.
Reapply original commit rL335821 which was reverted at rL335871 due to a WebAssembly bug that was fixed at rL335884.
llvm-svn: 335886
Matt Davis [Thu, 28 Jun 2018 17:33:24 +0000 (17:33 +0000)]
[llvm-mca] Delete Pipeline's copy ctor and assignement operator.
Prevent copying of the Pipeline.
llvm-svn: 335885
Simon Pilgrim [Thu, 28 Jun 2018 17:27:09 +0000 (17:27 +0000)]
[WebAssembly] Add getSetCCResultType placeholder override to handle vector compare results.
Necessary to get the rL335821 bugfix (which was reverted at rL335871) un-reverted.
llvm-svn: 335884
Jessica Paquette [Thu, 28 Jun 2018 17:26:19 +0000 (17:26 +0000)]
Revert "[MachineOutliner] Add always and never options to -enable-machine-outliner"
I accidentally committed this instead of D48683 because I haven't had coffee
yet.
llvm-svn: 335883
Jessica Paquette [Thu, 28 Jun 2018 17:26:18 +0000 (17:26 +0000)]
Revert "[MachineOutliner] Never add the outliner in -O0"
This reverts commit
9c7c10e4073a0bc6a759ce5cd33afbac74930091.
It relies on r335872 since that introduces the machine outliner
flags test. I meant to commit D48683 in that commit, but got mixed
up and committed D48682 instead. So, I'm reverting this and
r335872, since D48682 hasn't made it through review yet.
llvm-svn: 335882
Sam Clegg [Thu, 28 Jun 2018 17:21:46 +0000 (17:21 +0000)]
[WebAssembly] Fix --export of LTO symbols
Differential Revision: https://reviews.llvm.org/D48697
llvm-svn: 335881
Artem Belevich [Thu, 28 Jun 2018 17:15:52 +0000 (17:15 +0000)]
[CUDA] Place all CUDA sections in __NV_CUDA segment on Mac.
That's where CUDA binaries appear to put them.
Differential Revision: https://reviews.llvm.org/D48615
llvm-svn: 335880
Jessica Paquette [Thu, 28 Jun 2018 17:05:57 +0000 (17:05 +0000)]
[MachineOutliner] Never add the outliner in -O0
We shouldn't add the outliner when compiling at -O0 even if
-enable-machine-outliner is passed in. This makes sure that we
don't add it in this case.
This also updates machine-outliner-flags to reflect the change
and improves the comment describing what that test does.
llvm-svn: 335879
Sam Clegg [Thu, 28 Jun 2018 17:04:58 +0000 (17:04 +0000)]
[WebAssembly] Add support for bitcode archive members
This change effects the behavior of --export-all. Previously
--export-all would only effect symbols that survived GC. Now
--export-all will prevent any non-local symbols from being GCed.
Differential Revision: https://reviews.llvm.org/D48673
llvm-svn: 335878
Matthias Braun [Thu, 28 Jun 2018 17:00:45 +0000 (17:00 +0000)]
SelectionDAGBuilder, mach-o: Skip trap after noreturn call (for Mach-O)
Add NoTrapAfterNoreturn target option which skips emission of traps
behind noreturn calls even if TrapUnreachable is enabled.
Enable the feature on Mach-O to save code size; Comments suggest it is
not possible to enable it for the other users of TrapUnreachable.
rdar://
41530228
DifferentialRevision: https://reviews.llvm.org/D48674
llvm-svn: 335877
Krasimir Georgiev [Thu, 28 Jun 2018 16:58:24 +0000 (16:58 +0000)]
[clang-format] Do not format raw string literals inside a recognized function with a non-recognized delimiter
Summary:
This stops clang-format from touching raw string contents with unrecognized delimiters inside recognized functions.
Unrecognized delimiters signal that the string might be special.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48728
llvm-svn: 335876
Sam Clegg [Thu, 28 Jun 2018 16:53:53 +0000 (16:53 +0000)]
[WebAssembly] LTO: Fix signatures of undefined functions in bitcode
Function symbols that come from bitcode have not signatures.
After LTO when the real symbols are read in we need to make
sure that we set the signature on the existing symbol.
the signature-less undefined functions.
Differential Revision: https://reviews.llvm.org/D48693
llvm-svn: 335875
Eric Liu [Thu, 28 Jun 2018 16:51:12 +0000 (16:51 +0000)]
[clangd] Use log10 instead of the natural logrithm for usage boost.
llvm-svn: 335874
Kuba Mracek [Thu, 28 Jun 2018 16:43:43 +0000 (16:43 +0000)]
Skip building TSan on platforms where there are no 64-bit architectures.
llvm-svn: 335873
Jessica Paquette [Thu, 28 Jun 2018 16:39:42 +0000 (16:39 +0000)]
[MachineOutliner] Add always and never options to -enable-machine-outliner
To enable the MachineOutliner by default on AArch64, we need to be able to
disable the MachineOutliner and also provide an option to "always" enable the
outliner.
This adds that capability. It allows the user to still use the old
-enable-machine-outliner option, which defaults to "always". This is building
up to allowing the user to specify "always" versus the target-default
outlining behaviour.
llvm-svn: 335872
Haojian Wu [Thu, 28 Jun 2018 16:25:57 +0000 (16:25 +0000)]
Revert "[DAGCombiner] Ensure we use the correct CC result type in visitSDIV"
This reverts commit r335821.
This crashes the webassembly test, run "ninja check-llvm-codegen-webassembly" to reproduce.
llvm-svn: 335871
Simon Pilgrim [Thu, 28 Jun 2018 16:24:13 +0000 (16:24 +0000)]
[llvm-mca][x86] Add FMA4 resource tests
We should be ensuring we have (near) complete test coverage of instructions, at least for the generic model.
llvm-svn: 335870
Simon Pilgrim [Thu, 28 Jun 2018 16:21:22 +0000 (16:21 +0000)]
[llvm-mca][x86] Add 3dnow! resource tests
We should be ensuring we have (near) complete test coverage of instructions, at least for the generic model.
llvm-svn: 335869
Stanislav Mekhanoshin [Thu, 28 Jun 2018 15:59:18 +0000 (15:59 +0000)]
[AMDGPU] Early expansion of 32 bit udiv/urem
This allows hoisting of a common code, for instance if denominator
is loop invariant. Current change is expansion only, adding licm to
the target pass list going to be a separate patch. Given this patch
changes to codegen are minor as the expansion is similar to that on
DAG. DAG expansion still must remain for R600.
Differential Revision: https://reviews.llvm.org/D48586
llvm-svn: 335868
Andrea Di Biagio [Thu, 28 Jun 2018 15:50:26 +0000 (15:50 +0000)]
[llvm-mca] Use a WriteRef to describe register writes in class RegisterFile.
This patch introduces a new class named WriteRef. A WriteRef is used by the
RegisterFile to keep track of register definitions. Internally it wraps a
WriteState, as well as the source index of the defining instruction.
This patch allows the tool to propagate additional information to support future
analysis on data dependencies.
llvm-svn: 335867
Stanislav Mekhanoshin [Thu, 28 Jun 2018 15:24:46 +0000 (15:24 +0000)]
[AMDGPU] Overload llvm.amdgcn.fmad.ftz to support f16
Differential Revision: https://reviews.llvm.org/D48677
llvm-svn: 335866
Haojian Wu [Thu, 28 Jun 2018 15:24:34 +0000 (15:24 +0000)]
Correct the test modified in rL335777.
llvm-svn: 335865
Bob Haarman [Thu, 28 Jun 2018 15:22:40 +0000 (15:22 +0000)]
lld-link: align sections to 16 bytes if referenced from the gfids table
Summary:
Control flow guard works best when targets it checks are 16-byte aligned.
Microsoft's link.exe helps ensure this by aligning code from sections
that are referenced from the gfids table to 16 bytes when linking with
-guard:cf, even if the original section specifies a smaller alignment.
This change implements that behavior in lld-link.
See https://crbug.com/857012 for more details.
Reviewers: ruiu, hans, thakis, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48690
llvm-svn: 335864
Alexander Kornienko [Thu, 28 Jun 2018 15:21:25 +0000 (15:21 +0000)]
[clang-tidy] misc-unused-parameters - retain old behavior under StrictMode
Summary: This addresses https://bugs.llvm.org/show_bug.cgi?id=37467.
Reviewers: klimek, ilya-biryukov, lebedev.ri, aaron.ballman
Reviewed By: lebedev.ri, aaron.ballman
Subscribers: aaron.ballman, lebedev.ri, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D46951
llvm-svn: 335863
John Brawn [Thu, 28 Jun 2018 15:17:07 +0000 (15:17 +0000)]
[PhiValues] Adjust unit test to invalidate instructions before deleting them
This should fix a sanitizer buildbot failure.
llvm-svn: 335862
Alexey Bataev [Thu, 28 Jun 2018 15:14:58 +0000 (15:14 +0000)]
[DEBUG_INFO, NVPTX] Add test for .debug_loc section, NFC.
llvm-svn: 335861
Jonas Devlieghere [Thu, 28 Jun 2018 15:01:42 +0000 (15:01 +0000)]
[dsymutil] Use UnitListTy consistently (NFC)
Use the UnitListTy typedef consistently throughout the Dwarf linker and
pass it by const reference where possible.
llvm-svn: 335860
Pavel Labath [Thu, 28 Jun 2018 14:23:04 +0000 (14:23 +0000)]
Skip core file tests on build configurations lacking necessary components
Summary:
To successfully open a core file, we need to have LLVM built with
support for the relevant target. Right now, if one does not have the
appropriate targets configured, the tests will fail.
This patch uses the GetBuildConfiguration SB API to inform the test (and
anyone else who cares) about the list of supported LLVM targets. The
test then uses this information to approriately skip the tests.
Reviewers: clayborg, jingham
Subscribers: martong, lldb-commits
Differential Revision: https://reviews.llvm.org/D48641
llvm-svn: 335859
Filipe Cabecinhas [Thu, 28 Jun 2018 14:16:13 +0000 (14:16 +0000)]
Fix test that was failing on Windows due to too many backslashes
llvm-svn: 335858
John Brawn [Thu, 28 Jun 2018 14:13:06 +0000 (14:13 +0000)]
Add a PhiValuesAnalysis pass to calculate the underlying values of phis
This pass is being added in order to make the information available to BasicAA,
which can't do caching of this information itself, but possibly this information
may be useful for other passes.
Incorporates code based on Daniel Berlin's implementation of Tarjan's algorithm.
Differential Revision: https://reviews.llvm.org/D47893
llvm-svn: 335857
David Carlier [Thu, 28 Jun 2018 13:49:41 +0000 (13:49 +0000)]
OpenBSD driver needs ld.lld in sanitizer context
Base GNU ld is pretty ancient and does not support --dynamic-list flag.
For conveniency, we can it automatically when compile with ubsan sanitizer flag.
Reviewers: dberris
Reviewed by: dberris
Differential Revision: https://reviews.llvm.org/D48574
llvm-svn: 335856
George Rimar [Thu, 28 Jun 2018 13:46:49 +0000 (13:46 +0000)]
[ELF] - EhFrame.cpp: add test case to check "CIE is too small" error message.
The following line of code was untested:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L94
Patch adds a test case.
llvm-svn: 335855
Benjamin Kramer [Thu, 28 Jun 2018 13:31:36 +0000 (13:31 +0000)]
Fix unittest build with GCC older than 5.
Old GCCs have an annoying bug where RVO disables the automatic
conversion to base for unique_ptr. Add a pessimizing std::move as a
workaround.
llvm-svn: 335854
Vassil Vassilev [Thu, 28 Jun 2018 13:28:44 +0000 (13:28 +0000)]
[ODRHash] Do not rely on Type* when computing the hash.
ODRHash aims to provide Cross-TU stable hashing. Making clang::Type pointer
part of the hash connects (remotely) the ODRHash with the TU-specific
::Profile hasher.
r332281 exposed the issue by changing the way the ASTContext different
elaborated types if there is an owning tag. In that case, ODRHash stores two
different types in its TypeMap which yields false ODR violation in modules.
The current state of implementation shouldn't need the TypeMap concept
anymore. Rip it out.
Differential Revision: https://reviews.llvm.org/D48524
llvm-svn: 335853
George Rimar [Thu, 28 Jun 2018 13:24:39 +0000 (13:24 +0000)]
[ELF] - EhFrame.cpp: add test case to cover "corrupted CIE" error message.
This is to test the following line that was uncovered by LLD test cases yet:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L149
llvm-svn: 335852
Benjamin Kramer [Thu, 28 Jun 2018 13:15:03 +0000 (13:15 +0000)]
Revert "Add support for generating a call graph profile from Branch Frequency Info."
This reverts commits r335794 and r335797. Breaks ThinLTO+FDO selfhost.
llvm-svn: 335851
Sjoerd Meijer [Thu, 28 Jun 2018 12:55:29 +0000 (12:55 +0000)]
[ARM] Parallel DSP Pass
Armv6 introduced instructions to perform 32-bit SIMD operations. The purpose of
this pass is to do some straightforward IR pattern matching to create ACLE DSP
intrinsics, which map on these 32-bit SIMD operations.
Currently, only the SMLAD instruction gets recognised. This instruction
performs two multiplications with 16-bit operands, and stores the result in an
accumulator. We will follow this up with patches to recognise SMLAD in more
cases, and also to generate other DSP instructions (like e.g. SADD16).
Patch by: Sam Parker and Sjoerd Meijer
Differential Revision: https://reviews.llvm.org/D48128
llvm-svn: 335850
George Rimar [Thu, 28 Jun 2018 12:46:56 +0000 (12:46 +0000)]
[ELF] - EhFrame.cpp: add test case to cover "DW_EH_PE_aligned encoding is not supported" error.
It is https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L144,
and we had no test case to cover it.
llvm-svn: 335849
Filipe Cabecinhas [Thu, 28 Jun 2018 12:38:43 +0000 (12:38 +0000)]
Fix warning on MSVC by using size_t arithmetic instead of casting after the fact. NFC
llvm-svn: 335848
George Rimar [Thu, 28 Jun 2018 12:20:04 +0000 (12:20 +0000)]
[ELF] - EhFrame.cpp: add test case to check "unknown FDE encoding".
It's https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L147 line,
which was untested before this patch.
llvm-svn: 335847
Alexander Kornienko [Thu, 28 Jun 2018 12:18:42 +0000 (12:18 +0000)]
Remove explicit type from an initializer list. NFC.
llvm-svn: 335846
Alexander Kornienko [Thu, 28 Jun 2018 12:15:17 +0000 (12:15 +0000)]
Fix formatting. NFC.
llvm-svn: 335845
Pavel Labath [Thu, 28 Jun 2018 12:10:21 +0000 (12:10 +0000)]
Revert "ADT: Move ArrayRef comparison operators into the class"
This reverts commit r335839, because it breaks the MSVC build.
llvm-svn: 335844
Aaron Ballman [Thu, 28 Jun 2018 12:05:40 +0000 (12:05 +0000)]
The :option: syntax was generating Sphinx build warnings; switched to double backticks to silence the warning; NFC.
llvm-svn: 335843
Aaron Ballman [Thu, 28 Jun 2018 12:02:38 +0000 (12:02 +0000)]
Correct the code highlighting marker to be Objective-C rather than C++ which fixes a Sphinx build warning; NFC.
llvm-svn: 335842
Aaron Ballman [Thu, 28 Jun 2018 12:00:16 +0000 (12:00 +0000)]
Fix the indentation in this documentation to remove a Sphinx warning; NFC.
llvm-svn: 335841
George Rimar [Thu, 28 Jun 2018 11:58:31 +0000 (11:58 +0000)]
[ELF] - EhFrame: add test case to cover uncovered branch of the code.
This test case adds test for the line that was uncovered previously:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L175
it errors out, but we now can test that we have expected flow,
which is different for CIE of version 1 and CIE of version 3.
llvm-svn: 335840
Pavel Labath [Thu, 28 Jun 2018 11:45:28 +0000 (11:45 +0000)]
ADT: Move ArrayRef comparison operators into the class
Summary:
This allows the implicit ArrayRef conversions to kick in when e.g.
comparing ArrayRef to a SmallVector.
Reviewers: zturner, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48632
llvm-svn: 335839
George Rimar [Thu, 28 Jun 2018 11:35:10 +0000 (11:35 +0000)]
[ELF] - Cover "unknown .eh_frame augmentation string" error.
It was https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L195
and we did not cover it with test.
Patch fixes it.
llvm-svn: 335838
Andrea Di Biagio [Thu, 28 Jun 2018 11:20:14 +0000 (11:20 +0000)]
[llvm-mca] Refactor method RegisterFile::collectWrites(). NFCI
Rather than calling std::find in a loop, just sort the vector and remove
duplicate entries at the end of the function.
Also, move the debug print at the end of the function, and query the
MCRegisterInfo to print register names rather than physreg IDs.
No functional change intended.
llvm-svn: 335837
Ilya Biryukov [Thu, 28 Jun 2018 11:04:45 +0000 (11:04 +0000)]
[clangd] Fix a data race in TUScheduler
By recomputing CompilerInvocation instead of copying it.
The problem was caused by the fact that copies of CompilerInvocation
store references to the shared state (DiagnosticOptions) when copied,
causing data races when two different copies are destroyed from
different threads.
llvm-svn: 335836
Adam Balogh [Thu, 28 Jun 2018 10:58:53 +0000 (10:58 +0000)]
[Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks
Add handling of the begin() funcion of containers to the iterator checkers,
together with the pre- and postfix ++ and -- operators of the iterators. This
makes possible the checking of iterators dereferenced ahead of the begin of the
container.
Differential Revision: https://reviews.llvm.org/D32642
llvm-svn: 335835
Jonas Devlieghere [Thu, 28 Jun 2018 10:56:40 +0000 (10:56 +0000)]
[DebugInfo] Follow-up commit to improve consistency. NFC
Follow-up commit for r335757 to address some inconsistencies.
llvm-svn: 335834
George Rimar [Thu, 28 Jun 2018 10:55:52 +0000 (10:55 +0000)]
[ELF] - Add test case to cover "corrupted CIE (failed to read LEB128)" error.
It is the following line:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L120
We did not cover it yet.
llvm-svn: 335833
Jesper Antonsson [Thu, 28 Jun 2018 10:55:04 +0000 (10:55 +0000)]
Comment change to verify commit rights. NFC.
Summary: Just a silly one-character correction.
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48709
llvm-svn: 335832
Hans Wennborg [Thu, 28 Jun 2018 10:24:38 +0000 (10:24 +0000)]
s/TablesChecked/TableChecked/ after r335823
llvm-svn: 335831
Matt Arsenault [Thu, 28 Jun 2018 10:18:55 +0000 (10:18 +0000)]
AMDGPU: Remove MFI::ABIArgOffset
We have too many mechanisms for tracking the various offsets
used for kernel arguments, so remove one. There's still a lot of
confusion with these because there are two different "implicit"
argument areas located at the beginning and end of the kernarg
segment.
Additionally, the offset was determined based on the memory
size of the split element types. This would break in a future
commit where v3i32 is decomposed into separate i32 pieces.
llvm-svn: 335830
Matt Arsenault [Thu, 28 Jun 2018 10:18:36 +0000 (10:18 +0000)]
AMDGPU: Error on calls from graphics shaders
In principle nothing should stop these from working, but
work is necessary to create an ABI for dealing with the stack
related registers.
llvm-svn: 335829
Matt Arsenault [Thu, 28 Jun 2018 10:18:23 +0000 (10:18 +0000)]
AMDGPU: Fix AMDGPUCodeGenPrepare using uninitialized AMDGPUAS struct
Not sure how this wasn't noticed before.
llvm-svn: 335828
Matt Arsenault [Thu, 28 Jun 2018 10:18:11 +0000 (10:18 +0000)]
AMDGPU: Fix assert on aggregate type kernel arguments
Just fix the crash for now by not doing the optimization since
figuring out how to properly convert the bits for an arbitrary
struct is a pain.
Also fix a crash when there is only an empty struct argument.
llvm-svn: 335827
George Rimar [Thu, 28 Jun 2018 10:12:59 +0000 (10:12 +0000)]
[ELF] - Removed trailing whitespace. NFC.
llvm-svn: 335826
George Rimar [Thu, 28 Jun 2018 10:10:02 +0000 (10:10 +0000)]
[ELF] - Add test case to cover "corrupted CIE (failed to read string)"
It was uncovered by our test cases.
llvm-svn: 335824
Benjamin Kramer [Thu, 28 Jun 2018 10:03:45 +0000 (10:03 +0000)]
Unify sorted asserts to use the existing atomic pattern
These are all benign races and only visible in !NDEBUG. tsan complains
about it, but a simple atomic bool is sufficient to make it happy.
llvm-svn: 335823
Pavel Labath [Thu, 28 Jun 2018 10:03:42 +0000 (10:03 +0000)]
Retrieve a function PDB symbol correctly from nested blocks
Summary:
This patch fixes a problem with retrieving a function symbol by an
address in a nested block. In the current implementation of
ResolveSymbolContext function it retrieves a symbol with
PDB_SymType::None and then checks if found symbol's tag equals to
PDB_SymType::Function. So, if nested block's symbol was found,
ResolveSymbolContext does not resolve a function.
Reviewers: asmith, labath, zturner
Reviewed By: asmith, labath
Differential Revision: https://reviews.llvm.org/D47939
Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com>
llvm-svn: 335822
Simon Pilgrim [Thu, 28 Jun 2018 09:54:28 +0000 (09:54 +0000)]
[DAGCombiner] Ensure we use the correct CC result type in visitSDIV
We could get away with it for constant folded cases, but not for rL335719.
Thanks to Krzysztof Parzyszek for noticing.
llvm-svn: 335821
Florian Hahn [Thu, 28 Jun 2018 09:53:38 +0000 (09:53 +0000)]
[SCCP] Mark CFG as preserved.
SCCP does not change the CFG, so we can mark it as preserved.
Reviewers: dberlin, efriedma, davide
Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D47149
llvm-svn: 335820