Hiroshi Inoue [Wed, 13 Jun 2018 08:25:14 +0000 (08:25 +0000)]
[PowerPC] avoid verification failure due to PowerPC VSX Swap Removal pass
This patch fixes a failure in lnt tests with -verify-machineinstrs option.
When VSX Swap Removal pass swaps two register operands, it did not maintain kill flags associated with operands. This patch swaps flags as well as register number to avoid inconsistent kill flags information.
llvm-svn: 334579
Pavel Labath [Wed, 13 Jun 2018 08:14:27 +0000 (08:14 +0000)]
[DWARF/AccelTable] Remove getDIESectionOffset for DWARF v5 entries
Summary:
This method was not correct for entries in DWO files as it assumed it
could just add up the CU and DIE offsets to get the absolute DIE offset.
This is not correct for the DWO files, as here the CU offset will
reference the skeleton unit, whereas the DIE offset will be the offset
in the full unit in the DWO file.
Unfortunately, this means that we are not able to determine the absolute
DIE offset using the information in the .debug_names section alone,
which means we have to offload some of this work to the users of this
class.
To demonstrate how this can be done, I've added/fixed the ability to
lookup entries using accelerator tables in DWO files in llvm-dwarfdump.
To make this happen, I've needed to make two extra changes in other
classes:
- made the DWARFContext method to lookup a CU based on the section
offset public. I've needed this functionality to lookup a CU, and this
seems like a useful thing in general.
- made DWARFUnit::getDWOId call extractDIEsIfNeeded. Before this, the
DWOId was filled in only if the root DIE happened to be parsed
before we called the accessor. Since the lazy parsing is supposed to
happen under the hood, calling extractDIEsIfNeeded seems appropriate.
Reviewers: JDevlieghere, aprantl, dblaikie
Subscribers: mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D48009
llvm-svn: 334578
Craig Topper [Wed, 13 Jun 2018 07:19:28 +0000 (07:19 +0000)]
[X86] Remove masking from avx512vbmi2 concat and shift by immediate builtins. Use select builtins instead.
llvm-svn: 334577
Craig Topper [Wed, 13 Jun 2018 07:19:21 +0000 (07:19 +0000)]
[X86] Remove masking from avx512vbmi2 concat and shift by immediate intrinsics. Use select in IR instead.
llvm-svn: 334576
Petr Hosek [Wed, 13 Jun 2018 07:08:28 +0000 (07:08 +0000)]
[XRay] Set an explicit dependency on libc++ when needed
When XRay is being built as part of the just built compiler together
with libc++ as part of the runtimes build, we need an explicit
dependency from XRay to libc++ to make sure that the library is
available by the time we start building XRay.
Differential Revision: https://reviews.llvm.org/D48113
llvm-svn: 334575
Hans Wennborg [Wed, 13 Jun 2018 06:48:40 +0000 (06:48 +0000)]
crash-report-modules.m: Shorten path length to make Windows bot happy
llvm-svn: 334574
Bill Wendling [Wed, 13 Jun 2018 06:33:59 +0000 (06:33 +0000)]
Remove extraneous semicolon.
llvm-svn: 334573
Sam McCall [Wed, 13 Jun 2018 06:25:36 +0000 (06:25 +0000)]
[clangd] Log completion context type. NFC
llvm-svn: 334572
Bill Wendling [Wed, 13 Jun 2018 05:53:59 +0000 (05:53 +0000)]
Set the code model when specified.
llvm-svn: 334571
Petr Hosek [Wed, 13 Jun 2018 05:32:22 +0000 (05:32 +0000)]
Reland "Passthrough additional flags to custom libcxx CMake build"
This is needed when we're cross-compiling compiler-rt.
Differential Revision: https://reviews.llvm.org/D47834
llvm-svn: 334570
Akira Hatanaka [Wed, 13 Jun 2018 05:26:23 +0000 (05:26 +0000)]
[Sema] When the address of a member function is used as a template
argument, use the context in which it is used for checking its
accessibility.
This fixes PR32898.
rdar://problem/
33737747
Differential Revision: https://reviews.llvm.org/D36918
llvm-svn: 334569
Tom Stellard [Wed, 13 Jun 2018 05:14:10 +0000 (05:14 +0000)]
utils/release: Add merge-git.sh
Summary:
This script allows you to use git to backport a commit to a stable
branch while generating the exact same commit message (ignoring
whitespace) that you would get from using the merge.sh script with svn.
Reviewers: hansw
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D47760
llvm-svn: 334568
Max Kazantsev [Wed, 13 Jun 2018 02:25:32 +0000 (02:25 +0000)]
[SimplifyIndVars] Ignore dead users
IndVarSimplify sometimes makes transforms basing on users that are trivially dead. In particular,
if DCE wasn't run before it, there may be a dead `sext/zext` in loop that will trigger widening
transforms, however it makes no sense to do it.
This patch teaches IndVarsSimplify ignore the mist trivial cases of that.
Differential Revision: https://reviews.llvm.org/D47974
Reviewed By: sanjoy
llvm-svn: 334567
Ahmed Bougacha [Wed, 13 Jun 2018 02:16:01 +0000 (02:16 +0000)]
Revert "Fix how LLVMOPTIONALCOMPONENTS is passed to llvm-build"
This reverts commit r334543.
My understanding is, that commit is intended to make the llvm-build
invocation have a correct "--enable-optional-components" value, but:
- it already has a value: it's quoted in the command line a few lines
below, and, if I hack llvm-build to print sys.argv, it does look correct:
-- llvm-build output: ['.../utils/llvm-build/llvm-build',
'--native-target', 'X86', '--enable-targets', 'X86;ARM;AArch64',
'--enable-optional-components', '',
'--write-library-table',
'.../build/tools/llvm-config/LibraryDependencies.inc',
'--write-cmake-fragment', '.../build/LLVMBuild.cmake']
- the " " string seems to evaluate to TRUE in CMake (*sigh*), so this
basically force-enables LLVM_USE_INTEL_JITEVENTS, regardless of the
value of the option.
On Darwin, JITEvents is not supported, so this bypasses that OS check
but is guaranteed to fail later.
llvm-svn: 334566
Richard Smith [Wed, 13 Jun 2018 02:06:28 +0000 (02:06 +0000)]
Fix crash emitting transparent list initializer for a large aggregate.
llvm-svn: 334565
Rui Ueyama [Wed, 13 Jun 2018 00:50:17 +0000 (00:50 +0000)]
Use shorter names for #lo, #hi, #ha, etc. NFC.
Since these functions are file-local, the new names shouldn't be ambiguous.
Differential Revision: https://reviews.llvm.org/D48093
llvm-svn: 334564
Craig Topper [Wed, 13 Jun 2018 00:04:08 +0000 (00:04 +0000)]
[X86] Mark all instructions that have masked store semantics with NotMemoryFoldable. Remove dependency on SchedRW from memory table autogenerator.
Previously we were whitelisting in instructions based on their SchedRW value. With the masked store instructions explicitly removed via NotMemoryFoldable, we don't seem to need this check anymore.
llvm-svn: 334563
Craig Topper [Wed, 13 Jun 2018 00:04:04 +0000 (00:04 +0000)]
[X86] Remove VPCOMPRESSB/W from the autogenerated load folding table.
llvm-svn: 334562
Yaxun Liu [Tue, 12 Jun 2018 23:58:59 +0000 (23:58 +0000)]
[CUDA][HIP] Allow CUDA __global__ functions to have amdgpu kernel attributes
There are HIP applications e.g. Tensorflow 1.3 using amdgpu kernel attributes, however
currently they are only allowed on OpenCL kernel functions.
This patch will allow amdgpu kernel attributes to be applied to CUDA/HIP __global__
functions.
Differential Revision: https://reviews.llvm.org/D47958
llvm-svn: 334561
George Karpenkov [Tue, 12 Jun 2018 23:53:54 +0000 (23:53 +0000)]
[analyzer] Do not crash in the visitor when the function is given more arguments than it has parameters
rdar://
40335545
Differential Revision: https://reviews.llvm.org/D48107
llvm-svn: 334560
Stanislav Mekhanoshin [Tue, 12 Jun 2018 23:50:37 +0000 (23:50 +0000)]
[AMDGPU] DAG combine to produce V_PERM_B32
Differential Revision: https://reviews.llvm.org/D48099
llvm-svn: 334559
Peter Wu [Tue, 12 Jun 2018 23:05:03 +0000 (23:05 +0000)]
[ASAN] disable fgets_fputs test for android and darwin
aarch64/aosp_marlin-userdebug/OPR4.170623.016] builder unexpectedly
failed the fgets test (`assertion "fp" failed`). macOS unexpectedly
passes the fputs test without triggering ASAN.
llvm-svn: 334558
Raphael Isemann [Tue, 12 Jun 2018 22:51:20 +0000 (22:51 +0000)]
Disable warnings for the generated LLDB wrapper source
Summary:
This source files emits all kind of compiler warnings on different platforms. As the source code
in the file is generated and we therefore can't actually fix the warnings, we might as well disable
them.
Reviewers: aprantl, davide
Reviewed By: davide
Subscribers: davide, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D48096
llvm-svn: 334557
Sanjay Patel [Tue, 12 Jun 2018 22:50:37 +0000 (22:50 +0000)]
[AArch64] add tests for fadd with more than one use; NFC
llvm-svn: 334556
Raphael Isemann [Tue, 12 Jun 2018 22:40:20 +0000 (22:40 +0000)]
Added missing include to AMDHSAKernelDescriptor.h
We use size_t in this header, so we also need to include
cstddef to make it compile. Fixes the module builds.
llvm-svn: 334555
Matthew Voss [Tue, 12 Jun 2018 22:22:35 +0000 (22:22 +0000)]
[analyzer] Ensure that loop widening does not invalidate references
Loop widening can invalidate a reference. If the analyzer attempts to visit the
destructor to a non-existent reference, it will crash. This patch ensures that
the reference is preserved.
https://reviews.llvm.org/D47044
llvm-svn: 334554
Krzysztof Parzyszek [Tue, 12 Jun 2018 21:51:49 +0000 (21:51 +0000)]
[DAGCombiner] Recognize more patterns for ABS
Differential Revision: https://reviews.llvm.org/D47831
llvm-svn: 334553
Rui Ueyama [Tue, 12 Jun 2018 21:47:31 +0000 (21:47 +0000)]
Fix /WholeArchive bug.
`lld-link foo.lib /wholearchive:foo.lib` should work the same way as
`lld-link /wholearchive:foo.lib foo.lib`. Previously, /wholearchive in
the former case was ignored.
Differential Revision: https://reviews.llvm.org/D47565
llvm-svn: 334552
Craig Topper [Tue, 12 Jun 2018 21:42:42 +0000 (21:42 +0000)]
[X86] add avx512 tests for potentially miscompiling cvttp2si/cvttp2ui (PR37751).
llvm-svn: 334551
Ahmed Bougacha [Tue, 12 Jun 2018 21:27:36 +0000 (21:27 +0000)]
[CMake][Darwin] Match cxx-headers -> cxx_headers libcxx target rename.
This was changed in r334477.
llvm-svn: 334550
Raphael Isemann [Tue, 12 Jun 2018 21:22:52 +0000 (21:22 +0000)]
Added modulemap for lldb-mi
Summary: This patch allows building a C++ module for the lldb-mi headers.
Reviewers: bruno, aprantl
Reviewed By: aprantl
Subscribers: lldb-commits, ki.stfu
Differential Revision: https://reviews.llvm.org/D47996
llvm-svn: 334549
Shoaib Meenai [Tue, 12 Jun 2018 21:19:33 +0000 (21:19 +0000)]
[COFF] Fix crash when emitting symbol tables with GC
When running with linker GC (`-opt:ref`), defined imported symbols that
are referenced but then dropped by GC end up with their `Location`
member being nullptr, which means `getChunk()` returns nullptr for them
and attempting to call `getChunk()->getOutputSection()` causes a crash
from the nullptr dereference. Check for `getChunk()` being nullptr and
bail out early to avoid the crash.
Differential Revision: https://reviews.llvm.org/D48092
llvm-svn: 334548
Reid Kleckner [Tue, 12 Jun 2018 21:15:27 +0000 (21:15 +0000)]
Remove malloc.h include from Intel JIT events code
llvm-svn: 334547
George Karpenkov [Tue, 12 Jun 2018 21:14:33 +0000 (21:14 +0000)]
[libFuzzer] [NFC] Do not use hardcoded relative paths in tests.
For paths without "%t" inside uniqueness is not guaranteed, and
potential collisions might be present.
Differential Revision: https://reviews.llvm.org/D47288
llvm-svn: 334546
George Karpenkov [Tue, 12 Jun 2018 21:14:11 +0000 (21:14 +0000)]
[libFuzzer] [NFC] Make compiler command generation more readable.
Use config.clang as a more general option than config.c_compiler.
Differential Revision: https://reviews.llvm.org/D47295
llvm-svn: 334545
Reid Kleckner [Tue, 12 Jun 2018 20:54:11 +0000 (20:54 +0000)]
Add null check to Intel JIT event listener
llvm-svn: 334544
Reid Kleckner [Tue, 12 Jun 2018 20:53:46 +0000 (20:53 +0000)]
Fix how LLVMOPTIONALCOMPONENTS is passed to llvm-build
Patch by Force.Charlie-I
If LLVM_USE_INTEL_JITEVENTS and LLVM_USE_OPROFILE not set,
"${LLVMOPTIONALCOMPONENTS}" is empty, but
**--enable-optional-components** need arg, Cause
**--write-library-table** to be skipped parsed.
Differential Revision: https://reviews.llvm.org/D47982
llvm-svn: 334543
George Karpenkov [Tue, 12 Jun 2018 20:51:19 +0000 (20:51 +0000)]
[analyzer] [NFC] Remove "removeInvalidation" from visitor API
removeInvalidation is a very problematic API, as it makes suppression
order-dependent.
Moreover, it was used only once, and could be rewritten in a much
cleaner way.
Differential Revision: https://reviews.llvm.org/D48045
llvm-svn: 334542
George Karpenkov [Tue, 12 Jun 2018 20:51:01 +0000 (20:51 +0000)]
[analyzer] [NFC] Move ::dump methods from BugReporter.cpp to PathDiagnostics.cpp
BugReporter.cpp is already severely overloaded, and those dump methods
are on PathDiagnostics and should belong in the corresponding
implementation file.
Differential Revision: https://reviews.llvm.org/D48035
llvm-svn: 334541
George Karpenkov [Tue, 12 Jun 2018 20:50:44 +0000 (20:50 +0000)]
[analyzer] [NFC] Remove most usages of getEndPath
getEndPath is a problematic API, because it's not clear when it's called
(hint: not always at the end of the path), it crashes at runtime with
more than one non-nullptr returning implementation, and diagnostics
internal depend on it being called at some exact place.
However, most visitors don't actually need that: all they want is a
function consistently called after all nodes are traversed, to perform
finalization and to decide whether invalidation is needed.
Differential Revision: https://reviews.llvm.org/D48042
llvm-svn: 334540
Fangrui Song [Tue, 12 Jun 2018 20:44:11 +0000 (20:44 +0000)]
Work around false -Wmissing-braces warning from old clang which has been fixed in r314838
llvm-svn: 334539
Lang Hames [Tue, 12 Jun 2018 20:43:18 +0000 (20:43 +0000)]
[ORC] Add a fallback definition generator for VSOs.
If a VSO has a fallback definition generator attached it will be called during
lookup (and lookupFlags) for any unresolved symbols. The definition generator
can add new definitions to the VSO for any unresolved symbol. This allows VSOs
to generate new definitions on demand.
The immediate use case for this code is supporting VSOs that can import
definitions found via dlsym on demand.
llvm-svn: 334538
Lang Hames [Tue, 12 Jun 2018 20:43:17 +0000 (20:43 +0000)]
[ORC] Refactor blocking lookup logic into the blockingLookup function, and
implement existing blocking lookups (the lookup function) and
JITSymbolResolverAdapter on top of that.
llvm-svn: 334537
Lang Hames [Tue, 12 Jun 2018 20:43:17 +0000 (20:43 +0000)]
[RuntimeDyld] Add an assert to catch misbehaving symbol resolvers.
Resolvers are required to find results for all requested symbols or return an
error, but if a resolver fails to adhere to this contract (by returning results
for only a subset of the requested symbols) then this code will infinite loop.
This assertion catches resolvers that fail to adhere to the contract.
llvm-svn: 334536
Lang Hames [Tue, 12 Jun 2018 20:43:15 +0000 (20:43 +0000)]
[MCJIT] Call materializeAll on modules before compiling them in MCJIT.
This only affects modules with lazy GVMaterializers attached (usually modules
read off disk using the lazy bitcode reader). For such modules, materializing
before compiling prevents crashes due to missing function bodies /
initializers.
llvm-svn: 334535
Rui Ueyama [Tue, 12 Jun 2018 20:27:16 +0000 (20:27 +0000)]
Handle R_X86_64_GOTOFF64.
R_X86_64_GOTOFF64 is a relocation type to set to a distance betwween
a symbol and the beginning of the .got section. Previously, we always
created a dynamic relocation for the relocation type even though it
can be resolved at link-time.
Creating a dynamic relocation for R_X86_64_GOTOFF64 caused link failure
for some programs that do have a relocation of the type in a .text
section, as text relocations are prohibited in most configurations.
Differential Revision: https://reviews.llvm.org/D48058
llvm-svn: 334534
Fangrui Song [Tue, 12 Jun 2018 20:26:49 +0000 (20:26 +0000)]
[ELF][PPC64] Support R_PPC64_DTPREL64 which may be emitted in .rela.debug_addr
llvm-svn: 334533
Fangrui Song [Tue, 12 Jun 2018 20:18:41 +0000 (20:18 +0000)]
[ELF] Support R_X86_64_GOTPC{32,64}
Reviewers: ruiu, grimar, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D47098
llvm-svn: 334532
Petr Hosek [Tue, 12 Jun 2018 20:00:50 +0000 (20:00 +0000)]
[AArch64] Support reserving x20 register
Register x20 is a callee-saved register which may be used for other
purposes in certain contexts, for example to hold special variables
within the kernel. This change adds support for reserving this register
both to frontend and backend to make this register usable for these
purposes.
Differential Revision: https://reviews.llvm.org/D46552
llvm-svn: 334531
Craig Topper [Tue, 12 Jun 2018 19:59:10 +0000 (19:59 +0000)]
[X86] Remove unnecessary include from one of the tblgen emitters.
llvm-svn: 334530
Craig Topper [Tue, 12 Jun 2018 19:59:08 +0000 (19:59 +0000)]
[X86] Remove mayLoad flag from AVX512 truncating store instructions.
llvm-svn: 334529
Matt Morehouse [Tue, 12 Jun 2018 19:43:40 +0000 (19:43 +0000)]
Revert r334458, r334220, r334212, r334139.
Reverts changes to AddCompilerRT.cmake due to breakage of
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/.
llvm-svn: 334528
Krasimir Georgiev [Tue, 12 Jun 2018 19:33:15 +0000 (19:33 +0000)]
[clang-format] Fix crash while reflowing backslash in comments
Summary:
The added test case was currently crashing with an assertion:
```
krasimir@krasimir> cat test.cc ~
// How to run:
// bbbbb run \
// rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \
// <log_file> -- --output_directory="<output_directory>"
krasimir@krasimir> ~/work/llvm-build/bin/clang-format test.cc ~
clang-format: /usr/local/google/home/krasimir/work/llvm/tools/clang/lib/Format/WhitespaceManager.cpp:117: void clang::format::WhitespaceManager::calculateLineBreakInformation(): Assertion `PreviousOriginalWhitespaceEndOffset <= OriginalWhitespaceStartOffset' failed.
```
The root cause was that BreakableToken was not considering the case of a reflow between an unescaped newline in a line comment.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48089
llvm-svn: 334527
George Karpenkov [Tue, 12 Jun 2018 19:08:17 +0000 (19:08 +0000)]
[analyzer] [NFC] Now let's have only one place for diagnostics generation
Differential Revision: https://reviews.llvm.org/D47808
llvm-svn: 334526
George Karpenkov [Tue, 12 Jun 2018 19:08:00 +0000 (19:08 +0000)]
[analyzer] [NFC] Unify Minimal and Extensive diagnostics.
Once we removed AlternateExtensive, I've looked closer into the
difference between Minimal and Extensive, and turns out, the difference
was not that large.
Differential Revision: https://reviews.llvm.org/D47756
llvm-svn: 334525
George Karpenkov [Tue, 12 Jun 2018 19:07:41 +0000 (19:07 +0000)]
[analyzer] [NFC] Remove unused Extensive diagnostic setting,
Rename AlternateExtensive to Extensive.
In 2013, five years ago, we have switched to AlternateExtensive
diagnostics by default, and Extensive was available under unused,
undocumented flag.
This change remove the flag, renames the Alternate
diagnostic to Extensive (as it's no longer Alternate), and ports the
test.
Differential Revision: https://reviews.llvm.org/D47670
llvm-svn: 334524
Reid Kleckner [Tue, 12 Jun 2018 18:56:05 +0000 (18:56 +0000)]
[MS][ARM64] Hoist __ImageBase handling into TargetLoweringObjectFileCOFF
All COFF targets should use @IMGREL32 relocations for symbol differences
against __ImageBase. Do the same for getSectionForConstant, so that
immediates lowered to globals get merged across TUs.
Patch by Chris January
Differential Revision: https://reviews.llvm.org/D47783
llvm-svn: 334523
Walter Lee [Tue, 12 Jun 2018 18:34:12 +0000 (18:34 +0000)]
[asan, myriad] Support environment variables
Provide a buffer that the test harness can write into to provide
values for the environment variables. Format is a null-separated list
of VAR=value pairs; this is sufficent for our purpose.
Differential Revision: https://reviews.llvm.org/D47960
llvm-svn: 334522
Konstantin Zhuravlyov [Tue, 12 Jun 2018 18:33:51 +0000 (18:33 +0000)]
AMDHSA/NFC: Code object v3 updates (additional):
- Move section selection and alignment to AMDGPUAsmPrinter
llvm-svn: 334521
Roman Tereshin [Tue, 12 Jun 2018 18:30:37 +0000 (18:30 +0000)]
[MIR][MachineCSE] Implementing proper MachineInstr::getNumExplicitDefs()
Apparently, MachineInstr class definition as well as pretty much all of
the machine passes assume that the only kind of MachineInstr's operands
that is variadic for variadic opcodes is explicit non-definitions.
In particular, this assumption is made by MachineInstr::defs(), uses(),
and explicit_uses() methods, as well as by MachineCSE pass.
The assumption is incorrect judging from at least TableGen backend
implementation, that recognizes variable_ops in OutOperandList, and the
very existence of G_UNMERGE_VALUES generic opcode, or ARM load multiple
instructions, all of which have variadic defs.
In particular, MachineCSE pass breaks MIR with CSE'able G_UNMERGE_VALUES
instructions in it.
This commit implements MachineInstr::getNumExplicitDefs() similar to
pre-existing MachineInstr::getNumExplicitOperands(), fixes
MachineInstr::defs(), uses(), and explicit_uses(), and fixes MachineCSE
pass.
As the issue addressed seems to affect only machine passes that could be
ran mid-GlobalISel pipeline at the moment, the other passes aren't fixed
by this commit, like MachineLICM: that could be done on per-pass basis
when (if ever) they get adopted for GlobalISel.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D45640
llvm-svn: 334520
Konstantin Zhuravlyov [Tue, 12 Jun 2018 18:02:46 +0000 (18:02 +0000)]
AMDHSA: Code object v3 updates
- Do not emit following assembler directives:
- .hsa_code_object_version
- .hsa_code_object_isa
- .amd_amdgpu_isa
- .amd_amdgpu_hsa_metadata
- .amd_amdgpu_pal_metadata
- Do not emit .note entries
- Cleanup and bring in sync kernel descriptor header file
- Emit kernel descriptor into .rodata with appropriate relocations and
alignments
llvm-svn: 334519
Zachary Turner [Tue, 12 Jun 2018 17:43:52 +0000 (17:43 +0000)]
Refactor ExecuteAndWait to take StringRefs.
This simplifies some code which had StringRefs to begin with, and
makes other code more complicated which had const char* to begin
with.
In the end, I think this makes for a more idiomatic and platform
agnostic API. Not all platforms launch process with null terminated
c-string arrays for the environment pointer and argv, but the api
was designed that way because it allowed easy pass-through for
posix-based platforms. There's a little additional overhead now
since on posix based platforms we'll be takign StringRefs which
were constructed from null terminated strings and then copying
them to null terminate them again, but from a readability and
usability standpoint of the API user, I think this API signature
is strictly better.
llvm-svn: 334518
Krasimir Georgiev [Tue, 12 Jun 2018 17:26:31 +0000 (17:26 +0000)]
[clang-format] Discourage breaks in submessage entries, hard rule
Summary:
Currently clang-format allows this for text protos:
```
submessage:
{ key: '
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }
```
when it is under the column limit and when putting it all on one line exceeds the column limit.
This is not a very intuitive formatting, so I'd prefer having
```
submessage: {
key: '
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
}
```
instead, even if it takes one line more.
This patch prevents clang-format from inserting a break between `: {` and similar cases.
Reviewers: djasper, sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48063
llvm-svn: 334517
Pavel Labath [Tue, 12 Jun 2018 16:50:01 +0000 (16:50 +0000)]
DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes method
This method is used to find complete definitions of a type when one
parses a compile unit with only forward declaration available.
Since it is only accessed from DWARFASTParserClang, it was not
possible/easy to trigger this codepath from lldb-test. Therefore, I
adapt add a debug-names variant to an existing dotest test to cover this
scenario.
llvm-svn: 334516
Fangrui Song [Tue, 12 Jun 2018 16:20:44 +0000 (16:20 +0000)]
[MC] [X86] Teach leaq _GLOBAL_OFFSET_TABLE(%rip), %r15 to use R_X86_64_GOTPC32 instead of R_X86_64_PC32
Summary:
This is similar to D46319 (ARM). x86-64 psABI p40 gives an example:
leaq _GLOBAL_OFFSET_TABLE(%rip), %r15 # GOTPC32 reloc
GNU as creates R_X86_64_GOTPC32. However, MC currently emits R_X86_64_PC32.
Reviewers: javed.absar, echristo
Subscribers: kristof.beyls, llvm-commits, peter.smith, grimar
Differential Revision: https://reviews.llvm.org/D47507
llvm-svn: 334515
Michael Berg [Tue, 12 Jun 2018 16:13:11 +0000 (16:13 +0000)]
Utilize new SDNode flag functionality to expand current support for fmul
Summary: This patch originated from D46562 and is a proper subset, with some issues addressed for fmul.
Reviewers: spatel, hfinkel, wristow, arsenm
Reviewed By: spatel
Subscribers: nhaehnle, wdng
Differential Revision: https://reviews.llvm.org/D47911
llvm-svn: 334514
Simon Pilgrim [Tue, 12 Jun 2018 16:12:29 +0000 (16:12 +0000)]
[CostModel] Replace ShuffleKind::SK_Alternate with ShuffleKind::SK_Select (PR33744)
As discussed on PR33744, this patch relaxes ShuffleKind::SK_Alternate which requires shuffle masks to only match an alternating pattern from its 2 sources:
e.g. v4f32: <0,5,2,7> or <4,1,6,3>
This seems far too restrictive as most SIMD hardware which will implement it using a general blend/bit-select instruction, so replaces it with SK_Select, permitting elements from either source as long as they are inline:
e.g. v4f32: <0,5,2,7>, <4,1,6,3>, <0,1,6,7>, <4,1,2,3> etc.
This initial patch just updates the name and cost model shuffle mask analysis, later patch reviews will update SLP to better utilise this - it still limits itself to SK_Alternate style patterns.
Differential Revision: https://reviews.llvm.org/D47985
llvm-svn: 334513
Paul Robinson [Tue, 12 Jun 2018 16:09:03 +0000 (16:09 +0000)]
[DWARFv5] llvm-mc -dwarf-version does not imply -g.
Don't provide the assembler source as the "root file" unless the user
asked to have debug info for the assembler source (with -g).
If the source doesn't provide an explicit ".file 0" then (a) use the
compilation directory as directory #0, and (b) use the file #1 info
for file #0 also.
Differential Revision: https://reviews.llvm.org/D48055
llvm-svn: 334512
Craig Topper [Tue, 12 Jun 2018 15:48:03 +0000 (15:48 +0000)]
[X86] Remove TB_ALIGN_16 from VEXTRACTF128/VEXTRACTI128 in the memory folding table.
llvm-svn: 334511
David Carlier [Tue, 12 Jun 2018 15:47:58 +0000 (15:47 +0000)]
[Fuzzer] Afl driver changing iterations handling
Handling differently the iterations with the type limit and eventually an error message.
Reviewers: morehouse, kcc
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D47880
llvm-svn: 334510
Simon Pilgrim [Tue, 12 Jun 2018 15:14:34 +0000 (15:14 +0000)]
Fix signed/unsigned warning. NFCI.
llvm-svn: 334509
Krzysztof Parzyszek [Tue, 12 Jun 2018 15:12:50 +0000 (15:12 +0000)]
[Hexagon] Make floating point operations expensive for vectorization
llvm-svn: 334508
Sam Clegg [Tue, 12 Jun 2018 14:51:18 +0000 (14:51 +0000)]
Fix -DBUILD_SHARED_LIBS=1 build
This was broken in rL334466
llvm-svn: 334507
Simon Pilgrim [Tue, 12 Jun 2018 14:47:13 +0000 (14:47 +0000)]
[CostModel] Treat Identity shuffle masks as zero cost
As discussed on D47985, identity shuffle masks should probably be free.
I've limited this to the case where the input and output types all match - but we could probably accept all cases.
Differential Revision: https://reviews.llvm.org/D47986
llvm-svn: 334506
Kostya Kortchinsky [Tue, 12 Jun 2018 14:42:40 +0000 (14:42 +0000)]
[scudo] Add C++17 aligned new/delete operators support
Summary:
This CL adds support for aligned new/delete operators (C++17). Currently we
do not support alignment inconsistency detection on deallocation, as this
requires a header change, but the APIs are introduced and are functional.
Add a smoke test for the aligned version of the operators.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D48031
llvm-svn: 334505
Sanjay Patel [Tue, 12 Jun 2018 14:21:51 +0000 (14:21 +0000)]
[x86] move shrunkblend transform to helper function; NFCI
We should be able to obsolete D48043 by easing the constraints
on this existing code.
llvm-svn: 334504
Erich Keane [Tue, 12 Jun 2018 13:59:32 +0000 (13:59 +0000)]
Fix overload resolution between Ptr-To-Member and Bool
As reported here (https://bugs.llvm.org/show_bug.cgi?id=19808)
and discovered independently when looking at plum-hall tests,
we incorrectly implemented over.ics.rank, which says "A conversion
that is not a conversion of a pointer, or pointer to member, to bool
is better than another conversion that is such a conversion.".
In the current Draft (N4750), this is phrased slightly differently in
paragraph 4.1: A conversion that does not convert a pointer, a pointer
to member, or std::nullptr_t to bool is better than one that does.
The comment on isPointerConversionToBool (the changed function)
also confirms that this is the case (note outdated reference):
isPointerConversionToBool - Determines whether this conversion is
a conversion of a pointer or pointer-to-member to bool. This is
used as part of the ranking of standard conversion sequences
(C++ 13.3.3.2p4).
However, despite this comment, it didn't check isMemberPointerType
on the 'FromType', presumably incorrectly assuming that 'isPointerType'
matched it. This patch fixes this by adding isMemberPointerType to
this function. Additionally, member function pointers are just
MemberPointerTypes that point to functions insted of data, so that
is fixed in this patch as well.
llvm-svn: 334503
Clement Courbet [Tue, 12 Jun 2018 13:28:37 +0000 (13:28 +0000)]
[llvm-exegesis] Sum counter values when several counters are specified for a ProcRes.
Summary: This allows handling memory ports on SNB.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D48076
llvm-svn: 334502
Pavel Labath [Tue, 12 Jun 2018 13:26:43 +0000 (13:26 +0000)]
Fix build error introduced in r334498
Some gcc versions (circa 4.9) do not accept initializing Expected
objects containing a reference to a function from a function.
Change the Expected object to contain function pointers to work around
this.
llvm-svn: 334501
Pavel Labath [Tue, 12 Jun 2018 13:11:25 +0000 (13:11 +0000)]
DWARFDebugNames: Implement last GetGlobalVariables overload
This function implements the search for all global variables within a
given compilation unit.
llvm-svn: 334500
Guillaume Chatelet [Tue, 12 Jun 2018 13:07:16 +0000 (13:07 +0000)]
[llvm-exegesis] Move libpfm linking to LLVMExegesis.
Summary: This patch moves linking of libpfm from different places to a single one.
Reviewers: courbet
Subscribers: mgorny, tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D48075
llvm-svn: 334499
Pavel Labath [Tue, 12 Jun 2018 12:57:36 +0000 (12:57 +0000)]
lldb-test symbols: Add -file argument and the ability to dump global variables in a file
The motivation for this is to be able to Dwarf index ability to look up
variables within a given compilation unit. It also fits in with the
patch in progress at D47939, which will add the ability to look up
funtions using file+line pairs.
The verification of which lldb-test options can be used together was
getting a bit unwieldy, so I moved the logic out into a separate
function.
llvm-svn: 334498
Krzysztof Parzyszek [Tue, 12 Jun 2018 12:49:36 +0000 (12:49 +0000)]
[SelectionDAG] Provide default expansion for rotates
Implement default legalization of rotates: either in terms of the rotation
in the opposite direction (if legal), or in terms of shifts and ors.
Implement generating of rotate instructions for Hexagon. Hexagon only
supports rotates by an immediate value, so implement custom lowering of
ROTL/ROTR on Hexagon. If a rotate is not legal, use the default expansion.
Differential Revision: https://reviews.llvm.org/D47725
llvm-svn: 334497
Pavel Labath [Tue, 12 Jun 2018 12:43:55 +0000 (12:43 +0000)]
lit/SymbolFile/DWARF: Simplify test RUN lines
Use -mllvm compiler argument to enable DWARF v5 accelerator tables
instead of piping the IR through llc.
llvm-svn: 334496
Ilya Biryukov [Tue, 12 Jun 2018 11:56:21 +0000 (11:56 +0000)]
[clangd] Trace time the operations wait on Semaphore.
The Semaphore is currently used to limit the number of concurrently
running tasks. Tracing the wait times will allow to find out how much
time is wasted waiting on other operations to complete.
llvm-svn: 334495
Hans Wennborg [Tue, 12 Jun 2018 11:51:22 +0000 (11:51 +0000)]
Re-apply r334418 "Enable crash recovery tests on Windows, globs work in the lit internal shell now"
Plus change run lines from
not env FOO=bar %clang
to
env FOO=bar not %clang
To not confuse the internal shell.
llvm-svn: 334494
Hans Wennborg [Tue, 12 Jun 2018 11:33:44 +0000 (11:33 +0000)]
Revert r334418 "Enable crash recovery tests on Windows, globs work in the lit internal shell now"
The tests fail on Windows bots, and for me locally.
> Enable crash recovery tests on Windows, globs work in the lit internal shell now
llvm-svn: 334493
Florian Hahn [Tue, 12 Jun 2018 11:16:56 +0000 (11:16 +0000)]
Use SmallPtrSet explicitly for SmallSets with pointer types (NFC).
Currently SmallSet<PointerTy> inherits from SmallPtrSet<PointerTy>. This
patch replaces such types with SmallPtrSet, because IMO it is slightly
clearer and allows us to get rid of unnecessarily including SmallSet.h
Reviewers: dblaikie, craig.topper
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D47836
llvm-svn: 334492
Simon Dardis [Tue, 12 Jun 2018 10:28:06 +0000 (10:28 +0000)]
[mips] Guard some floating point instructions correctly
Reviewers: smaksimovic, atanasyan, abeserminji
Differential Revision: https://reviews.llvm.org/D47636
llvm-svn: 334491
Aleksandar Beserminji [Tue, 12 Jun 2018 10:23:49 +0000 (10:23 +0000)]
[mips] Extend LONG_BRANCH_LUi/ADDiu with extra parameter
Extend LONG_BRANCH_LUi and LONG_BRANCH_ADDiu pseudo instructions with
additional flag, so instead of always lowering to lui %hi(...),
addiu %lo(...) or addiu %hi(...), now they can lower to either %lo, %hi,
%higher or %highest depending on the added flag.
Differential Revision: https://reviews.llvm.org/D47941
llvm-svn: 334490
Luke Geeson [Tue, 12 Jun 2018 09:54:27 +0000 (09:54 +0000)]
[AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests
Summary:
This fixes the ranges for the vcvth family of FP16 intrinsics in the clang front end. Previously it was accepting incorrect ranges
-Changed builtin range checking in SemaChecking
-added tests SemaCheck changes - included in their own file since no similar one exists
-modified existing tests to reflect new ranges
Reviewers: SjoerdMeijer, javed.absar
Reviewed By: SjoerdMeijer
Subscribers: kristof.beyls, cfe-commits
Differential Revision: https://reviews.llvm.org/D47592
llvm-svn: 334489
Luke Geeson [Tue, 12 Jun 2018 09:35:20 +0000 (09:35 +0000)]
[AArch64] Audit on rL333879 to fix FP16 64bit bitpatterns
llvm-svn: 334488
Peter Wu [Tue, 12 Jun 2018 09:27:18 +0000 (09:27 +0000)]
[ASAN] fix fgets and fgets_fputs tests failure
Some systems (Android) might not have /etc/passwd. Fixes r334450.
llvm-svn: 334487
Simon Pilgrim [Tue, 12 Jun 2018 09:18:13 +0000 (09:18 +0000)]
[CostModel][X86] Add extra Identity shuffle mask cost tests (D47986)
llvm-svn: 334486
Eric Liu [Tue, 12 Jun 2018 08:48:20 +0000 (08:48 +0000)]
[clangd] Support proximity paths in index fuzzy find.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D47937
llvm-svn: 334485
Alexander Richardson [Tue, 12 Jun 2018 08:00:38 +0000 (08:00 +0000)]
[ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries
Summary:
Previously LLD would not add any dynamic relocations and write a module
index of 1 which is not correct for the shared library case.
This can happen when a thread-local global variable is marked as local with
a version script. With this change I am now able to link all of the FreeBSD
base system for MIPS64 with LLD.
Differential Revision: https://reviews.llvm.org/D48002
llvm-svn: 334483
Craig Topper [Tue, 12 Jun 2018 07:32:19 +0000 (07:32 +0000)]
[X86] Add NotMemoryFoldable to the VPCOMPRESS instructions.
llvm-svn: 334481
Craig Topper [Tue, 12 Jun 2018 07:32:18 +0000 (07:32 +0000)]
[X86] Don't add stores to the autogenerated load folding tables if the register and memory operands have different widths.
This can cause the amount of the memory written to be changed which would be bad.
llvm-svn: 334480
Craig Topper [Tue, 12 Jun 2018 07:32:17 +0000 (07:32 +0000)]
[X86] Add NotMemoryFoldable to more instructions.
These include PUSH/POP instructions that don't match the manual table. This also includes CMPXCHG which we never emit in non-locked form.
llvm-svn: 334479
Craig Topper [Tue, 12 Jun 2018 07:32:15 +0000 (07:32 +0000)]
[X86] Update folding table generator to properly detect RMW arithmetic instructions.
The RMW instructions are detected by reading the SchedRW data, but the RMW instructions have had their SchedRW changed in recent months. This broke the expectation.
We probably should fix this to use the mayLoad/mayStore flags if possible.
llvm-svn: 334478