platform/upstream/llvm.git
5 years agoUpdate MemorySSA in SimpleLoopUnswitch.
Alina Sbirlea [Tue, 4 Dec 2018 14:23:37 +0000 (14:23 +0000)]
Update MemorySSA in SimpleLoopUnswitch.

Summary:
Teach SimpleLoopUnswitch to preserve MemorySSA.

Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits

Differential Revision: https://reviews.llvm.org/D47022

llvm-svn: 348263

5 years agoFix "array must be initialized with a brace-enclosed initializer" build error.
Simon Pilgrim [Tue, 4 Dec 2018 14:07:29 +0000 (14:07 +0000)]
Fix "array must be initialized with a brace-enclosed initializer" build error.

Try to fix clang-bpf-build buildbot.

llvm-svn: 348262

5 years agoFix lldb-server unit tests for the MonitoringProcessLauncher refactor
Pavel Labath [Tue, 4 Dec 2018 14:04:27 +0000 (14:04 +0000)]
Fix lldb-server unit tests for the MonitoringProcessLauncher refactor

We now need to initialize the filesystem in these tests.

llvm-svn: 348261

5 years ago[SanitizerCommon] Test `CombinedAllocator::ForEachChunk()` in unit tests.
Dan Liew [Tue, 4 Dec 2018 14:03:55 +0000 (14:03 +0000)]
[SanitizerCommon] Test `CombinedAllocator::ForEachChunk()` in unit tests.

Summary:

Previously we weren't testing this function in the unit tests.

Reviewers: kcc, cryptoad, dvyukov, eugenis, kubamracek

Subscribers: #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D54861

llvm-svn: 348260

5 years ago[GN][NFC] Update readme example to functional command
Martell Malone [Tue, 4 Dec 2018 12:59:22 +0000 (12:59 +0000)]
[GN][NFC] Update readme example to functional command

`ninja -C out/gn check-lld` is not a valid command yet

Differential revision: https://reviews.llvm.org/D54840

llvm-svn: 348259

5 years ago[ELF] Allow discarding of .rela.plt
Martell Malone [Tue, 4 Dec 2018 12:37:56 +0000 (12:37 +0000)]
[ELF] Allow discarding of .rela.plt

When linking the linux kernel on ppc64le

ld.lld -EL -m elf64lppc -Bstatic --orphan-handling=warn --build-id -o
.tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive
built-in.a --no-whole-archive --start-group lib/lib.a --end-group
ld.lld: error: discarding .rela.plt section is not allowed

The linker script discards with the following matches
*(.glink .iplt .plt .rela* .comment)

Differential Revision: https://reviews.llvm.org/D54871

llvm-svn: 348258

5 years ago[X86][NFC] Add more constant-size memcmp tests.
Clement Courbet [Tue, 4 Dec 2018 12:35:51 +0000 (12:35 +0000)]
[X86][NFC] Add more constant-size memcmp tests.

llvm-svn: 348257

5 years agoFix MSVC "unknown pragma" warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:31:52 +0000 (12:31 +0000)]
Fix MSVC "unknown pragma" warning. NFCI.

llvm-svn: 348256

5 years ago[PPC][PPC64] PPC_REL14 and PPC64_REL14 relocations
Martell Malone [Tue, 4 Dec 2018 12:26:21 +0000 (12:26 +0000)]
[PPC][PPC64] PPC_REL14 and PPC64_REL14 relocations

When linking the linux kernel on ppc64 and ppc
ld.lld: error: unrecognized reloc 11
11 is PPC_REL14 and PPC64_REL14

Differential revision: https://reviews.llvm.org/D54868

llvm-svn: 348255

5 years agoFix -Wparentheses warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:24:10 +0000 (12:24 +0000)]
Fix -Wparentheses warning. NFCI.

llvm-svn: 348254

5 years ago[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.
Simon Pilgrim [Tue, 4 Dec 2018 12:21:43 +0000 (12:21 +0000)]
[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.

The GetSplatValue/IsSplatVector call will call this anyhow and the later code is just for a v2i64 type so doesn't need it.

llvm-svn: 348253

5 years ago[clangd] Partition include graph on auto-index.
Kadir Cetinkaya [Tue, 4 Dec 2018 11:31:57 +0000 (11:31 +0000)]
[clangd] Partition include graph on auto-index.

Summary:
Partitions include graphs in auto-index so that each shards contains
only part of the include graph related to itself.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D55062

llvm-svn: 348252

5 years ago[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)
Simon Pilgrim [Tue, 4 Dec 2018 11:21:30 +0000 (11:21 +0000)]
[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)

PR17686 demonstrates that for some targets FP exceptions can fire in cases where the FP_TO_UINT is expanded using a FP_TO_SINT instruction.

The existing code converts both the inrange and outofrange cases using FP_TO_SINT and then selects the result, this patch changes this for 'strict' cases to pre-select the FP_TO_SINT input and the offset adjustment.

The X87 cases don't need the strict flag but generates much nicer code with it....

Differential Revision: https://reviews.llvm.org/D53794

llvm-svn: 348251

5 years ago[Expr] Fix `TestExprOptions` after r348240 on MacOS X
Aleksandr Urakov [Tue, 4 Dec 2018 11:08:02 +0000 (11:08 +0000)]
[Expr] Fix `TestExprOptions` after r348240 on MacOS X

Summary:
r348240 assumes that an expression contains the Objective C option if
Objective C Runtime is found. But on MacOS X it seems that the test application
process always contains Objective C Runtime, so the test fails when it assumes
that the language is C++ only. Skip this part on Darwin.

llvm-svn: 348250

5 years agoRevert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features
Simon Pilgrim [Tue, 4 Dec 2018 10:55:48 +0000 (10:55 +0000)]
Revert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features

This patch splits backend features currently
hidden behind architecture versions.

For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.

This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html

Reviewers: DavidSpickett, olista01, t.p.northover

Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio

Differential revision: https://reviews.llvm.org/D54633

........

This has been causing buildbots failures for the past 24 hours: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386

llvm-svn: 348249

5 years agoRevert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."
George Rimar [Tue, 4 Dec 2018 10:55:03 +0000 (10:55 +0000)]
Revert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."

It broke msan and asan bots it seems:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/20993/steps/ninja%20check%201/logs/stdio

llvm-svn: 348248

5 years ago[SystemZ] Do not support __float128
Ulrich Weigand [Tue, 4 Dec 2018 10:51:36 +0000 (10:51 +0000)]
[SystemZ] Do not support __float128

As of rev. 268898, clang supports __float128 on SystemZ.  This seems to
have been in error.  GCC has never supported __float128 on SystemZ,
since the "long double" type on the platform is already IEEE-128. (GCC
only supports __float128 on platforms where "long double" is some other
data type.)

For compatibility reasons this patch removes __float128 on SystemZ
again.  The test case is updated accordingly.

llvm-svn: 348247

5 years ago[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes
Simon Pilgrim [Tue, 4 Dec 2018 10:41:06 +0000 (10:41 +0000)]
[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes

Add support for ISD::*_EXTEND and ISD::*_EXTEND_VECTOR_INREG opcodes.

The extra broadcast in trunc-subvector.ll will be fixed in an upcoming patch.

llvm-svn: 348246

5 years ago[Analyzer] Iterator Checker - Forbid decrements past the begin() and increments past...
Adam Balogh [Tue, 4 Dec 2018 10:27:27 +0000 (10:27 +0000)]
[Analyzer] Iterator Checker - Forbid decrements past the begin() and increments past the end() of containers

Previously, the iterator range checker only warned upon dereferencing of
iterators outside their valid range as well as increments and decrements of
out-of-range iterators where the result remains out-of-range. However, the C++
standard is more strict than this: decrementing begin() or incrementing end()
results in undefined behaviour even if the iterator is not dereferenced
afterwards. Coming back to the range once out-of-range is also undefined.

This patch corrects the behaviour of the iterator range checker: warnings are
given for any operation whose result is ahead of begin() or past the end()
(which is the past-end iterator itself, thus now we are speaking of past
past-the-end).

Differential Revision: https://reviews.llvm.org/D53812

llvm-svn: 348245

5 years ago[Analyzer] Iterator Checkers - Use the region of the topmost base class for iterators...
Adam Balogh [Tue, 4 Dec 2018 10:22:28 +0000 (10:22 +0000)]
[Analyzer] Iterator Checkers - Use the region of the topmost base class for iterators stored in a region

If an iterator is represented by a derived C++ class but its comparison operator
is for its base the iterator checkers cannot recognize the iterators compared.
This results in false positives in very straightforward cases (range error when
dereferencing an iterator after disclosing that it is equal to the past-the-end
iterator).

To overcome this problem we always use the region of the topmost base class for
iterators stored in a region. A new method called getMostDerivedObjectRegion()
was added to the MemRegion class to get this region.

Differential Revision: https://reviews.llvm.org/D54466

llvm-svn: 348244

5 years ago[llvm-mc] - Do not crash when referencing undefined debug sections.
George Rimar [Tue, 4 Dec 2018 10:10:50 +0000 (10:10 +0000)]
[llvm-mc] - Do not crash when referencing undefined debug sections.

MC has code that pre-creates few debug sections:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396

If users code has a reference to such section but does not redefine it,
MC code currently asserts, because still thinks they are normally defined.

The patch fixes the issue.

Differential revision: https://reviews.llvm.org/D55173

llvm-svn: 348243

5 years ago[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.
George Rimar [Tue, 4 Dec 2018 10:01:39 +0000 (10:01 +0000)]
[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.

The issue is the following.

DWARF 2 used version 1 for .debug_frame.
(Appendix G, p. 416 http://dwarfstd.org/doc/DWARF5.pdf)

lib/MC now always sets version 1 for .eh_frame (and sets 1-4 versions for .debug_frame correctly):
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1530
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1562
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1602

In version 1, return_address_register was defined as ubyte, while other versions
switched to uleb128.
(p 62, http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf)

Patch teaches llvm-dwarfdump about this difference.

Differential revision: https://reviews.llvm.org/D54860

llvm-svn: 348242

5 years agoExtend test for DependentSizedArrayType
Stephen Kelly [Tue, 4 Dec 2018 09:53:36 +0000 (09:53 +0000)]
Extend test for DependentSizedArrayType

Use a using declaration to force the type to appear in the -ast-dump
output.

llvm-svn: 348241

5 years ago[Expr] Check the language before ignoring Objective C keywords
Aleksandr Urakov [Tue, 4 Dec 2018 09:51:29 +0000 (09:51 +0000)]
[Expr] Check the language before ignoring Objective C keywords

Summary:
This patch adds the check of the language before ignoring names like `id` or
`Class`, which are reserved in Objective C, but are allowed in C++. It is needed
to make it possible to evaluate expressions in a C++ program containing names
like `id` or `Class`.

Reviewers: jingham, zturner, labath, clayborg

Reviewed By: jingham, clayborg

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D54843

llvm-svn: 348240

5 years ago[WIP][Sema] Improve static_assert diagnostics for type traits.
Clement Courbet [Tue, 4 Dec 2018 07:59:57 +0000 (07:59 +0000)]
[WIP][Sema] Improve static_assert diagnostics for type traits.

Summary:
In our codebase, `static_assert(std::some_type_trait<Ts...>::value, "msg")`
(where `some_type_trait` is an std type_trait and `Ts...` is the
appropriate template parameters) account for 11.2% of the `static_assert`s.

In these cases, the `Ts` are typically not spelled out explicitly, e.g.
`static_assert(std::is_same<SomeT::TypeT, typename SomeDependentT::value_type>::value, "message");`

The diagnostic when the assert fails is typically not very useful, e.g.
`static_assert failed due to requirement 'std::is_same<SomeT::TypeT, typename SomeDependentT::value_type>::value' "message"`

This change makes the diagnostic spell out the types explicitly , e.g.
`static_assert failed due to requirement 'std::is_same<int, float>::value' "message"`

See tests for more examples.

After this is submitted, I intend to handle
`static_assert(!std::some_type_trait<Ts...>::value, "msg")`,
which is another 6.6% of static_asserts.

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D54903

llvm-svn: 348239

5 years agoRemove unnecessary include.
Richard Trieu [Tue, 4 Dec 2018 04:53:18 +0000 (04:53 +0000)]
Remove unnecessary include.

llvm-svn: 348238

5 years ago[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.
Craig Topper [Tue, 4 Dec 2018 04:51:07 +0000 (04:51 +0000)]
[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.

We only needed this because it provided really aggressive constant folding even through constant pool entries created from build_vectors. The main case was for vXi8 MULH legalization which was happening as part of legalize DAG instead of as part of legalize vector ops. Now its part of vector op legalization and we've added special handling for build vectors of all constants there. This has removed the need for this code on the list tests we have.

llvm-svn: 348237

5 years ago[compiler-rt] Use the new zx_futex_wait for Fuchsia sanitizer runtime
Petr Hosek [Tue, 4 Dec 2018 04:07:43 +0000 (04:07 +0000)]
[compiler-rt] Use the new zx_futex_wait for Fuchsia sanitizer runtime

This finishes the soft-transition to the new primitive that implements
priority inheritance.

Differential Revision: https://reviews.llvm.org/D55244

llvm-svn: 348236

5 years ago[analyzer] MoveChecker: Add more common state resetting methods.
Artem Dergachev [Tue, 4 Dec 2018 03:38:08 +0000 (03:38 +0000)]
[analyzer] MoveChecker: Add more common state resetting methods.

Includes "resize" and "shrink" because they can reset the object to a known
state in certain circumstances.

Differential Revision: https://reviews.llvm.org/D54563

llvm-svn: 348235

5 years ago[Sema] Provide -fvisibility-global-new-delete-hidden option
Petr Hosek [Tue, 4 Dec 2018 03:25:25 +0000 (03:25 +0000)]
[Sema] Provide -fvisibility-global-new-delete-hidden option

When the global new and delete operators aren't declared, Clang
provides and implicit declaration, but this declaration currently
always uses the default visibility. This is a problem when the
C++ library itself is being built with non-default visibility because
the implicit declaration will force the new and delete operators to
have the default visibility unlike the rest of the library.

The existing workaround is to use assembly to enforce the visiblity:
https://fuchsia.googlesource.com/zircon/+/master/system/ulib/zxcpp/new.cpp#108
but that solution is not always available, e.g. in the case of of
libFuzzer which is using an internal version of libc++ that's also built
with -fvisibility=hidden where the existing behavior is causing issues.

This change introduces a new option -fvisibility-global-new-delete-hidden
which makes the implicit declaration of the global new and delete
operators hidden.

Differential Revision: https://reviews.llvm.org/D53787

llvm-svn: 348234

5 years agoFix -Wmismatched-tags to not warn on redeclarations of structs in system
Richard Smith [Tue, 4 Dec 2018 02:45:28 +0000 (02:45 +0000)]
Fix -Wmismatched-tags to not warn on redeclarations of structs in system
headers.

Previously, we would only check whether the new declaration is in a
system header, but that requires the user to be able to correctly guess
whether a declaration in a system header is declared as a struct or a
class when specializing standard library traits templates.

We now entirely ignore declarations for which the warning was disabled
when determining whether to warn on a tag mismatch.

Also extend the diagnostic message to clarify that
 a) code containing such a tag mismatch is in fact valid and correct,
    and
 b) the (non-coding-style) reason to emit such a warning is that the
    Microsoft C++ ABI is broken and includes the tag kind in decorated
    names,
as it seems a lot of users are confused by our diagnostic here (either
not understanding why we produce it, or believing that it represents an
actual language rule).

llvm-svn: 348233

5 years ago[PlatformDarwin] Simplify logic and use FileSystem
Jonas Devlieghere [Tue, 4 Dec 2018 02:23:16 +0000 (02:23 +0000)]
[PlatformDarwin] Simplify logic and use FileSystem

Simplify code path by using the FileSystem.

llvm-svn: 348232

5 years agoImprove the regerror(3) interceptor
Kamil Rytarowski [Tue, 4 Dec 2018 02:18:18 +0000 (02:18 +0000)]
Improve the regerror(3) interceptor

The res returned value might differ with REAL(strlen)(errbuf) + 1,
as the buffer's value is limited with errbuf_size.

Hot fix for D54584.

llvm-svn: 348231

5 years agoReverting r348215
Ranjeet Singh [Tue, 4 Dec 2018 02:03:53 +0000 (02:03 +0000)]
Reverting r348215

Causing failures on ubsan buildbot boxes.

llvm-svn: 348230

5 years ago[analyzer] MoveChecker: Improve warning and note messages.
Artem Dergachev [Tue, 4 Dec 2018 02:00:29 +0000 (02:00 +0000)]
[analyzer] MoveChecker: Improve warning and note messages.

The warning piece traditionally describes the bug itself, i.e.
"The bug is a _____", eg. "Attempt to delete released memory",
"Resource leak", "Method call on a moved-from object".

Event pieces produced by the visitor are usually in a present tense, i.e.
"At this moment _____": "Memory is released", "File is closed",
"Object is moved".

Additionally, type information is added into the event pieces for STL objects
(in order to highlight that it is in fact an STL object), and the respective
event piece now mentions that the object is left in an unspecified state
after it was moved, which is a vital piece of information to understand the bug.

Differential Revision: https://reviews.llvm.org/D54560

llvm-svn: 348229

5 years agoAdd interceptors for the sysctl(3) API family from NetBSD
Kamil Rytarowski [Tue, 4 Dec 2018 01:51:06 +0000 (01:51 +0000)]
Add interceptors for the sysctl(3) API family from NetBSD

Summary:
Add new interceptors for:

 - sysctl
 - sysctlbyname
 - sysctlgetmibinfo
 - sysctlnametomib
 - asysctl
 - asysctlbyname

Cover the API with a new test file TestCases/NetBSD/sysctl.cc.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: devnexen, kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D54076

llvm-svn: 348228

5 years agoAdd interceptors for the fts(3) API family from NetBSD
Kamil Rytarowski [Tue, 4 Dec 2018 01:45:52 +0000 (01:45 +0000)]
Add interceptors for the fts(3) API family from NetBSD

Summary:
fts(3) is API to traverse a file hierarchy.
Cover this interface with interceptors.

Add a test to validate the interface reading
the number of regular files in /etc.

Based on original work by Yang Zheng.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D54247

llvm-svn: 348227

5 years ago[TableGen] Improve the formatting of the emitted predicates (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:22 +0000 (01:43 +0000)]
[TableGen] Improve the formatting of the emitted predicates (NFC)

llvm-svn: 348226

5 years ago[TableGen] Fix typo in emitted comment (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:19 +0000 (01:43 +0000)]
[TableGen] Fix typo in emitted comment (NFC)

llvm-svn: 348225

5 years agoAdd new interceptor for regex(3) in NetBSD
Kamil Rytarowski [Tue, 4 Dec 2018 01:41:42 +0000 (01:41 +0000)]
Add new interceptor for regex(3) in NetBSD

Summary:
Add interceptors for the NetBSD style of regex(3) present inside libc:

 - regcomp
 - regexec
 - regerror
 - regfree
 - regnsub
 - regasub

Add a dedicated test verifying the installed interceptors.

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D54584

llvm-svn: 348224

5 years ago[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.
Lang Hames [Tue, 4 Dec 2018 00:55:15 +0000 (00:55 +0000)]
[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.

This patch renames both methods (NotifyObjectEmitted -> notifyObjectLoaded, and
NotifyObjectFreed -> notifyObjectFreed), adds an abstract "ObjectKey" (uint64_t)
parameter to notifyObjectLoaded, and replaces the ObjectFile parameter for
notifyObjectFreed with an ObjectKey. Using an ObjectKey to track identify
events, rather than a reference to the ObjectFile, allows us to free the
ObjectFile after notifyObjectLoaded is called, saving memory.

https://reviews.llvm.org/D53773

llvm-svn: 348223

5 years ago[ARM64][Windows] Fix local stack size for funclets
Sanjin Sijaric [Tue, 4 Dec 2018 00:54:52 +0000 (00:54 +0000)]
[ARM64][Windows] Fix local stack size for funclets

The comment was misplaced, and the code didn't do what the comment indicated,
namely ignoring the varargs portion when computing the local stack size of a
funclet in emitEpilogue.  This results in incorrect offset computations within
funclets that are contained in vararg functions.

Differential Revision: https://reviews.llvm.org/D55096

llvm-svn: 348222

5 years ago[asan] Reduce binary size by using unnamed private aliases
Vitaly Buka [Tue, 4 Dec 2018 00:36:14 +0000 (00:36 +0000)]
[asan] Reduce binary size by using unnamed private aliases

Summary:
--asan-use-private-alias increases binary sizes by 10% or more.
Most of this space was long names of aliases and new symbols.
These symbols are not needed for the ODC check at all.

Reviewers: eugenis

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D55146

llvm-svn: 348221

5 years ago[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo
Jessica Paquette [Tue, 4 Dec 2018 00:31:55 +0000 (00:31 +0000)]
[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo

This moves the stack check logic into a lambda within getOutliningCandidateInfo.

This allows us to be less conservative with stack checks. Whether or not a
stack instruction is safe to outline is dependent on the frame variant and call
variant of the outlined function; only in cases where we modify the stack can
these be unsafe.

So, if we move that logic later, when we're looking at an individual candidate,
we can make better decisions here.

This gives some code size savings as a result.

llvm-svn: 348220

5 years ago[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic
Jessica Paquette [Tue, 4 Dec 2018 00:31:47 +0000 (00:31 +0000)]
[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic

If we dropped too many candidates to be beneficial when dropping candidates
that modify the stack, there's no reason to check for other cost model
qualities.

llvm-svn: 348219

5 years agoNFC: Make this test kinder on downstream forks
Erik Pilkington [Tue, 4 Dec 2018 00:31:31 +0000 (00:31 +0000)]
NFC: Make this test kinder on downstream forks

Downstream forks that have their own attributes often run into this
test failing when a new attribute is added to clang because the
number of supported attributes no longer match. This is redundant
information for this test, so we can get by without it.

rdar://46288577

llvm-svn: 348218

5 years ago[projects] Use directory name for add_llvm_external_projects
Shoaib Meenai [Tue, 4 Dec 2018 00:12:03 +0000 (00:12 +0000)]
[projects] Use directory name for add_llvm_external_projects

add_llvm_external_projects expects the directory name instead of the
full path, otherwise the check for an in-tree subproject will fail and
the project won't be configured.

llvm-svn: 348217

5 years ago[ThinLTO] Look through aliases when computing hash keys
George Burgess IV [Tue, 4 Dec 2018 00:02:33 +0000 (00:02 +0000)]
[ThinLTO] Look through aliases when computing hash keys

Without this, we don't consider types used by aliasees in our cache key.
This caused issues when using the same cache for thin-linking the same
TU with different sets of virtual call candidates for a virtual call
inside of a constructor. That's sort of a mouthful. :)

Differential Revision: https://reviews.llvm.org/D55060

llvm-svn: 348216

5 years ago[IR] Don't assume all functions are 4 byte aligned
Ranjeet Singh [Tue, 4 Dec 2018 00:01:23 +0000 (00:01 +0000)]
[IR] Don't assume all functions are 4 byte aligned

In some cases different alignments for function might be used to save
space e.g. thumb mode with -Oz will try to use 2 byte function
alignment. Similar patch that fixed this in other areas exists here
https://reviews.llvm.org/D46110

Differential Revision: https://reviews.llvm.org/D55115

llvm-svn: 348215

5 years ago[Hexagon] Fix intrinsic test
Krzysztof Parzyszek [Mon, 3 Dec 2018 23:52:33 +0000 (23:52 +0000)]
[Hexagon] Fix intrinsic test

llvm-svn: 348214

5 years agoRelax test even more for Windows
Adrian Prantl [Mon, 3 Dec 2018 23:40:51 +0000 (23:40 +0000)]
Relax test even more for Windows

llvm-svn: 348213

5 years agoRemove unused empty arm64 directory
Yi Kong [Mon, 3 Dec 2018 23:37:51 +0000 (23:37 +0000)]
Remove unused empty arm64 directory

llvm-svn: 348212

5 years agoRelax tests to also work on Windows
Adrian Prantl [Mon, 3 Dec 2018 23:11:19 +0000 (23:11 +0000)]
Relax tests to also work on Windows

llvm-svn: 348211

5 years ago[analyzer] MoveChecker: Restrict to locals and std:: objects.
Artem Dergachev [Mon, 3 Dec 2018 23:06:07 +0000 (23:06 +0000)]
[analyzer] MoveChecker: Restrict to locals and std:: objects.

In general case there use-after-move is not a bug. It depends on how the
move-constructor or move-assignment is implemented.

In STL, the convention that applies to most classes is that the move-constructor
(-assignment) leaves an object in a "valid but unspecified" state. Using such
object without resetting it to a known state first is likely a bug. Objects

Local value-type variables are special because due to their automatic lifetime
there is no intention to reuse space. If you want a fresh object, you might
as well make a new variable, no need to move from a variable and than re-use it.
Therefore, it is not always a bug, but it is obviously easy to suppress when it
isn't, and in most cases it indeed is - as there's no valid intention behind
the intentional use of a local after move.

This applies not only to local variables but also to parameter variables,
not only of value type but also of rvalue reference type (but not to lvalue
references).

Differential Revision: https://reviews.llvm.org/D54557

llvm-svn: 348210

5 years agoNFC: Add .vscode to .gitignore
Gor Nishanov [Mon, 3 Dec 2018 22:51:07 +0000 (22:51 +0000)]
NFC: Add .vscode to .gitignore

llvm-svn: 348209

5 years ago[analyzer] MoveChecker: NFC: Remove the workaround for the "zombie symbols" bug.
Artem Dergachev [Mon, 3 Dec 2018 22:44:16 +0000 (22:44 +0000)]
[analyzer] MoveChecker: NFC: Remove the workaround for the "zombie symbols" bug.

The checker had extra code to clean up memory regions that were sticking around
in the checker without ever being cleaned up due to the bug that was fixed in
r347953. Because of that, if a region was moved from, then became dead,
and then reincarnated, there were false positives.

Why regions are even allowed to reincarnate is a separate story. Luckily, this
only happens for local regions that don't produce symbols when loaded from.

No functional change intended. The newly added test demonstrates that even
though no cleanup is necessary upon destructor calls, the early return
cannot be removed. It was not failing before the patch.

Differential Revision: https://reviews.llvm.org/D54372

llvm-svn: 348208

5 years ago[FileSystem] Migrate MonitoringProcessLauncher
Jonas Devlieghere [Mon, 3 Dec 2018 22:41:32 +0000 (22:41 +0000)]
[FileSystem] Migrate MonitoringProcessLauncher

Use the FileSystem helpers instead of using the file system directly.

llvm-svn: 348207

5 years ago[Hexagon] Switch to auto-generated intrinsic definitions and patterns
Krzysztof Parzyszek [Mon, 3 Dec 2018 22:40:36 +0000 (22:40 +0000)]
[Hexagon] Switch to auto-generated intrinsic definitions and patterns

llvm-svn: 348206

5 years ago[CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)
Vedant Kumar [Mon, 3 Dec 2018 22:40:21 +0000 (22:40 +0000)]
[CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)

If a PHI node out of extracted region has multiple incoming values from it,
split this PHI on two parts. First PHI has incomings only from region and
extracts with it (they are placed to the separate basic block that added to the
list of outlined), and incoming values in original PHI are replaced by first
PHI. Similar solution is already used in CodeExtractor for PHIs in entry block
(severSplitPHINodes method). It covers PR39433 bug.

Patch by Sergei Kachkov!

Differential Revision: https://reviews.llvm.org/D55018

llvm-svn: 348205

5 years ago[WebAssembly] Don't set a maximum size when importing the table
Sam Clegg [Mon, 3 Dec 2018 22:37:55 +0000 (22:37 +0000)]
[WebAssembly] Don't set a maximum size when importing the table

We shouldn't be setting setting a max size for a table that is
being imported.

Differential Revision: https://reviews.llvm.org/D55231

llvm-svn: 348204

5 years agoAdapt gcov to changes in CFE.
Adrian Prantl [Mon, 3 Dec 2018 22:37:48 +0000 (22:37 +0000)]
Adapt gcov to changes in CFE.

The clang frontend no longer emits the current working directory for
DIFiles containing an absolute path in the filename: and will move the
common prefix between current working directory and the file into the
directory: component.

This fixes the GCOV tests in compiler-rt that were broken by the Clang
change.

llvm-svn: 348203

5 years ago[Documentation] Fix formatting and wrap up to 80 characters in Clang-tidy readability...
Eugene Zelenko [Mon, 3 Dec 2018 22:35:40 +0000 (22:35 +0000)]
[Documentation] Fix formatting and wrap up to 80 characters in Clang-tidy readability-uppercase-literal-suffix documentation.

llvm-svn: 348202

5 years ago[analyzer] Rename MisusedMovedObjectChecker to MoveChecker
Artem Dergachev [Mon, 3 Dec 2018 22:32:32 +0000 (22:32 +0000)]
[analyzer] Rename MisusedMovedObjectChecker to MoveChecker

This follows the Static Analyzer's tradition to name checkers after
things in which they find bugs, not after bugs they find.

Differential Revision: https://reviews.llvm.org/D54556

llvm-svn: 348201

5 years ago[analyzer] Dump stable identifiers for objects under construction.
Artem Dergachev [Mon, 3 Dec 2018 22:23:21 +0000 (22:23 +0000)]
[analyzer] Dump stable identifiers for objects under construction.

This continues the work that was started in r342313, which now gets applied to
object-under-construction tracking in C++. Makes it possible to debug
temporaries by dumping exploded graphs again.

Differential Revision: https://reviews.llvm.org/D54459

llvm-svn: 348200

5 years ago[AST] [analyzer] NFC: Reuse code in stable ID dumping methods.
Artem Dergachev [Mon, 3 Dec 2018 22:19:05 +0000 (22:19 +0000)]
[AST] [analyzer] NFC: Reuse code in stable ID dumping methods.

Use the new fancy method introduced in r348197 to simplify some code.

Differential Revision: https://reviews.llvm.org/D54488

llvm-svn: 348199

5 years ago[AST] Generate unique identifiers for CXXCtorInitializer objects.
Artem Dergachev [Mon, 3 Dec 2018 22:15:34 +0000 (22:15 +0000)]
[AST] Generate unique identifiers for CXXCtorInitializer objects.

This continues the work started in r342309 and r342315 to provide identifiers
to AST objects that are shorter and easier to read and remember than pointers.

Differential Revision: https://reviews.llvm.org/D54457

llvm-svn: 348198

5 years agoBumpPtrAllocator: Add a couple of convenient wrappers around identifyObject().
Artem Dergachev [Mon, 3 Dec 2018 22:05:24 +0000 (22:05 +0000)]
BumpPtrAllocator: Add a couple of convenient wrappers around identifyObject().

This allows obtaining smaller, more readable identifiers
in a more comfortable way.

Differential Revision: https://reviews.llvm.org/D54486

llvm-svn: 348197

5 years ago[Hexagon] Extract operand decoders into a separate file, NFC
Krzysztof Parzyszek [Mon, 3 Dec 2018 21:59:21 +0000 (21:59 +0000)]
[Hexagon] Extract operand decoders into a separate file, NFC

These decoders are automatically generated. Keeping them separated makes
updating architectures easier.

llvm-svn: 348196

5 years ago[DAGCombiner] narrow truncated vector binops when legal
Sanjay Patel [Mon, 3 Dec 2018 21:57:35 +0000 (21:57 +0000)]
[DAGCombiner] narrow truncated vector binops when legal

This is the smallest vector enhancement I could find to D54640.
Here, we're allowing narrowing to only legal vector ops because we'll see
regressions without that. All of the test diffs are wins from what I can tell.
With AVX/AVX512, we can shrink ymm/zmm ops to xmm.

x86 vector multiplies are the problem case that we're avoiding due to the
patchwork ISA, and it's not clear to me if we can dance around those
regressions using TLI hooks or if we need preliminary patches to plug those
holes.

Differential Revision: https://reviews.llvm.org/D55126

llvm-svn: 348195

5 years ago[mips] Fix TestDWARF32Version5Addr8AllForms test failure on MIPS hosts
Simon Atanasyan [Mon, 3 Dec 2018 21:54:43 +0000 (21:54 +0000)]
[mips] Fix TestDWARF32Version5Addr8AllForms test failure on MIPS hosts

The `DIEExpr` is used in debug information entries for either TLS variables
or call sites. For now the last case is unsupported for targets with delay
slots, for MIPS in particular.

The `DIEExpr::EmitValue` method calls a virtual `EmitDebugThreadLocal`
routine which, in case of MIPS, always emits either `.dtprelword` or
`.dtpreldword` directives. That is okay for "main" code, but in unit
tests `DIEExpr` instances can be created not for TLS variables only even
on MIPS hosts. That is a reason of the `TestDWARF32Version5Addr8AllForms`
failure because handling of the `R_MIPS_TLS_DTPREL` relocation writes
incorrect value into dwarf structures. And anyway unconditional emitting
of `.dtprelword` directives will be incorrect when/if debug information
entries for call sites become supported on MIPS.

The patch solves the problem by wrapping expression created in the
`MipsTargetObjectFile::getDebugThreadLocalSymbol` method in to the
`MipsMCExpr` expression with a new `MEK_DTPREL` tag. This tag is
recognized in the `MipsAsmPrinter::EmitDebugThreadLocal` method and
`.dtprelword` directives created in this case only. In other cases the
expression saved as a regular data.

Differential Revision: http://reviews.llvm.org/D54937

llvm-svn: 348194

5 years ago[Hexagon] Remove unused encodings, NFC
Krzysztof Parzyszek [Mon, 3 Dec 2018 21:49:12 +0000 (21:49 +0000)]
[Hexagon] Remove unused encodings, NFC

llvm-svn: 348193

5 years agoTypo correction; NFC.
Aaron Ballman [Mon, 3 Dec 2018 21:27:15 +0000 (21:27 +0000)]
Typo correction; NFC.

llvm-svn: 348192

5 years ago[InstCombine] fix undef propagation bug with shuffle+binop
Sanjay Patel [Mon, 3 Dec 2018 21:15:17 +0000 (21:15 +0000)]
[InstCombine] fix undef propagation bug with shuffle+binop

When we have a shuffle that extends a source vector with undefs
and then do some binop on that, we must make sure that the extra
elements remain undef with that binop if we reverse the order of
the binop and shuffle.

'or' is probably the easiest example to show the bug because
'or C, undef --> -1' (not undef). But there are other
opcode/constant combinations where this is true as shown by
the 'shl' test.

llvm-svn: 348191

5 years ago[gn build] Use print_function in write_cmake_config.py
Nico Weber [Mon, 3 Dec 2018 21:10:19 +0000 (21:10 +0000)]
[gn build] Use print_function in write_cmake_config.py

No behavior change, just makes the script match the other scripts in
llvm/utils/gn/build.

Differential Revision: https://reviews.llvm.org/D55183

llvm-svn: 348190

5 years agoNFC: Simplify dumpStmt child handling
Stephen Kelly [Mon, 3 Dec 2018 21:05:52 +0000 (21:05 +0000)]
NFC: Simplify dumpStmt child handling

Reviewers: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D55068

llvm-svn: 348189

5 years agoRe-apply r347954 "[analyzer] Nullability: Don't detect post factum violation..."
Artem Dergachev [Mon, 3 Dec 2018 21:04:30 +0000 (21:04 +0000)]
Re-apply r347954 "[analyzer] Nullability: Don't detect post factum violation..."

Buildbot failures were caused by an unrelated UB that was introduced in r347943
and fixed in r347970.

Also the revision was incorrectly specified as r344580 during revert.

Differential Revision: https://reviews.llvm.org/D54017

llvm-svn: 348188

5 years ago[gcov/Darwin] Ensure external symbols are exported when using an export list
Vedant Kumar [Mon, 3 Dec 2018 20:53:58 +0000 (20:53 +0000)]
[gcov/Darwin] Ensure external symbols are exported when using an export list

Make sure that symbols needed to implement runtime support for gcov are
exported when using an export list on Darwin.

Without the clang driver exporting these symbols, the linker hides them,
resulting in tapi verification failures.

rdar://45944768

Differential Revision: https://reviews.llvm.org/D55151

llvm-svn: 348187

5 years agoSkip TestDriverOptions on Windows
Jonas Devlieghere [Mon, 3 Dec 2018 20:36:21 +0000 (20:36 +0000)]
Skip TestDriverOptions on Windows

It's not clear to me why this is failing on Windows. Maybe it has
something to do with the path?

llvm-svn: 348186

5 years ago[WebAssembly] Enforce assembler emits to streamer in order.
Wouter van Oortmerssen [Mon, 3 Dec 2018 20:30:28 +0000 (20:30 +0000)]
[WebAssembly] Enforce assembler emits to streamer in order.

Summary:
The assembler processes directives and instructions in whatever order
they are in the file, then directly emits them to the streamer. This
could cause badly written (or generated) .s files to produce
incorrect binaries.

It now has state that tracks what it has most recently seen, to
enforce they are emitted in a given order that always produces
correct wasm binaries.

Also added a new test that compares obj2yaml output from llc (the
backend) to that going via .s and the assembler to ensure both paths
generate the same binaries.

The features this test covers could be extended.

Passes all wasm Lit tests.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=39557

Reviewers: sbc100, dschuff, aheejin

Subscribers: jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D55149

llvm-svn: 348185

5 years agoPortable Python script across Python version
Serge Guelton [Mon, 3 Dec 2018 20:26:51 +0000 (20:26 +0000)]
Portable Python script across Python version

Workaround naming and hierarchy changes in BaseHTTPServer and SimpleHTTPServer module.

Differential Revision: https://reviews.llvm.org/D55203

llvm-svn: 348184

5 years ago[Hexagon] Update timing classes
Krzysztof Parzyszek [Mon, 3 Dec 2018 20:13:18 +0000 (20:13 +0000)]
[Hexagon] Update timing classes

llvm-svn: 348183

5 years agoPortable Python script across Python version
Serge Guelton [Mon, 3 Dec 2018 20:12:34 +0000 (20:12 +0000)]
Portable Python script across Python version

Python2 supports both backticks and `repr` to access the __repr__ slot. Python3 only supports `repr`.

Differential Revision: https://reviews.llvm.org/D55201

llvm-svn: 348182

5 years ago[InstCombine] foldICmpWithLowBitMaskedVal(): disable 2 faulty folds.
Roman Lebedev [Mon, 3 Dec 2018 20:07:58 +0000 (20:07 +0000)]
[InstCombine] foldICmpWithLowBitMaskedVal(): disable 2 faulty folds.

These two folds are invalid for this non-constant pattern
when the mask ends up being all-ones:
https://rise4fun.com/Alive/9au
https://rise4fun.com/Alive/UcQM

Fixes https://bugs.llvm.org/show_bug.cgi?id=39861

llvm-svn: 348181

5 years ago[cmake] Clean up add_llvm_subdirectory
Shoaib Meenai [Mon, 3 Dec 2018 20:05:11 +0000 (20:05 +0000)]
[cmake] Clean up add_llvm_subdirectory

I found the pattern of setting the project_BUILD variable to OFF after
processing the project to be pretty confusing. Using global properties
to explicitly keep track of whether a project has been processed or not
seems much more straightforward, and it also allows us to convert the
macro into a function (which is required for the early return).

Factor the project+type+name combination out into a variable while I'm
here, since it's used a whole bunch of times.

I don't believe this should result in any functional changes.

Differential Revision: https://reviews.llvm.org/D55104

llvm-svn: 348180

5 years ago[TextAPI] Remove a superfluous semicolon, fixing GCC warnings. NFC.
Martin Storsjo [Mon, 3 Dec 2018 20:02:15 +0000 (20:02 +0000)]
[TextAPI] Remove a superfluous semicolon, fixing GCC warnings. NFC.

llvm-svn: 348179

5 years ago[COFF] Remove an outdated/incorrect comment. NFC.
Martin Storsjo [Mon, 3 Dec 2018 20:02:11 +0000 (20:02 +0000)]
[COFF] Remove an outdated/incorrect comment. NFC.

Making the section writable doesn't affect how windows does
base relocs in case a DLL can't be loaded at the intended base
address.

This comment dates back to SVN r79346.

Differential Revision:

llvm-svn: 348178

5 years ago[COFF] Don't mark mingw .eh_frame sections writable
Martin Storsjo [Mon, 3 Dec 2018 20:02:05 +0000 (20:02 +0000)]
[COFF] Don't mark mingw .eh_frame sections writable

This improves compatibility with GCC produced object files, where
the .eh_frame sections are read only. With mixed flags for the
involved .eh_frame sections, LLD creates two separate .eh_frame
sections in the output binary, one for each flag combination,
while ld.bfd probably merges them.

The previous setup of flags can be traced back to SVN r79346.

Differential Revision: https://reviews.llvm.org/D55209

llvm-svn: 348177

5 years agoFix compilation failure on Windows.
Zachary Turner [Mon, 3 Dec 2018 19:59:00 +0000 (19:59 +0000)]
Fix compilation failure on Windows.

This was introduced earlier but apparently used an incorrect
class name so it doesn't compile on Windows.

llvm-svn: 348176

5 years ago[InstCombine] rearrange shuffle+binop fold; NFC
Sanjay Patel [Mon, 3 Dec 2018 19:53:04 +0000 (19:53 +0000)]
[InstCombine] rearrange shuffle+binop fold; NFC

This code has a bug dealing with undefs, so we need
to add another escape hatch, so doing some cleanup
ahead of that.

llvm-svn: 348175

5 years ago[llvm-objcopy] Add --build-id-link-dir flag
Jake Ehrlich [Mon, 3 Dec 2018 19:49:23 +0000 (19:49 +0000)]
[llvm-objcopy] Add --build-id-link-dir flag

This flag does not exist in GNU objcopy but has a major use case.
Debugging tools support the .build-id directory structure to find
debug binaries. There is no easy way to build this structure up
however. One way to do it is by using llvm-readelf and some crazy
shell magic. This implements the feature directly. It is most often
the case that you'll want to strip a file and send the original to
the .build-id directory but if you just want to send a file to the
.build-id directory you can copy to /dev/null instead.

Differential Revision: https://reviews.llvm.org/D54384

llvm-svn: 348174

5 years ago[InstCombine] add tests for shuffle+binop fold; NFC
Sanjay Patel [Mon, 3 Dec 2018 19:41:21 +0000 (19:41 +0000)]
[InstCombine] add tests for shuffle+binop fold; NFC

llvm-svn: 348173

5 years ago[clang-tidy] Fix unordered_map failure with specializing std::hash<> and remove previ...
Jonas Toth [Mon, 3 Dec 2018 19:41:04 +0000 (19:41 +0000)]
[clang-tidy] Fix unordered_map failure with specializing std::hash<> and remove previous wrong attempt at doing so

llvm-svn: 348172

5 years ago[Hexagon] Change instruction type field in TSFlags to 7 bits
Krzysztof Parzyszek [Mon, 3 Dec 2018 19:34:04 +0000 (19:34 +0000)]
[Hexagon] Change instruction type field in TSFlags to 7 bits

llvm-svn: 348171

5 years ago[llvm-tapi] initial commit, supports ELF text stubs
Armando Montanez [Mon, 3 Dec 2018 19:30:52 +0000 (19:30 +0000)]
[llvm-tapi] initial commit, supports ELF text stubs

http://lists.llvm.org/pipermail/llvm-dev/2018-September/126472.html

TextAPI is a library and accompanying tool that allows conversion between binary shared object stubs and textual counterparts. The motivations and uses cases for this are explained thoroughly in the llvm-dev proposal [1]. This initial commit proposes a potential structure for the TAPI library, also including support for reading/writing text-based ELF stubs (.tbe) in addition to preliminary support for reading binary ELF files. The goal for this patch is to ensure the project architecture appropriately welcomes integration of Mach-O stubbing from Apple's TAPI [2].

Added:

 - TextAPI library
 - .tbe read support
 - .tbe write (to raw_ostream) support

[1] http://lists.llvm.org/pipermail/llvm-dev/2018-September/126472.html
[2] https://github.com/ributzka/tapi

Differential Revision: https://reviews.llvm.org/D53051

llvm-svn: 348170

5 years ago[clang-tidy] Recommit: Add the abseil-duration-comparison check
Jonas Toth [Mon, 3 Dec 2018 19:22:08 +0000 (19:22 +0000)]
[clang-tidy] Recommit: Add the abseil-duration-comparison check

Summary:
This check finds instances where Duration values are being converted to a numeric value in a comparison expression, and suggests that the conversion happen on the other side of the expression to a Duration.  See documentation for examples.

This also shuffles some code around so that the new check may perform in sone step simplifications also caught by other checks.
Compilation is unbroken, because the hash-function is now directly
specified for std::unordered_map, as 'enum class' does not compile as
key (seamingly only on some compilers).

Patch by hwright.

Reviewers: aaron.ballman, JonasToth, alexfh, hokein

Reviewed By: JonasToth

Subscribers: sammccall, Eugene.Zelenko, xazax.hun, cfe-commits, mgorny

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D54737

llvm-svn: 348169

5 years ago[MachineOutliner] Drop candidates that require fixups if it's beneficial
Jessica Paquette [Mon, 3 Dec 2018 19:11:27 +0000 (19:11 +0000)]
[MachineOutliner] Drop candidates that require fixups if it's beneficial

If it's a bigger code size win to drop candidates that require stack fixups
than to demote every candidate to that variant, the outliner should do that.

This happens if the number of bytes taken by calls to functions that don't
require fixups, plus the number of bytes that'd be left is less than the
number of bytes that it'd take to emit a save + restore for all candidates.

Also add tests for each possible new behaviour.

- machine-outliner-compatible-candidates shows that when we have candidates
that don't use the stack, we can use the default call variant along with the
no save/regsave variant.

- machine-outliner-all-stack shows that when it's better to fix up the stack,
we still will demote all candidates to that case

- machine-outliner-drop-stack shows that we can discard candidates that
require stack fixups when it would be beneficial to do so.

llvm-svn: 348168

5 years ago[Hexagon] Add HasV5 predicate for compatibility with auto-generated files
Krzysztof Parzyszek [Mon, 3 Dec 2018 19:05:42 +0000 (19:05 +0000)]
[Hexagon] Add HasV5 predicate for compatibility with auto-generated files

llvm-svn: 348167

5 years agoFix issue with Tpi Stream hash map.
Zachary Turner [Mon, 3 Dec 2018 19:05:12 +0000 (19:05 +0000)]
Fix issue with Tpi Stream hash map.

Part of the patch to not build the hash map eagerly was omitted
due to a merge conflict.  Add it back, which should fix the failing
tests.

llvm-svn: 348166

5 years agoRevert "[clang-tidy] Add the abseil-duration-comparison check"
Jonas Toth [Mon, 3 Dec 2018 18:59:27 +0000 (18:59 +0000)]
Revert "[clang-tidy] Add the abseil-duration-comparison check"

This commit broke buildbots and needs adjustments.

llvm-svn: 348165

5 years ago[X86] Fix bad formatting. NFC
Craig Topper [Mon, 3 Dec 2018 18:58:57 +0000 (18:58 +0000)]
[X86] Fix bad formatting. NFC

llvm-svn: 348164