platform/upstream/llvm.git
4 years ago[clang-tidy] Pass -faligned-allocation on the compiler command line to
Akira Hatanaka [Fri, 6 Dec 2019 19:51:58 +0000 (11:51 -0800)]
[clang-tidy] Pass -faligned-allocation on the compiler command line to
fix compile error

The test was failing when run on OSes older than MacOSX10.14 because
aligned deallocation functions are unavailable on older OSes.

rdar://problem/57706710

4 years agoRevert "[PGO][PGSO] Instrument the code gen / target passes."
Hiroshi Yamauchi [Fri, 6 Dec 2019 20:17:32 +0000 (12:17 -0800)]
Revert "[PGO][PGSO] Instrument the code gen / target passes."

This reverts commit 9a0b5e14075a1f42a72eedb66fd4fde7985d37ac.

This seems to break buildbots.

4 years ago[OPENMP50]Add if clause in distribute simd directive.
Alexey Bataev [Fri, 6 Dec 2019 17:21:31 +0000 (12:21 -0500)]
[OPENMP50]Add if clause in distribute simd directive.

According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.

4 years ago[AutoFDO] Inline replay for cold/small callees from sample profile loader
Wenlei He [Tue, 26 Nov 2019 23:53:06 +0000 (15:53 -0800)]
[AutoFDO] Inline replay for cold/small callees from sample profile loader

Summary:
Sample profile loader of AutoFDO tries to replay previous inlining using context sensitive profile. The replay only repeats inlining if the call site block is hot. As a result it punts inlining of small functions, some of which can be beneficial for size, and will still be inlined by CSGCC inliner later. The oscillation between sample profile loader's inlining and regular CGSSC inlining cause unnecessary loss of context-sensitive profile. It doesn't have much impact for inline decision itself, but it negatively affects post-inline profile quality as CGSCC inliner have to scale counts which is not as accurate as the original context sensitive profile, and bad post-inline profile can misguide code layout.

This change added regular Inline Cost calculation for sample profile loader, so we can inline small functions upfront under switch -sample-profile-inline-size. In addition -sample-profile-cold-inline-threshold is added so we can tune the separate size threshold - currently the default is chosen to be the same as regular inliner's cold call-site threshold.

Reviewers: wmi, davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoStop checking whether std::strong_* has ::equivalent members.
Richard Smith [Fri, 6 Dec 2019 19:34:29 +0000 (11:34 -0800)]
Stop checking whether std::strong_* has ::equivalent members.

Any attempt to use these would be a bug, so we shouldn't even look for
them.

4 years agoAvoid naming variable after type to fix GCC 5.3 build
Reid Kleckner [Fri, 6 Dec 2019 19:24:25 +0000 (11:24 -0800)]
Avoid naming variable after type to fix GCC 5.3 build

GCC says:
.../llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp:195:12:
error: ‘InfoType’ is not a class, namespace, or enumeration
       case InfoType::EndOfList:
                   ^

Presumably, GCC thinks InfoType is a variable here. Work around it by
using the name IT as is done above.

4 years agoRevert "[InstCombine] reduce code duplication; NFC"
Sanjay Patel [Fri, 6 Dec 2019 19:24:14 +0000 (14:24 -0500)]
Revert "[InstCombine] reduce code duplication; NFC"

This reverts commit db5739658467e20a52f20e769d3580412e13ff87.
At least 1 of these supposedly NFC commits wasn't - sanitizer bot is angry.

4 years agoRevert "[InstCombine] improve readability; NFC"
Sanjay Patel [Fri, 6 Dec 2019 19:20:44 +0000 (14:20 -0500)]
Revert "[InstCombine] improve readability; NFC"

This reverts commit 7250ef3613cc6b81145b9543bafb86d7f9466cde.
At least 1 of these supposedly NFC commits wasn't - sanitizer bot is angry.

4 years agoRevert "[InstCombine] reduce indentation; NFC"
Sanjay Patel [Fri, 6 Dec 2019 19:19:02 +0000 (14:19 -0500)]
Revert "[InstCombine] reduce indentation; NFC"

This reverts commit 8bf8ef7116bd0daec570b35480ca969b74e66c6e.
At least 1 of these supposedly NFC commits wasn't - sanitizer bot is angry.

4 years ago[libcxx{,abi}] Don't link libpthread and libdl on Fuchsia
Petr Hosek [Fri, 6 Dec 2019 19:11:31 +0000 (11:11 -0800)]
[libcxx{,abi}] Don't link libpthread and libdl on Fuchsia

These are a part of the libc so linking these explicitly isn't necessary
and embedding these as deplibs causes link time error.

This issues was introduced in a9b5fff which changed how we emit deplibs.

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

4 years agoRevert "ARM-Darwin: keep the frame register reserved even if not updated."
Alina Sbirlea [Fri, 6 Dec 2019 18:37:02 +0000 (10:37 -0800)]
Revert "ARM-Darwin: keep the frame register reserved even if not updated."

This reverts commit a7d90af1be48234ce583e00fb16e33633d44ae38.

This revision came back as the root-cause for crashes in internal
ARM-IOS apps.
Reproducer in https://bugs.llvm.org/show_bug.cgi?id=44231.

4 years ago[x86] add cost model special-case for insert/extract from element 0
Sanjay Patel [Fri, 6 Dec 2019 18:29:31 +0000 (13:29 -0500)]
[x86] add cost model special-case for insert/extract from element 0

This is a follow-up to D70607 where we made any
extract element on SLM more costly than default. But that is
pessimistic for extract from element 0 because that corresponds
to x86 movd/movq instructions. These generally have >1 cycle
latency, but they are probably implemented as single uop
instructions.

Note that no vectorization tests are affected by this change.
Also, no targets besides SLM are affected because those are
falling through to the default cost of 1 anyway. But this will
become visible/important if we add more specializations via cost
tables.

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

4 years ago[PGO][PGSO] Instrument the code gen / target passes.
Hiroshi Yamauchi [Thu, 5 Dec 2019 17:39:37 +0000 (09:39 -0800)]
[PGO][PGSO] Instrument the code gen / target passes.

Summary:
Split off of D67120.

Add the profile guided size optimization instrumentation / queries in the code
gen or target passes. This doesn't enable the size optimizations in those passes
yet as they are currently disabled in shouldOptimizeForSize (for non-IR pass
queries).

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoclang/AMDGPU: Fix default for frame-pointer attribute
Matt Arsenault [Tue, 19 Nov 2019 09:52:07 +0000 (15:22 +0530)]
clang/AMDGPU: Fix default for frame-pointer attribute

Enabling optimization should allow frame pointer elimination.

4 years ago[OPENMP]Reorganize OpenMP warning groups.
Alexey Bataev [Fri, 6 Dec 2019 18:12:19 +0000 (13:12 -0500)]
[OPENMP]Reorganize OpenMP warning groups.

openmp-mapping group is a subgroup of openmp-target warning group. Also,
added global openmp group to control all other OpenMP warning groups.

4 years ago[InstCombine] reduce indentation; NFC
Sanjay Patel [Fri, 6 Dec 2019 17:51:30 +0000 (12:51 -0500)]
[InstCombine] reduce indentation; NFC

4 years ago[InstCombine] improve readability; NFC
Sanjay Patel [Fri, 6 Dec 2019 15:59:25 +0000 (10:59 -0500)]
[InstCombine] improve readability; NFC

CreateIntCast returns the input if its type matches, so need to duplicate that check.

4 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Fri, 6 Dec 2019 15:43:23 +0000 (10:43 -0500)]
[InstCombine] reduce code duplication; NFC

4 years ago[InstCombine] improve readability; NFC
Sanjay Patel [Fri, 6 Dec 2019 14:34:41 +0000 (09:34 -0500)]
[InstCombine] improve readability; NFC

4 years agoAdd `QualType::hasAddressSpace`. NFC.
Michael Liao [Fri, 6 Dec 2019 16:48:15 +0000 (11:48 -0500)]
Add `QualType::hasAddressSpace`. NFC.

- Add that as a shorthand of <T>.getQualifiers().hasAddressSpace().
- Simplify related code.

4 years ago[MBP] Avoid tail duplication if it can't bring benefit
Guozhi Wei [Thu, 5 Dec 2019 00:01:20 +0000 (16:01 -0800)]
[MBP] Avoid tail duplication if it can't bring benefit

Current tail duplication integrated in bb layout is designed to increase the fallthrough from a BB's predecessor to its successor, but we have observed cases that duplication doesn't increase fallthrough, or it brings too much size overhead.

To overcome these two issues in function canTailDuplicateUnplacedPreds I add two checks:

  make sure there is at least one duplication in current work set.
  the number of duplication should not exceed the number of successors.

The modification in hasBetterLayoutPredecessor fixes a bug that potential predecessor must be at the bottom of a chain.

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

4 years ago[ASTImporter] Implicitly declare parameters for imported ObjCMethodDecls
Raphael Isemann [Fri, 6 Dec 2019 17:10:23 +0000 (18:10 +0100)]
[ASTImporter] Implicitly declare parameters for imported ObjCMethodDecls

Summary:
When Sema encounters a ObjCMethodDecl definition it declares the implicit parameters for the ObjCMethodDecl.
When importing such a method with the ASTImporter we need to do the same for the imported method
otherwise we will crash when generating code (where CodeGen expects that this was called by Sema).

Note I had to implement Objective-C[++] support in Language.cpp as this is the first test for Objective-C and this
would otherwise just hit this 'not implemented' assert when running the unit test.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

4 years ago[NFC][AIX][XCOFF] if the size of Csect is zero, the Csect do not need write any data...
diggerlin [Fri, 6 Dec 2019 17:41:38 +0000 (12:41 -0500)]
[NFC][AIX][XCOFF] if the size of Csect is zero, the Csect do not need write any data into sections

SUMMARY:

if the size of Csect is zero, the Csect do not need write any data into sections
for example, the TOC Csect has zero size, it do not need invoke a
Asm.writeSectionData(W.OS, Csect.MCCsect, Layout);

Reviewers: daltenty
Subscribers: rupprecht, seiyai,hiraditya

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

4 years agoupdate string comparison in clang-format.py
mydeveloperday [Fri, 6 Dec 2019 17:36:56 +0000 (17:36 +0000)]
update string comparison in clang-format.py

Summary: Python 3.8 introduces a SyntaxWarning about string comparisons with 'is'. This commit updates the string comparison in clang-format.py that is done with 'is not' to '!='. This should not break compatibility with older python versions (tested 3.4.9, 2.7.17, 2.7.5, 3.8.0).

Reviewers: MyDeveloperDay, klimek, llvm-commits, cfe-commits

Reviewed By: MyDeveloperDay, klimek

Patch By: pseyfert

Tags: #clang-format, #clang

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

4 years ago[clang-format] update trailing newline treatment in clang-format.py
mydeveloperday [Fri, 6 Dec 2019 17:24:30 +0000 (17:24 +0000)]
[clang-format] update trailing newline treatment in clang-format.py

Summary:
The current clang-format.py does not handle trailing newlines at the end of a file correctly.
Trailing empty lines get removed except one.
As far as I understand this is because clang-format gets fed from stdin and writes to stdout when called from clang-format.py.
In a "normal" file (with no trailing empty lines) the string that gets passed to clang-format does not contain a trailing '\n' after the '\n'.join from python.
The clang-format binary does not add a trailing newline to input from stdin, but (if there are multiple trailing '\n', all except one get removed).

When reading back this means that we see in python from a "normal" file a string with no trailing '\n'. From a file with (potentially multiple) empty line(s) at the end, we get a string with one trailing '\n' back in python. In the former case all is fine, in the latter case split('\n') makes one empty line at the end of the file out of the clang-format output. Desired would be instead that the **file** ends with a newline, but not with an empty line.

For the case that a user specifies a range to format (and wants to keep trailing empty lines) I did **not** try to fix this by simply removing all trailing newlines from the clang-format output. Instead, I add a '\n' to the unformatted file content (i.e. newline-terminate what is passed to clang-format) and then strip off the last newline from the output (which itself is now for sure the newline termination of the clang-format output).

(Should this get approved, I'll need someone to help me land this.)

Reviewers: klimek, MyDeveloperDay

Reviewed By: MyDeveloperDay

Patch By: pseyfert

Subscribers: cfe-commits, llvm-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D70864
update trailing newline treatment in clang-format.py

4 years ago[NFC][AIX][XCOFF] fixed compile warning on the strncpy.
diggerlin [Fri, 6 Dec 2019 17:22:28 +0000 (12:22 -0500)]
[NFC][AIX][XCOFF] fixed compile warning on the strncpy.

SUMMARY:
There is warning when compile the file XCOFFObjectWriter.cpp
/srv/llvm-buildbot-srcatch/llvm-build-dir/openmp-gcc-x86_64-linux-debian/llvm.src/llvm/lib/MC/XCOFFObjectWriter.cpp:414:17: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 8 equals destination size [-Wstringop-truncation]

The patch fixed the warning.

Reviewer: daltenty

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

4 years agoCleanup and speedup NativeRegisterContextLinux_arm64
Muhammad Omair Javaid [Fri, 6 Dec 2019 17:12:39 +0000 (22:12 +0500)]
Cleanup and speedup NativeRegisterContextLinux_arm64

Summary:
This patch simplifies register accesses in NativeRegisterContextLinux_arm64
and also adds some bare minimum caching to avoid multiple calls to ptrace
during a stop.

Linux ptrace returns data in the form of structures containing GPR/FPR data.
This means that one single call is enough to read all GPRs or FPRs. We do
that once per stop and keep reading from or writing to the buffer that we
have in NativeRegisterContextLinux_arm64 class. Before a resume or detach we
write all buffers back.

This is tested on aarch64 thunder x1 with Ubuntu 18.04. Also tested
regressions on x86_64.

Reviewers: labath, clayborg

Reviewed By: labath

Subscribers: kristof.beyls, lldb-commits

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

4 years ago[lldb][test] Handle .categories lookup for inline tests.
Jordan Rupprecht [Fri, 6 Dec 2019 16:36:23 +0000 (08:36 -0800)]
[lldb][test] Handle .categories lookup for inline tests.

Summary:
When creating a test with `lldbinline.MakeInlineTest()`, the reported `inspect.getfile(test.__class__)` is `lldbtest.pyc`, meaning any `.categories` file will be ineffective for those tests. Check for the test_filename first, which inline tests will set.

Additionally, raise an error with the starting dir if `.categories` is not found. This makes the problem more obvious when it occurs: when the test is separated from the test framework tree.

Reviewers: labath, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[LegalizeTypes] Add missing case for STRICT_FP_ROUND softening
John Brawn [Thu, 5 Dec 2019 11:33:49 +0000 (11:33 +0000)]
[LegalizeTypes] Add missing case for STRICT_FP_ROUND softening

This fixes a test failure in test/CodeGen/ARM/fp-intrinsics.ll.

4 years ago[OpenMP] Fix linkage issue on FreeBSD
David Carlier [Fri, 6 Dec 2019 15:47:50 +0000 (15:47 +0000)]
[OpenMP] Fix linkage issue on FreeBSD

needs kmp_set_thread_affinity_mask_initial implementation.

4 years ago[libomptarget][nfc] Move cuda threadfence functions behind kmpc_impl
JonChesterfield [Fri, 6 Dec 2019 15:41:17 +0000 (15:41 +0000)]
[libomptarget][nfc] Move cuda threadfence functions behind kmpc_impl

Summary:
[libomptarget][nfc] Move cuda threadfence functions behind kmpc_impl

Part of building code under common/ without requiring a cuda compiler

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: ABataev

Subscribers: jvesely, jfb, openmp-commits

Tags: #openmp

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

4 years ago[libomptarget][nfc] Move three more files to common
Jon Chesterfield [Fri, 6 Dec 2019 15:29:49 +0000 (15:29 +0000)]
[libomptarget][nfc] Move three more files to common

Summary: [libomptarget][nfc] Move three more files to common

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: ABataev

Subscribers: openmp-commits

Tags: #openmp

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

4 years ago[ARM][MVE] Fix copy-paste error in VQSHL instruction ids.
Simon Tatham [Fri, 6 Dec 2019 15:23:07 +0000 (15:23 +0000)]
[ARM][MVE] Fix copy-paste error in VQSHL instruction ids.

Summary:
The immediate forms of the MVE VQSHL instruction have MC names like
`MVE_VSLIimms8` and `MVE_VSLIimmu32`. Those names are confusing,
because VSLI is a completely different shift instruction with no
semantic relation to VQSHL. But it just happens to be defined
immediately before VQSHL in `ARMInstrMVE.td`, so this looks like a
copy-paste error. Renamed the ids to match the instruction name.

Reviewers: ostannard, dmgreen, MarkMurrayARM, miyuki

Reviewed By: miyuki

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AIX][XCOFF] created a test case to verify the raw text section of xcoffobject file
diggerlin [Fri, 6 Dec 2019 15:12:09 +0000 (10:12 -0500)]
[AIX][XCOFF] created a test case to verify the raw text section of xcoffobject file

SUMMARY:
in the patch https://reviews.llvm.org/D66969 . we need a test case to verify the out text section of the xcoffobject file is correct or not.

but we do not have llvm disassembly tools to dump the xcoffobjectfile . since we commit the patch https://reviews.llvm.org/D70255, we have tools for it. we create this test case for it.

Reviewers: daltenty,hubert.reinterpretcast,

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

4 years ago[OPENMP]Moved warning fo mapping non-trivially copiable types into a
Alexey Bataev [Fri, 6 Dec 2019 14:49:07 +0000 (09:49 -0500)]
[OPENMP]Moved warning fo mapping non-trivially copiable types into a
separate group.

Need to move this warning into a separate group to make easier to
disable this warning, if required.

4 years ago[AArch64] Fix a bug with jump table generation
Cullen Rhodes [Fri, 6 Dec 2019 13:28:03 +0000 (13:28 +0000)]
[AArch64] Fix a bug with jump table generation

Summary:
When trying to calculate the offsets for the jump table entries
we fail to take into account the block alignment, which could be
greater than 4 bytes. This led to cases where the jump table
offset was too big to fit in a byte.

Reviewers: t.p.northover, sdesmalen, ostannard

Reviewed By: ostannard

Subscribers: ostannard, kristof.beyls, hiraditya, llvm-commits

Committed on behalf of David Sherwood (david-arm)

Tags: #llvm

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

4 years agogn build: Unbreak mac build after 4066591
Nico Weber [Fri, 6 Dec 2019 14:08:53 +0000 (09:08 -0500)]
gn build: Unbreak mac build after 4066591

4 years agoFix building shared libraries broken by 8e48e8e3e32.
Alexey Lapshin [Fri, 6 Dec 2019 13:04:16 +0000 (16:04 +0300)]
Fix building shared libraries broken by 8e48e8e3e32.

4 years agoAttempt to fix a debuginfo test that wasn't as generic as I thought
Jeremy Morse [Fri, 6 Dec 2019 12:50:18 +0000 (12:50 +0000)]
Attempt to fix a debuginfo test that wasn't as generic as I thought

An ARM buildbot croaks when this test doesn't have a triple specified:

  http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/12021/

Move the test to the X86 directory and put an x86_64 triple on the
llc command line.

4 years agoFix for PR44000. Optimization record for bytecode input missing.
Zahira Ammarguellat [Thu, 5 Dec 2019 15:23:47 +0000 (10:23 -0500)]
Fix for PR44000. Optimization record for bytecode input missing.
Review is here:  https://reviews.llvm.org/D70691

4 years ago[clangd] Switch Hover.All to structured tests
Kadir Cetinkaya [Mon, 2 Dec 2019 18:34:03 +0000 (19:34 +0100)]
[clangd] Switch Hover.All to structured tests

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Store index::SymbolKind in HoverInfo
Kadir Cetinkaya [Tue, 26 Nov 2019 17:06:17 +0000 (18:06 +0100)]
[clangd] Store index::SymbolKind in HoverInfo

Summary:
LSP's SymbolKind has some shortcomings when it comes to C++ types,
index::SymbolKind has more detailed info like Destructor, Parameter, MACRO etc.

We are planning to make use of that information in our new Hover response, and
it would be nice to display the Symbol type in full detail, rather than some
approximation.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[llvm-readobj][llvm-readelf] - Refactor parsing of the SHT_GNU_versym section.
Georgii Rymar [Tue, 3 Dec 2019 09:54:36 +0000 (12:54 +0300)]
[llvm-readobj][llvm-readelf] - Refactor parsing of the SHT_GNU_versym section.

This introduce a new helper which is used to parse the SHT_GNU_versym section.
LLVM/GNU styles implementations now use it to share the logic.

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

4 years ago[LV] Record GEP widening decisions in recipe (NFCI)
Gil Rapaport [Wed, 16 Oct 2019 18:39:53 +0000 (21:39 +0300)]
[LV] Record GEP widening decisions in recipe (NFCI)

InnerLoopVectorizer's code called during VPlan execution still relies on
original IR's def-use relations to decide which vector code to generate,
limiting VPlan transformations ability to modify def-use relations and still
have ILV generate the vector code.
This commit moves GEP operand queries controlling how GEPs are widened to a
dedicated recipe and extracts GEP widening code to its own ILV method taking
those recorded decisions as arguments. This reduces ingredient def-use usage by
ILV as a step towards full VPlan-based def-use relations.

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

4 years ago[AArch64][SVE2] Implement while comparison intrinsics
Cullen Rhodes [Fri, 6 Dec 2019 11:29:08 +0000 (11:29 +0000)]
[AArch64][SVE2] Implement while comparison intrinsics

Summary:
Adds the following intrinsics:

    * whilege, whilegt, whilehi, whilehs

Reviewers: sdesmalen, rovka, dancgr, efriedma, rengolin, huntergr

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[llvm-readobj] - Implement --dependent-libraries flag.
Georgii Rymar [Mon, 25 Nov 2019 13:04:58 +0000 (16:04 +0300)]
[llvm-readobj] - Implement --dependent-libraries flag.

There is no way to dump SHT_LLVM_DEPENDENT_LIBRARIES sections
currently. This patch implements this.

The section is described here:
https://llvm.org/docs/Extensions.html#sht-llvm-dependent-libraries-section-dependent-libraries

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

4 years ago[clangd] Try to fix CompileCommandsTests on windows. NFC
Sam McCall [Fri, 6 Dec 2019 11:27:15 +0000 (12:27 +0100)]
[clangd] Try to fix CompileCommandsTests on windows. NFC

4 years ago[DebugInfo][CGP] Update dbg.values when sinking address computations
Jeremy Morse [Fri, 6 Dec 2019 11:21:27 +0000 (11:21 +0000)]
[DebugInfo][CGP] Update dbg.values when sinking address computations

One of CodeGenPrepare's optimizations is to duplicate address calculations
into basic blocks, so that as much information as possible can be folded
into memory addressing operands. This is great -- but the dbg.value
variable location intrinsics are not updated in the same way. This can lead
to dbg.values referring to address computations in other blocks that will
never be encoded into the DAG, while duplicate address computations are
performed locally that could be used by the dbg.value. Some of these (such
as non-constant-offset GEPs) can't be salvaged past.

Fix this by, whenever we duplicate an address computation into a block,
looking for dbg.value users of the original memory address in the same
block, and redirecting those to the local computation.

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

4 years ago[X86] Regenerate test to fix build bot failures
Ulrich Weigand [Fri, 6 Dec 2019 11:08:26 +0000 (12:08 +0100)]
[X86] Regenerate test to fix build bot failures

After my recent commit daee549 the following test case is failing:
CodeGen/X86/vector-constrained-fp-intrinsics.ll

Not sure why I didn't catch this earlier, seems to be affected
by other changes that came in recently.

Fixed by regerenating the test again.  Sorry for the disruption!

4 years ago[AArch64][SVE] Implement integer compare intrinsics
Cullen Rhodes [Fri, 6 Dec 2019 10:04:23 +0000 (10:04 +0000)]
[AArch64][SVE] Implement integer compare intrinsics

Summary:
Adds intrinsics for the following:

    * cmphs, cmphi
    * cmpge, cmpgt
    * cmpeq, cmpne
    * cmplt, cmple
    * cmplo, cmpls

Includes a minor change to `TLI.getMemValueType` that fixes a crash due to the
scalable flag being dropped.

Reviewers: sdesmalen, efriedma, rengolin, rovka, dancgr, huntergr

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Fix gcc warning about extra ";" [NFC]
Mikael Holmen [Fri, 6 Dec 2019 10:13:56 +0000 (11:13 +0100)]
[clangd] Fix gcc warning about extra ";" [NFC]

gcc complained with

/data/repo/master/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:326:30: warning: extra ';' [-Wpedantic]
 REGISTER_TWEAK(DefineOutline);
                              ^

4 years ago[lldb][NFC] Move [SU]Int64ValueIsValidForByteSize to RegisterValue
Raphael Isemann [Fri, 6 Dec 2019 10:04:33 +0000 (11:04 +0100)]
[lldb][NFC] Move [SU]Int64ValueIsValidForByteSize to RegisterValue

These functions are an implementation detail of RegisterValue, so
it doesn't make a lot of sense to implement them in a totally
unrelated class.

4 years ago[FPEnv][SelectionDAG] Relax chain requirements
Ulrich Weigand [Fri, 6 Dec 2019 10:02:11 +0000 (11:02 +0100)]
[FPEnv][SelectionDAG] Relax chain requirements

This patch implements the following changes:

1) SelectionDAGBuilder::visitConstrainedFPIntrinsic currently treats
each constrained intrinsic like a global barrier (e.g. a function call)
and fully serializes all pending chains. This is actually not required;
it is allowed for constrained intrinsics to be reordered w.r.t one
another or (nonvolatile) memory accesses. The MI-level scheduler already
allows for that flexibility, so it makes sense to allow it at the DAG
level as well.

This patch therefore changes the way chains for constrained intrisincs
are created, and handles them basically like load operations are handled.
This has the effect that constrained intrinsics are no longer serialized
against one another or (nonvolatile) loads. They are still serialized
against stores, but that seems hard to change with the current DAG chain
setup, and it also doesn't seem to be a big problem preventing DAG

2) The OPC_CheckFoldableChainNode check requires that each of the
intermediate nodes in a multi-node pattern match only has a single use.
This check tends to fail if those intermediate nodes are strict operations
as those have a chain output that typically indeed has another use.
However, we don't really need to consider chains here at all, since they
will all be rewritten anyway by UpdateChains later. Other parts of the
matcher therefore already ignore chains, but this hasOneUse check doesn't.

This patch replaces hasOneUse by a custom test that verifies there is no
more than one use of any non-chain output value.

In theory, this change could affect code unrelated to strict FP nodes,
but at least on SystemZ I could not find any single instance of that
happening

3) The SystemZ back-end currently does not allow matching multiply-and-
extend operations (32x32 -> 64bit or 64x64 -> 128bit FP multiply) for
strict FP operations.  This was not possible in the past due to the
problems described under 1) and 2) above.

With those issues fixed, it is now possible to fully support those
instructions in strict mode as well, and this patch does so.

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

4 years ago[lldb/DWARF] Fix DW_AT_addr_base & DW_AT_low_pc interaction
Pavel Labath [Thu, 5 Dec 2019 15:21:23 +0000 (16:21 +0100)]
[lldb/DWARF] Fix DW_AT_addr_base & DW_AT_low_pc interaction

In DWARF5 DW_AT_low_pc (and DW_AT_entry_pc, and possibly others) can use
DW_FORM_addrx to refer to the address indirectly. This means we need to
have processed the DW_AT_addr_base attribute before we can do anything
with these.

Since we were processing the unit attributes serially, this created a
problem in cases where the DW_AT_addr_base comes after DW_AT_low_pc --
we would end up computing the wrong unit base address, which also
corrupted any values which later depended on that (for instance range
lists). Clang currently always emits DW_AT_addr_base last.

The fix is simple -- process DW_AT_addr_base first, regardless of its
position in the attribute list.

4 years ago[lldb][NFC] Remove ability to pass a custom printf format to DataExtractor::PutToLog
Raphael Isemann [Fri, 6 Dec 2019 08:44:50 +0000 (09:44 +0100)]
[lldb][NFC] Remove ability to pass a custom printf format to DataExtractor::PutToLog

This is luckily not used anywhere.

4 years ago[lldb/DWARF] Fix DW_AT_rnglists_base handling for dwo files
Pavel Labath [Thu, 5 Dec 2019 14:30:18 +0000 (15:30 +0100)]
[lldb/DWARF] Fix DW_AT_rnglists_base handling for dwo files

the value of DW_AT_rnglists_base of the skeleton unit is for that unit
alone (e.g. used in DW_AT_ranges of the unit DIE) and should not apply
to the split unit.

The split unit has a hardcoded range list base value -- we should
initialize range list code whenever we detect a nonempty
debug_rnglists.dwo section.

4 years ago[lldb] Migrate VMRange::Dump to raw_ostream
Raphael Isemann [Fri, 6 Dec 2019 08:53:44 +0000 (09:53 +0100)]
[lldb] Migrate VMRange::Dump to raw_ostream

4 years ago[lldb/IRExecutionUnit] Stop searching based on demangled names
Pavel Labath [Tue, 26 Nov 2019 15:41:26 +0000 (16:41 +0100)]
[lldb/IRExecutionUnit] Stop searching based on demangled names

Summary:
This was causing problems on linux, where we'd end up calling the
deleting destructor instead of a regular one (because they have the same
demangled name), making a lot of mischief in the process.

The only place where this was necessary (according to the test suite, at
least) was to call a base structor instead of a complete one, but this
is now handled in a more targeted fashion.

TestCallOverriddenMethod is now re-enabled as it now passes reliably.

Reviewers: teemperor, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[lldb/DWARF] Remove DWARFDebugRangesBase abstract class
Pavel Labath [Fri, 6 Dec 2019 09:10:04 +0000 (10:10 +0100)]
[lldb/DWARF] Remove DWARFDebugRangesBase abstract class

now that we use llvm to parse debug_rnglists, this abstraction is not
useful.

4 years ago[clang-tidy] Fix PR26274
Alexander Kornienko [Thu, 5 Dec 2019 11:11:06 +0000 (12:11 +0100)]
[clang-tidy] Fix PR26274

Summary:
This commit fixes http://llvm.org/PR26274 in a simpler and more correct way than
4736d63f752f8d13f4c6a9afd558565c32119718 did. See
https://reviews.llvm.org/D69855#1767089 for details.

Reviewers: gribozavr, aaron.ballman, gribozavr2

Reviewed By: aaron.ballman, gribozavr2

Subscribers: gribozavr2, merge_guards_bot, xazax.hun, cfe-commits

Tags: #clang

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

4 years agogn build: Merge 99768b243cd
LLVM GN Syncbot [Fri, 6 Dec 2019 08:55:53 +0000 (08:55 +0000)]
gn build: Merge 99768b243cd

4 years ago[clangd] (take 2) Try harder to find a plausible `clang` as argv0, particularly on...
Sam McCall [Fri, 29 Nov 2019 18:37:48 +0000 (19:37 +0100)]
[clangd] (take 2) Try harder to find a plausible `clang` as argv0, particularly on Mac.

Summary:
This was originally committed in 88bccded8fa169481fa367debf5ec615640635a1,
and reverted in 93f77617abba512d2861e2fc50ce385883f587b6.

This version is now much more testable: the "detect toolchain properties" part
is still not tested but also not active in tests.
All the command manipulation based on the detected properties is
directly tested, and also not active in other tests.

Fixes https://github.com/clangd/clangd/issues/211
Fixes https://github.com/clangd/clangd/issues/178

Reviewers: kbobyrev, ilya-biryukov

Subscribers: mgorny, ormris, cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay

Tags: #clang

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

4 years ago[lldb][NFC] Migrate FileSpec::Dump to raw_ostream
Raphael Isemann [Fri, 6 Dec 2019 07:38:23 +0000 (08:38 +0100)]
[lldb][NFC] Migrate FileSpec::Dump to raw_ostream

4 years ago[lldb] NFC: less nesting in SearchFilter.cpp
Konrad Kleine [Tue, 3 Dec 2019 14:38:21 +0000 (09:38 -0500)]
[lldb] NFC: less nesting in SearchFilter.cpp

I was working on SearchFilter.cpp and felt it a bit too complex in some cases in terms of nesting and logic flow.

Reviewers: teemperor, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[compiler-rt] [test] Disable ASLR on ASAN/MSAN/TSAN tests on NetBSD
Michał Górny [Tue, 3 Dec 2019 13:44:33 +0000 (14:44 +0100)]
[compiler-rt] [test] Disable ASLR on ASAN/MSAN/TSAN tests on NetBSD

Use a new %run wrapper for ASAN/MSAN/TSAN tests that calls paxctl
in order to disable ASLR on the test executables.  This makes it
possible to test sanitizers on systems where ASLR is enabled by default.

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

4 years agogn build: Merge 9e8c799e2b0
LLVM GN Syncbot [Fri, 6 Dec 2019 07:03:37 +0000 (07:03 +0000)]
gn build: Merge 9e8c799e2b0

4 years ago[Dsymutil][NFC] Move NonRelocatableStringpool into common CodeGen folder.
Alexey Lapshin [Thu, 5 Dec 2019 10:11:32 +0000 (13:11 +0300)]
[Dsymutil][NFC] Move NonRelocatableStringpool into common CodeGen folder.

That refactoring moves NonRelocatableStringpool into common CodeGen folder.
So that NonRelocatableStringpool could be used not only inside dsymutil.

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

4 years ago[LCSSA] Don't use VH callbacks to invalidate SCEV when creating LCSSA phis
Daniil Suchkov [Thu, 21 Nov 2019 10:56:02 +0000 (17:56 +0700)]
[LCSSA] Don't use VH callbacks to invalidate SCEV when creating LCSSA phis

In general ValueHandleBase::ValueIsRAUWd shouldn't be called when not
all uses of the value were actually replaced, though, currently
formLCSSAForInstructions calls it when it inserts LCSSA-phis.

Calls of ValueHandleBase::ValueIsRAUWd were added to LCSSA specifically
to update/invalidate SCEV. In the best case these calls duplicate some
of the work already done by SE->forgetValue, though in case when SCEV of
the value is SCEVUnknown, SCEV replaces the underlying value of
SCEVUnknown with the new value (i.e. acts like LCSSA-phi actually fully
replaces the value it is created for), which leads to SCEV being
corrupted because LCSSA-phi rarely dominates all uses of its inputs.

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

Reviewers: fhahn, efriedma, reames, sanjoy.google

Reviewed By: fhahn

Subscribers: hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

4 years agoFix build of LookupResult.cpp from aeda128 with Visual C++.
Douglas Yung [Fri, 6 Dec 2019 04:15:52 +0000 (20:15 -0800)]
Fix build of LookupResult.cpp from aeda128 with Visual C++.

4 years ago[JITLink] Use Blocks rather than Symbols for SectionRange.
Lang Hames [Fri, 6 Dec 2019 04:04:53 +0000 (20:04 -0800)]
[JITLink] Use Blocks rather than Symbols for SectionRange.

This ensures that anonymous blocks are included in the section range.

4 years ago[JITLink] Remove the Section::symbols_empty() method.
Lang Hames [Fri, 6 Dec 2019 03:57:51 +0000 (19:57 -0800)]
[JITLink] Remove the Section::symbols_empty() method.

llvm::empty(Sec.symbols()) can be used instead.

4 years agoDebugInfo: Pull out a common expression.
David Blaikie [Fri, 6 Dec 2019 03:51:30 +0000 (19:51 -0800)]
DebugInfo: Pull out a common expression.

This is for the case where -gmlt -gsplit-dwarf -fsplit-dwarf-inlining
are used together in some but not all units during LTO (or, in the
reduced case, even without LTO) - ensuring that no split dwarf is used
(because split-dwarf-inlining puts the same data in the .o file, so
there's no need to duplicate it into the .dwo file)

4 years agollvm-reduce: Add a space to an option's --help
George Burgess IV [Fri, 6 Dec 2019 03:42:33 +0000 (19:42 -0800)]
llvm-reduce: Add a space to an option's --help

Otherwise, we get "filewith".

4 years ago[ConstantFold][SVE] Skip scalable vectors in ConstantFoldInsertElementInstruction.
Huihui Zhang [Thu, 5 Dec 2019 21:38:07 +0000 (13:38 -0800)]
[ConstantFold][SVE] Skip scalable vectors in ConstantFoldInsertElementInstruction.

Summary:
Should not constant fold insertelement instruction for scalable vector type.

Reviewers: huntergr, sdesmalen, spatel, levedev.ri, apazos, efriedma, willlovett

Reviewed By: efriedma, spatel

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years agoFix crash if a user-defined conversion is applied in the middle of a
Richard Smith [Fri, 6 Dec 2019 02:04:46 +0000 (18:04 -0800)]
Fix crash if a user-defined conversion is applied in the middle of a
rewrite of an operator in terms of operator<=>.

4 years agoTighten up CHECK lines added in a9f10ebffa to work on ARM.
Douglas Yung [Fri, 6 Dec 2019 02:35:08 +0000 (18:35 -0800)]
Tighten up CHECK lines added in a9f10ebffa to work on ARM.

On ARM platforms, the compiler generates an additional line containing `-CXXRecordDecl which is not the intended line, but preceeds the intended match causing the test to fail.

4 years agogn build: Add support for building scudo and its unit tests.
Peter Collingbourne [Tue, 19 Nov 2019 22:51:48 +0000 (14:51 -0800)]
gn build: Add support for building scudo and its unit tests.

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

4 years agogn build: Bump Android API level to 29, and NDK to r21.
Peter Collingbourne [Tue, 19 Nov 2019 22:40:21 +0000 (14:40 -0800)]
gn build: Bump Android API level to 29, and NDK to r21.

These are both necessary in order to use ELF TLS, which is needed
by the scudo unit tests.

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

4 years ago[X86] Make X86TargetLowering::BuildFILD return a std::pair of SDValues so we explicit...
Craig Topper [Fri, 6 Dec 2019 01:47:33 +0000 (17:47 -0800)]
[X86] Make X86TargetLowering::BuildFILD return a std::pair of SDValues so we explicitly return the chain instead of calling getValue on the single SDValue.

We shouldn't assume that the returned result can be used to get
the other result.

This is prep-work for strict FP where we will also need to pass
the chain result along in more cases.

4 years agoAdd strict fp support for instructions fadd/fsub/fmul/fdiv
Liu, Chen3 [Fri, 6 Dec 2019 01:44:33 +0000 (09:44 +0800)]
Add strict fp support for instructions fadd/fsub/fmul/fdiv

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

4 years agogn build: Merge aeda128a96c
LLVM GN Syncbot [Fri, 6 Dec 2019 00:53:40 +0000 (00:53 +0000)]
gn build: Merge aeda128a96c

4 years agogn build: Merge 6470497817e
LLVM GN Syncbot [Fri, 6 Dec 2019 00:53:39 +0000 (00:53 +0000)]
gn build: Merge 6470497817e

4 years agoAdd lookup functions for efficient lookups of addresses when using GsymReader classes.
Greg Clayton [Wed, 4 Dec 2019 00:44:02 +0000 (16:44 -0800)]
Add lookup functions for efficient lookups of addresses when using GsymReader classes.

Summary:
Lookup functions are designed to not fully decode a FunctionInfo, LineTable or InlineInfo, they decode only what is needed into a LookupResult object. This allows lookups to avoid costly memory allocations and avoid parsing large amounts of information one a suitable match is found.

LookupResult objects contain the address that was looked up, the concrete function address range, the name of the concrete function, and a list of source locations. One for each inline function, and one for the concrete function. This allows one address to turn into multiple frames and improves the signal you get when symbolicating addresses in GSYM files.

Reviewers: labath, aprantl

Subscribers: mgorny, hiraditya, llvm-commits, lldb-commits

Tags: #llvm

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

4 years agoRevert "[AST] Traverse the class type loc inside the member type loc."
Sterling Augustine [Fri, 6 Dec 2019 00:16:08 +0000 (16:16 -0800)]
Revert "[AST] Traverse the class type loc inside the member type loc."

This reverts commit 7f93cb62280a73e3e899d49c45be8bfbac634b7d.

The assertion at RecursiveASTVisitor.h:1169 fails when passed a TypeLocNode.
Not sure if the correct fix is to use getTypeLocClass or something else.

4 years ago[ThinLTO] Add option to disable readonly/writeonly attribute propagation
Teresa Johnson [Tue, 3 Dec 2019 21:56:07 +0000 (13:56 -0800)]
[ThinLTO] Add option to disable readonly/writeonly attribute propagation

Summary:
Add an option to allow the attribute propagation on the index to be
disabled, to allow a workaround for issues (such as that fixed by
D70977).

Also move the setting of the WithAttributePropagation flag on the index
into propagateAttributes(), and remove some old stale code that predated
this flag and cleared the maybe read/write only bits when we need to
disable the propagation (previously only when importing disabled, now
also when the new option disables it).

Reviewers: evgeny777, steven_wu

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years ago[RegisterCoalescer] Fix the creation of subranges when rematerialization is used
Quentin Colombet [Wed, 4 Dec 2019 23:36:35 +0000 (15:36 -0800)]
[RegisterCoalescer] Fix the creation of subranges when rematerialization is used

* Context *

During register coalescing, we use rematerialization when coalescing is not
possible. That means we may rematerialize a super register when only a smaller
register is actually used.
E.g.,
0B v1 = ldimm 0xFF
1B v2 = COPY v1.low8bits
2B   = v2
=>
0B v1 = ldimm 0xFF
1B v2 = ldimm 0xFF
2B   = v2.low8bits

Where xB are the slot indexes.
Here v2 grew from a 8-bit register to a 16-bit register.

When that happens and subregister liveness is enabled, we create subranges for
the newly created value.
E.g., before remat, the live range of v2 looked like:
main range: [1r, 2r)
(Reads v2 is defined at index 1 slot register and used before the slot register
of index 2)

After remat, it should look like:
main range: [1r, 2r)
low 8 bits: [1r, 2r)
high 8 bits: [1r, 1d) <-- dead def

I.e., the unsused lanes of v2 should be marked as dead definition.

* The Problem *

Prior to this patch, the live-ranges from the previous exampel, would have the
full live-range for all subranges:
main range: [1r, 2r)
low 8 bits: [1r, 2r)
high 8 bits: [1r, 2r) <-- too long

* The Fix *

Technically, the code that this patch changes is not wrong:
When we create the subranges for the newly rematerialized value, we create only
one subrange for the whole bit mask.
In other words, at this point v2 live-range looks like this:
main range: [1r, 2r)
low & high: [1r, 2r)

Then, it gets wrong when we call LiveInterval::refineSubRanges on low 8 bits:
main range: [1r, 2r)
low 8 bits: [1r, 2r)
high 8 bits: [1r, 2r) <-- too long

Ideally, we would like LiveInterval::refineSubRanges to be able to do the right
thing and mark the dead lanes as such. However, this is not possible, because by
the time we update / refine the live ranges, the IR hasn't been updated yet,
therefore we actually don't have enough information to do the right thing.

Another option to fix the problem would have been to call
LiveIntervals::shrinkToUses after the IR is updated. This is not desirable as
this may have a noticeable impact on compile time.

Instead, what this patch does is when we create the subranges for the
rematerialized value, we explicitly create one subrange for the lanes that were
used before rematerialization and one for the lanes that were not used. The used
one inherits the live range of the main range and the unused one is just created
empty. The existing rematerialization code then detects that the unused one are
not live and it correctly sets dead def intervals for them.

https://llvm.org/PR41372

4 years agoHandle two corner cases in creduce-clang-crash.py
Reid Kleckner [Fri, 6 Dec 2019 00:01:58 +0000 (16:01 -0800)]
Handle two corner cases in creduce-clang-crash.py

Summary:
First, call os.path.normpath on the filename argument. I passed in
./foo-asdf.cpp, and this meant that the script failed to find the
filename, and bad things happened.

Second, call os.path.abspath on binaries. CReduce runs the
interestingness test in a temp dir, so relative paths will not work.

Reviewers: akhuang

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[AutoFDO] Top-down Inlining for specialization with context-sensitive profile
Wenlei He [Mon, 25 Nov 2019 07:54:07 +0000 (23:54 -0800)]
[AutoFDO] Top-down Inlining for specialization with context-sensitive profile

Summary:
AutoFDO's sample profile loader processes function in arbitrary source code order, so if I change the order of two functions in source code, the inline decision can change. This also prevented the use of context-sensitive profile to do specialization while inlining. This commit enforces SCC top-down order for sample profile loader. With this change, we can now do specialization, as illustrated by the added test case:

Say if we have A->B->C and D->B->C call path, we want to inline C into B when root inliner is B, but not when root inliner is A or D, this is not possible without enforcing top-down order. E.g. Once C is inlined into B, A and D can only choose to inline (B->C) as a whole or nothing, but what we want is only inline B into A and D, not its recursive callee C. If we process functions in top-down order, this is no longer a problem, which is what this commit is doing.

This change is guarded with a new switch "-sample-profile-top-down-load" for tuning, and it depends on D70653. Eventually, top-down can be the default order for sample profile loader.

Reviewers: wmi, davidxl

Subscribers: hiraditya, llvm-commits, tejohnson

Tags: #llvm

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

4 years ago[AutoFDO] Properly merge context-sensitive profile of inlinee back to outlined function
Wenlei He [Mon, 25 Nov 2019 07:31:02 +0000 (23:31 -0800)]
[AutoFDO] Properly merge context-sensitive profile of inlinee back to outlined function

Summary:
When sample profile loader decides not to inline a previously inlined call-site, we adjust the profile of outlined function simply by scaling up its profile counts by call-site count. This means the context-sensitive profile of that inlined instance will be thrown away. This commit try to keep context-sensitive profile for such cases:

 - Instead of scaling outlined function's profile, we now properly merge the FunctionSamples of inlined instance into outlined function, including all recursively inlined profile.
 - Instead of adjusting the profile for negative inline decision at the end of the sample profile loader pass, we do the profile merge right after processing each function. This change paired with top-down ordering of annotation/inline-replay (a separate diff) will make sure we recursively merge profile back before the profile is used for annotation and inline replay.

A new switch -sample-profile-merge-inlinee is added to enable the new profile merge for tuning. It should be the default behavior eventually.

Reviewers: wmi, davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agogn build: Merge fdf80e86a52
LLVM GN Syncbot [Thu, 5 Dec 2019 23:54:18 +0000 (23:54 +0000)]
gn build: Merge fdf80e86a52

4 years ago[Concepts] Fix build failures in D41569
Saar Raz [Thu, 5 Dec 2019 23:53:18 +0000 (01:53 +0200)]
[Concepts] Fix build failures in D41569

Fix build failures in previous commit.

4 years ago[lldb] Update hardcoded Makefile.rules inclusions.
Jordan Rupprecht [Thu, 5 Dec 2019 23:48:34 +0000 (15:48 -0800)]
[lldb] Update hardcoded Makefile.rules inclusions.

This replaces `include $(LEVEL)/Makefile.rules` with `include Makefile.rules`.
The lldb test driver already passes the include path when running make, and specifically looking for "../../Makefile.rules" forces the test to be in a specific location.
Removing this hardcoded relative path will make it possible to move this test as-is.

4 years ago[Concepts] Constraint Enforcement & Diagnostics
Saar Raz [Thu, 5 Dec 2019 23:30:21 +0000 (01:30 +0200)]
[Concepts] Constraint Enforcement & Diagnostics

Part of the C++20 concepts implementation effort.
- Associated constraints (requires clauses, currently) are now enforced when instantiating/specializing templates and when considering partial specializations and function overloads.
- Elaborated diagnostics give helpful insight as to why the constraints were not satisfied.
Phabricator: D41569

Re-commit, after fixing some memory bugs.

4 years ago[IR] Move ctor in the NDEBUG branch
Fangrui Song [Thu, 5 Dec 2019 23:22:53 +0000 (15:22 -0800)]
[IR] Move ctor in the NDEBUG branch

4 years ago[IR] Add a default copy constructor for -Wdeprecated-copy
Fangrui Song [Thu, 5 Dec 2019 23:00:30 +0000 (15:00 -0800)]
[IR] Add a default copy constructor for -Wdeprecated-copy

4 years agoProperly convert all declaration non-type template arguments when
Richard Smith [Thu, 5 Dec 2019 21:39:38 +0000 (13:39 -0800)]
Properly convert all declaration non-type template arguments when
forming non-type template parameter values.

This reverts commit 93cc9dddd82f9e971f382ade6acf6634c5914966,
which reverted commit 11d10527852b4d3ed738aa90d8bec0f398160593.

We now always form `&x` when forming a pointer to a function rather than
trying to use function-to-pointer decay. This matches the behavior of
the old code in this case, but not the intent as described by the
comments.

4 years agoAdd a default copy constructor for -Wdeprecated-copy warnings.
Eric Christopher [Thu, 5 Dec 2019 22:16:04 +0000 (14:16 -0800)]
Add a default copy constructor for -Wdeprecated-copy warnings.

4 years ago[libomptarget][nfc] Introduce SHARED, ALIGN macros
Jon Chesterfield [Thu, 5 Dec 2019 21:47:43 +0000 (21:47 +0000)]
[libomptarget][nfc] Introduce SHARED, ALIGN macros

Summary:
[libomptarget][nfc] Introduce SHARED, ALIGN macros
Move remaining cuda attributes behind such macros

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: ABataev

Subscribers: openmp-commits, jvesely

Tags: #openmp

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

4 years agoDebug Info: Apply a default location for cleanups if none is available.
Adrian Prantl [Thu, 5 Dec 2019 21:19:37 +0000 (13:19 -0800)]
Debug Info: Apply a default location for cleanups if none is available.

This unbreaks the debuginfo-tests testsuite by replacing the assertion
with a default location. There are cleanups in helper functions that
don't have a valid source location such as block copy helpers and it's
not worth tracking each of them down.

rdar://57630879

4 years agoDebugInfo: Fix LTO+DWARFv5 loclists
David Blaikie [Thu, 5 Dec 2019 20:45:13 +0000 (12:45 -0800)]
DebugInfo: Fix LTO+DWARFv5 loclists

The loclists_table_base was being overwritten for each CU even though
only one loclists contribution is made so everything but the last CU
would have a label that was never defined and fail to assemble.