platform/upstream/llvm.git
4 years ago[clangd] Fix printing for Inclusion
Kadir Cetinkaya [Tue, 7 Apr 2020 11:47:51 +0000 (13:47 +0200)]
[clangd] Fix printing for Inclusion

4 years ago[clangd] Get rid of ASTWorker::getCurrentFileInputs
Kadir Cetinkaya [Thu, 2 Apr 2020 14:35:15 +0000 (16:35 +0200)]
[clangd] Get rid of ASTWorker::getCurrentFileInputs

Summary:
FileInputs are only written by ASTWorker thread, therefore it is safe
to read them without the lock inside that thread. It can still be read by other
threads through ASTWorker::getCurrentCompileCommand though.

This patch also gets rid of the smart pointer wrapping FileInputs as there is
never mutliple owners.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[llvm-readobj] - Introduce warnings for cases when unable to read strings from string...
Georgii Rymar [Thu, 2 Apr 2020 11:40:07 +0000 (14:40 +0300)]
[llvm-readobj] - Introduce warnings for cases when unable to read strings from string tables.

Currently we have no dedicated warnings, but we return error message instead of a result.
It is generally not consistent with another warnings we have.

This change was suggested and discussed here:
https://reviews.llvm.org/D77216#1954873

This change refines error messages we report and also I had to update the API
to implement it.

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

4 years ago[InstCombine] add icmp+cast tests for ppc_fp128; NFC
Sanjay Patel [Tue, 7 Apr 2020 11:32:52 +0000 (07:32 -0400)]
[InstCombine] add icmp+cast tests for ppc_fp128; NFC

See post-commit comments for rG0f56bbc.

4 years agoAdd map-type check for target and target data directive, by Chi Chun
cchen [Tue, 7 Apr 2020 09:18:44 +0000 (05:18 -0400)]
Add map-type check for target and target data directive, by Chi Chun
Chen

Reviewers: ABataev, jdoerfert

Reviewed By: ABataev

Subscribers: cfe-commits, dreachem, sandoval

Tags: #clang

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

4 years agoFixed licenses in dynamic ast matchers
Nathan James [Tue, 7 Apr 2020 11:08:06 +0000 (12:08 +0100)]
Fixed licenses in dynamic ast matchers

4 years ago[clangd] DefineOutline: removes static token from static CXXMethodDecl
Nathan James [Tue, 7 Apr 2020 10:57:12 +0000 (11:57 +0100)]
[clangd] DefineOutline: removes static token from static CXXMethodDecl

Summary: Removes the `static` token when defining a function out of line if the function is a `CXXMethodDecl`

Reviewers: sammccall, kadircet, hokein

Reviewed By: kadircet

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

Tags: #clang, #clang-tools-extra

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

4 years ago[ARM] unwinding .pad instructions missing in execute-only prologue
Keith Walker [Thu, 26 Mar 2020 09:40:28 +0000 (09:40 +0000)]
[ARM] unwinding .pad instructions missing in execute-only prologue

If the stack pointer is altered for local variables and we are generating
Thumb2 execute-only code the .pad directive is missing.

Usually the size of the adjustment is stored in a PC-relative location
and loaded into a register which is then added to the stack pointer.
However when we are generating execute-only code code the size of the
adjustment is instead generated using the MOVW/MOVT instruction pair.

As a by product of handling the execute-only case this also fixes an
existing issue that in the none execute-only case the .pad directive was
generated against the load of the constant to a register instruction,
instead of the instruction which adds the register to the stack pointer.

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

4 years ago[X86] Fix implicit sign conversion warnings in X86 headers.
Pierre Gousseau [Fri, 3 Apr 2020 13:43:38 +0000 (14:43 +0100)]
[X86] Fix implicit sign conversion warnings in X86 headers.

Warnings in emmintrin.h and xmmintrin.h are reported by
-fsanitize=implicit-integer-sign-change.

Reviewed By: RKSimon, craig.topper

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

4 years ago[MLIR] Introduce std.alloca op
Uday Bondhugula [Sun, 22 Mar 2020 15:50:21 +0000 (21:20 +0530)]
[MLIR] Introduce std.alloca op

Introduce the alloca op for stack memory allocation. When converting to the
LLVM dialect, this is lowered to an llvm.alloca. Refactor the std to
llvm conversion for alloc op to reuse with alloca. Drop useAlloca option
with alloc op lowering.

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

4 years ago[SCCP] Use ranges for predicate info conditions.
Florian Hahn [Tue, 7 Apr 2020 09:03:46 +0000 (10:03 +0100)]
[SCCP] Use ranges for predicate info conditions.

This patch updates the code that deals with conditions from predicate
info to make use of constant ranges.

For ssa_copy instructions inserted by PredicateInfo, we have 2 ranges:
1. The range of the original value.
2. The range imposed by the linked condition.

1. is known, 2. can be determined using makeAllowedICmpRegion. The
intersection of those ranges is the range for the copy.

With this patch, we get a nice increase in the number of instructions
eliminated by both SCCP and IPSCCP for some benchmarks:

For MultiSource, SPEC2000 & SPEC2006:

Tests: 237
Same hash: 170 (filtered out)
Remaining: 67
Metric: sccp.NumInstRemoved
Program                                        base    patch   diff
 test-suite...Source/Benchmarks/sim/sim.test    10.00   71.00  610.0%
 test-suite...CFP2000/177.mesa/177.mesa.test   361.00  1626.00 350.4%
 test-suite...encode/alacconvert-encode.test   141.00  602.00  327.0%
 test-suite...decode/alacconvert-decode.test   141.00  602.00  327.0%
 test-suite...CI_Purple/SMG2000/smg2000.test   1639.00 4093.00 149.7%
 test-suite...peg2/mpeg2dec/mpeg2decode.test    75.00  163.00  117.3%
 test-suite...T2006/401.bzip2/401.bzip2.test   358.00  513.00  43.3%
 test-suite...rks/FreeBench/pifft/pifft.test    11.00   15.00  36.4%
 test-suite...langs-C/unix-tbl/unix-tbl.test     4.00    5.00  25.0%
 test-suite...lications/sqlite3/sqlite3.test   541.00  667.00  23.3%
 test-suite.../CINT2000/254.gap/254.gap.test   243.00  299.00  23.0%
 test-suite...ks/Prolangs-C/agrep/agrep.test    25.00   29.00  16.0%
 test-suite...marks/7zip/7zip-benchmark.test   1135.00 1304.00 14.9%
 test-suite...lications/ClamAV/clamscan.test   1105.00 1268.00 14.8%
 test-suite...urce/Applications/lua/lua.test   398.00  436.00   9.5%

Metric: sccp.IPNumInstRemoved
Program                                        base   patch   diff
 test-suite...C/CFP2000/179.art/179.art.test     1.00   3.00  200.0%
 test-suite...006/447.dealII/447.dealII.test   429.00 1056.00 146.2%
 test-suite...nch/fourinarow/fourinarow.test     3.00   7.00  133.3%
 test-suite...CI_Purple/SMG2000/smg2000.test   818.00 1748.00 113.7%
 test-suite...ks/McCat/04-bisect/bisect.test     3.00   5.00  66.7%
 test-suite...CFP2000/177.mesa/177.mesa.test   165.00 255.00  54.5%
 test-suite...ediabench/gsm/toast/toast.test    18.00  27.00  50.0%
 test-suite...telecomm-gsm/telecomm-gsm.test    18.00  27.00  50.0%
 test-suite...ks/Prolangs-C/agrep/agrep.test    24.00  35.00  45.8%
 test-suite...TimberWolfMC/timberwolfmc.test    43.00  62.00  44.2%
 test-suite...encode/alacconvert-encode.test    46.00  66.00  43.5%
 test-suite...decode/alacconvert-decode.test    46.00  66.00  43.5%
 test-suite...langs-C/unix-tbl/unix-tbl.test    12.00  17.00  41.7%
 test-suite...peg2/mpeg2dec/mpeg2decode.test    31.00  41.00  32.3%
 test-suite.../CINT2000/254.gap/254.gap.test   117.00 154.00  31.6%

Reviewers: efriedma, davide

Reviewed By: efriedma

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

4 years ago[docs] Add the release notes about Debug Entry Values
Djordje Todorovic [Tue, 7 Apr 2020 10:05:22 +0000 (12:05 +0200)]
[docs] Add the release notes about Debug Entry Values

Note that x86, arm and aarch64 targets support the Debug Entry Values
feature by default.

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

4 years ago[DAG] Consolidate require spill slot logic in lambda. NFC.
Serguei Katkov [Tue, 7 Apr 2020 04:04:19 +0000 (11:04 +0700)]
[DAG] Consolidate require spill slot logic in lambda. NFC.

Move the logic whether lowering of deopt value requires a spill slot in
a separate lambda.

Reviewers: reames, dantrushin
Reviewed By: dantrushin
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D77629

4 years ago[ARM] Remove condition that could never be true
Peter Smith [Wed, 1 Apr 2020 07:43:07 +0000 (08:43 +0100)]
[ARM] Remove condition that could never be true

From Arm v8 Architecture Reference Manual F5.1.84 LDREXD
The ldrexd instruction in Arm state has the following conditions:

t = UInt(Rt); t2 = t + 1; n = UInt(Rn);
if Rt<0> == '1' || t2 == 15 || n == 15 then UNPREDICTABLE;

In when Rt is odd or if Rt is 14 (making t2 15).

In the implementation when the pair is the UNPREDICTABLE R14_R15 we
would ideally return SOFT_FAIL. We can't because there is no R14_R15
value for us to return so we fail early returning FAIL.

The early return for registers outside the bounds of the table means
the check for Rt == 14 (0xE) redundant which causes a static analyzer
to flag the condition as never being true.

To fix the warning I've removed the check and replaced with a comment
explaining the difference with the specification.

Fixes pr41660

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

4 years ago[MLIR] fix/update affine data copy utility for max/min bounds
Uday Bondhugula [Wed, 1 Apr 2020 06:30:26 +0000 (12:00 +0530)]
[MLIR] fix/update affine data copy utility for max/min bounds

Fix point-wise copy generation to work with bounds that have max/min.
Change structure of copy loop nest to use absolute loop indices and
subtracting base from the indexes of the fast buffers. Update supporting
utilities: Fix FlatAffineConstraints::getLowerAndUpperBound to look at
equalities as well and for a missing division. Update unionBoundingBox
to not discard common constraints (leads to a tighter system). Update
MemRefRegion::getConstantBoundingSizeAndShape to add memref dimension
constraints. Run removeTrivialRedundancy at the end of
MemRefRegion::compute.  Run single iteration loop promotion and
load/store canonicalization after affine data copy (in its test pass as
well).

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

4 years ago[Support,Windows] Tolerate failure of CryptGenRandom
Simon Tatham [Tue, 7 Apr 2020 08:18:09 +0000 (09:18 +0100)]
[Support,Windows] Tolerate failure of CryptGenRandom

Summary:
In `Unix/Process.inc`, we seed a random number generator from
`/dev/urandom` if possible, but if not, we're happy to fall back to
ordinary pseudorandom strategies, like the current time and PID.

The corresponding function on Windows calls `CryptGenRandom`, but it
//doesn't// have a fallback if that strategy fails. But `CryptGenRandom`
//can// fail, if a cryptography provider isn't properly initialized, or
occasionally (by our observation) simply intermittently.

If it's reasonable on Unix to implement traditional pseudorandom-number
seeding as a fallback, then it's surely reasonable to do the same on
Windows. So this patch adds a last-ditch use of ordinary rand(), using
much the same strategy as the Unix fallback code.

Reviewers: hans, sammccall

Reviewed By: hans

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoRevert "[CodeGen][SelectionDAG] Flip Booleans More Often"
Pierre-vh [Tue, 7 Apr 2020 08:09:10 +0000 (09:09 +0100)]
Revert "[CodeGen][SelectionDAG] Flip Booleans More Often"

This reverts commit 23342bdcc888835e744f38a2fcd0a5c651e33a31.

4 years agoDrop the number of thinlto jobs in some tests to avoid crashing on 32-bit windows
Hans Wennborg [Tue, 7 Apr 2020 07:52:12 +0000 (09:52 +0200)]
Drop the number of thinlto jobs in some tests to avoid crashing on 32-bit windows

4 years ago[CodeGen][SelectionDAG] Flip Booleans More Often
Pierre-vh [Tue, 31 Mar 2020 13:29:36 +0000 (14:29 +0100)]
[CodeGen][SelectionDAG] Flip Booleans More Often

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

4 years agoFix unused variable warning in Protocol.cpp, NFCI
Karl-Johan Karlsson [Tue, 7 Apr 2020 06:16:35 +0000 (08:16 +0200)]
Fix unused variable warning in Protocol.cpp, NFCI

Fixed gcc warning:
clang-tools-extra/clangd/Protocol.cpp:300:16: warning: unused variable 'SemanticHighlighting' [-Wunused-variable]

4 years ago[DWARF5]: Added a left over test case from D73462
Awanish Pandey [Tue, 7 Apr 2020 04:55:27 +0000 (10:25 +0530)]
[DWARF5]: Added a left over test case from D73462

Unfortunately this test case never made it to the trunk. This
was part of https://reviews.llvm.org/D73462 revision.

4 years ago[WebAssembly] EmscriptenEHSjLj: Mark more functions as imported
Sam Clegg [Fri, 3 Apr 2020 02:44:00 +0000 (19:44 -0700)]
[WebAssembly] EmscriptenEHSjLj: Mark more functions as imported

These should have been part of https://reviews.llvm.org/D77192

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

4 years ago[lit] Improve handling of parallelism group semaphores
Julian Lettner [Tue, 7 Apr 2020 03:03:36 +0000 (20:03 -0700)]
[lit] Improve handling of parallelism group semaphores

4 years ago[lldb/test] Fix TestDSYMSourcePathRemapping in the presence of symlnks
Fred Riss [Mon, 6 Apr 2020 15:40:17 +0000 (08:40 -0700)]
[lldb/test] Fix TestDSYMSourcePathRemapping in the presence of symlnks

My main work directory is on a separate partition, but I usually access
it through a symlink in my home directory. When running the tests,
either Clang or make resolves the symlink, and the real path of the
test directory ends up in the debug information.

This confuses this test as LLDB is trying to remap the real path, but
the remapping description uses the path with the symlink in
it. Calling realpath on the source path when constructing the
remapping description fixes it.

4 years agoFix template instantiation of a non-dependent call to an inherited
Richard Smith [Tue, 7 Apr 2020 02:17:55 +0000 (19:17 -0700)]
Fix template instantiation of a non-dependent call to an inherited
constructor with default arguments.

We used to try to rebuild the call as a call to the faked-up inherited
constructor, which is only a placeholder and lacks (for example) default
arguments. Instead, build the call by reference to the original
constructor.

In passing, add a note to say where a call that recursively uses a
default argument from within itself occurs. This is usually pretty
obvious, but still at least somewhat useful, and would have saved
significant debugging time for this particular bug.

4 years ago[PowerPC] Pre-commit test case of float rounding in kernel build. NFC.
Kai Luo [Tue, 7 Apr 2020 02:07:58 +0000 (02:07 +0000)]
[PowerPC] Pre-commit test case of float rounding in kernel build. NFC.

4 years agoEnable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow Enforcement Technology)
Xiang1 Zhang [Tue, 7 Apr 2020 00:59:13 +0000 (08:59 +0800)]
Enable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow Enforcement Technology)

Do not commit the llvm/test/ExecutionEngine/MCJIT/cet-code-model-lager.ll because it will
cause build bot fail(not suitable for window 32 target).

Summary:
This patch comes from H.J.'s https://github.com/hjl-tools/llvm-project/commit/2bd54ce7fa9e94fcd1118b948e14d1b6fc54dfd2

**This patch fix the failed llvm unit tests which running on CET machine. **(e.g. ExecutionEngine/MCJIT/MCJITTests)

The reason we enable IBT at "JIT compiled with CET" is mainly that:  the JIT don't know the its caller program is CET enable or not.
If JIT's caller program is non-CET, it is no problem JIT generate CET code or not.
But if JIT's caller program is CET enabled,  JIT must generate CET code or it will cause Control protection exceptions.

I have test the patch at llvm-unit-test and llvm-test-suite at CET machine. It passed.
and H.J. also test it at building and running VNCserver(Virtual Network Console), it works too.
(if not apply this patch, VNCserver will crash at CET machine.)

Reviewers: hjl.tools, craig.topper, LuoYuanke, annita.zhang, pengfei

Reviewed By: LuoYuanke

Subscribers: tstellar, efriedma, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Coroutines] Remove alignment check in shouldBeMustTail
Jun Ma [Fri, 3 Apr 2020 03:45:10 +0000 (11:45 +0800)]
[Coroutines] Remove alignment check in shouldBeMustTail

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

4 years ago[NFC] Modernize misc. uses of Align/MaybeAlign APIs.
Eli Friedman [Tue, 7 Apr 2020 00:29:25 +0000 (17:29 -0700)]
[NFC] Modernize misc. uses of Align/MaybeAlign APIs.

Use the current getAlign() APIs where it makes sense, and use Align
instead of MaybeAlign when we know the value is non-zero.

4 years agoReland "Make llvm_source_root in llvm-lit relative too."
Nico Weber [Tue, 7 Apr 2020 00:38:26 +0000 (20:38 -0400)]
Reland "Make llvm_source_root in llvm-lit relative too."

This reverts commit 3185881d69022e03b300e189838b0599ed417be5
and adds a missing "include(AddLLVM)" (similar lines already
exist elsewhere in compiler-rt).

4 years agoTarget: correct the return value for `GetImageAddrFromToken`
Saleem Abdulrasool [Tue, 7 Apr 2020 00:33:38 +0000 (17:33 -0700)]
Target: correct the return value for `GetImageAddrFromToken`

We would return `LLDB_INVALID_IMAGE_TOKEN` for the address rather than
the correct value of `LLDB_IMAGE_ADDRESS`.  This would result in the
check for the return value to silently pass on x64 as the invalid
address and invalid token are of different sizes (`size_t` vs
`uintprr_t`).  This corrects the return value to `LLDB_INVALID_ADDRESS`
and addresses the rest to reset the mapped address to the invalid value.

This was found by inspection when trying to implement module support for
Windows.

4 years agoAdd missing include
Adrian Prantl [Tue, 7 Apr 2020 00:28:53 +0000 (17:28 -0700)]
Add missing include

4 years agoRemove SequentialType from the type heirarchy.
Eli Friedman [Tue, 7 Apr 2020 00:03:49 +0000 (17:03 -0700)]
Remove SequentialType from the type heirarchy.

Now that we have scalable vectors, there's a distinction that isn't
getting captured in the original SequentialType: some vectors don't have
a known element count, so counting the number of elements doesn't make
sense.

In some cases, there's a better way to express the commonality using
other methods. If we're dealing with GEPs, there's GEP methods; if we're
dealing with a ConstantDataSequential, we can query its element type
directly.

In the relatively few remaining cases, I just decided to write out
the type checks. We're talking about relatively few places, and I think
the abstraction doesn't really carry its weight. (See thread "[RFC]
Refactor class hierarchy of VectorType in the IR" on llvmdev.)

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

4 years agoFor PR45333: Move AnalyzeImplicitConversions to using data recursion
Richard Smith [Mon, 6 Apr 2020 23:47:37 +0000 (16:47 -0700)]
For PR45333: Move AnalyzeImplicitConversions to using data recursion
instead of recursing on the stack.

This doesn't actually resolve PR45333, because we now hit stack overflow
somewhere else, but it does get us further. I've not found any way of
testing this that doesn't still crash elsewhere.

4 years ago[MachineCSE] Don't carry the wrong location when hoisting
Davide Italiano [Mon, 6 Apr 2020 23:35:30 +0000 (16:35 -0700)]
[MachineCSE] Don't carry the wrong location when hoisting

PR: 45425
<rdar://problem/61359768>

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

4 years ago[AMDGPU] Remove clutter from endcf test. NFC.
Stanislav Mekhanoshin [Mon, 6 Apr 2020 23:20:39 +0000 (16:20 -0700)]
[AMDGPU] Remove clutter from endcf test. NFC.

4 years agoAdd way to omit debug-location from MIR output
Daniel Sanders [Mon, 6 Apr 2020 17:57:21 +0000 (10:57 -0700)]
Add way to omit debug-location from MIR output

Summary:
In lieu of a proper pass that strips debug info, add a way
to omit debug-locations from the MIR output so that
instructions with MMO's continue to match CHECK's when
mir-debugify is used

Reviewers: aprantl, bogner, vsk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[CallSite Removal] a CallBase is never an IndirectCall for isInlineAsm
Nick Desaulniers [Mon, 6 Apr 2020 23:14:40 +0000 (16:14 -0700)]
[CallSite Removal] a CallBase is never an IndirectCall for isInlineAsm

Summary:
Thanks to Bill Wendling (void) for the report and steps to reproduce.  It looks
like this was missed during r350508's cleanup of the CallSite split into
CallBase, CallInst, and CallBrInst.

This was exposed by running pgo on a callbr, which was creating a ptrtoint to
the inline asm thinking it was an indirect call. The relevant callchain looks
like:

    IndirectCallPromotionPlugin::run()
    -> PGOIndirectCallVisitor::findIndirectCalls()
      -> PGOIndirectCallVisitor::visitCallBase()
        -> CallBase::isIndirectCall()

Reviewers: void, chandlerc

Reviewed By: void

Subscribers: hiraditya, llvm-commits, craig.topper, srhines

Tags: #llvm

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

4 years ago[lldb/API] Add missing LLDB_REGISTER_METHOD macros
Jonas Devlieghere [Mon, 6 Apr 2020 23:09:09 +0000 (16:09 -0700)]
[lldb/API] Add missing LLDB_REGISTER_METHOD macros

Add LLDB_REGISTER_METHOD macros for GetRetriesWithFixIts and
SetRetriesWithFixIts.

4 years agoRemove case in rewritergen unmatched opdefgen side
Jacques Pienaar [Mon, 6 Apr 2020 22:55:25 +0000 (15:55 -0700)]
Remove case in rewritergen unmatched opdefgen side

The rewriter generates a call to build that is not handled by opdef generator
and so will fail to compile. Also if this is a root node being replaced
(depth 0) then using the more generic build method in the rewrite suffices.

4 years ago[AddressSanitizer] Fix for wrong argument values appearing in backtraces
Vedant Kumar [Tue, 31 Mar 2020 22:27:06 +0000 (15:27 -0700)]
[AddressSanitizer] Fix for wrong argument values appearing in backtraces

Summary:
In some cases, ASan may insert instrumentation before function arguments
have been stored into their allocas. This causes two issues:

1) The argument value must be spilled until it can be stored into the
   reserved alloca, wasting a stack slot.

2) Until the store occurs in a later basic block, the debug location
   will point to the wrong frame offset, and backtraces will show an
   uninitialized value.

The proposed solution is to move instructions which initialize allocas
for arguments up into the entry block, before the position where ASan
starts inserting its instrumentation.

For the motivating test case, before the patch we see:

```
 | 0033: movq %rdi, 0x68(%rbx)  |   | DW_TAG_formal_parameter     |
 | ...                          |   |   DW_AT_name ("a")          |
 | 00d1: movq 0x68(%rbx), %rsi  |   |   DW_AT_location (RBX+0x90) |
 | 00d5: movq %rsi, 0x90(%rbx)  |   |       ^ not correct ...     |
```

and after the patch we see:

```
 | 002f: movq %rdi, 0x70(%rbx)  |   | DW_TAG_formal_parameter     |
 |                              |   |   DW_AT_name ("a")          |
 |                              |   |   DW_AT_location (RBX+0x70) |
```

rdar://61122691

Reviewers: aprantl, eugenis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agofix comment typo to cycle bots
Nico Weber [Mon, 6 Apr 2020 22:58:16 +0000 (18:58 -0400)]
fix comment typo to cycle bots

4 years agoRemap the target (Xcode) SDK directory to the host SDK directory.
Adrian Prantl [Fri, 20 Mar 2020 01:51:36 +0000 (18:51 -0700)]
Remap the target (Xcode) SDK directory to the host SDK directory.

This is mostly useful for Swift support; it allows LLDB to substitute
a matching SDK it shipped with instead of the sysroot path that was
used at compile time.

The goal of this is to make the Xcode SDK something that behaves more
like the compiler's resource directory, as in that it ships with LLDB
rather than with the debugged program. This important primarily for
importing Swift and Clang modules in the expression evaluator, and
getting at the APINotes from the SDK in Swift.

For a cross-debugging scenario, this means you have to have an SDK for
your target installed alongside LLDB. In Xcode this will always be the
case.

rdar://problem/60640017

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

4 years ago[libc++] 2/N: Enable the new libc++ testing format by default
Louis Dionne [Mon, 6 Apr 2020 22:30:19 +0000 (18:30 -0400)]
[libc++] 2/N: Enable the new libc++ testing format by default

Both test formats are equivalent, so this *should* not be a problem.
We've fixed a couple of failures uncovered by the first time we tried
making the switch, so this new attempt should go even farther.

If failures are noticed, it should be fine to revert this commit, but
please give a heads up afterwards so we know to address the issues!

Also note that it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit for the time being.

4 years agoSupport bfdname "elf32-hexagon".
Sid Manning [Mon, 6 Apr 2020 17:40:19 +0000 (12:40 -0500)]
Support bfdname "elf32-hexagon".

Add support and update testcases.

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

4 years agoAllow MachineFunction to obtain non-const Function (to enable MIR-level debugify)
Daniel Sanders [Fri, 3 Apr 2020 22:55:15 +0000 (15:55 -0700)]
Allow MachineFunction to obtain non-const Function (to enable MIR-level debugify)

Summary:
To debugify MIR, we need to be able to create metadata and to do that, we
need a non-const Module. However, MachineFunction only had a const reference
to the Function preventing this.

Reviewers: aprantl, bogner

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libc++] Only support std::to_chars availability test when back-deploying
Louis Dionne [Mon, 6 Apr 2020 22:09:34 +0000 (18:09 -0400)]
[libc++] Only support std::to_chars availability test when back-deploying

4 years ago[libc++] Add availability markup for the C++20 Synchronization Library on Apple
Louis Dionne [Mon, 24 Feb 2020 15:09:29 +0000 (10:09 -0500)]
[libc++] Add availability markup for the C++20 Synchronization Library on Apple

4 years agoAdd option to limit Debugify to locations (omitting variables)
Daniel Sanders [Fri, 3 Apr 2020 22:50:11 +0000 (15:50 -0700)]
Add option to limit Debugify to locations (omitting variables)

Summary:
It can be helpful to test behaviour w.r.t locations without having DEBUG_VALUE
around. In particular, because DEBUG_VALUE has the potential to change CodeGen
behaviour (e.g. hasOneUse() vs hasOneNonDbgUse()) while locations generally
don't.

Reviewers: aprantl, bogner

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[gdb-remote] Moving prevents copy elision. Found by clang.
Davide Italiano [Mon, 6 Apr 2020 21:59:01 +0000 (14:59 -0700)]
[gdb-remote] Moving prevents copy elision. Found by clang.

4 years agoRevert "Make llvm_source_root in llvm-lit relative too."
Hubert Tong [Mon, 6 Apr 2020 21:29:10 +0000 (17:29 -0400)]
Revert "Make llvm_source_root in llvm-lit relative too."

This reverts commit 6c1a9fb174ac3cf66bfdbab5a327957a0a35ad85.

Commit causes failures:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/49206

4 years ago[lldb/Test] Enable TestGdbRemoteThreadsInfoMemory.py on Windows.
Jonas Devlieghere [Mon, 6 Apr 2020 21:28:27 +0000 (14:28 -0700)]
[lldb/Test] Enable TestGdbRemoteThreadsInfoMemory.py on Windows.

This test is currently XFAILed but is passing on the Windows bot.

4 years agoX86ISelLowering: Minor refactor to avoid redundant initialization while ensuring...
David Blaikie [Mon, 6 Apr 2020 21:24:31 +0000 (14:24 -0700)]
X86ISelLowering: Minor refactor to avoid redundant initialization while ensuring compiler warnings can hopefully still prove initialization

Based on post-commit review/discussion in fabe52a7412b

4 years ago[clang-format] Don't break multi block parameters on ObjCBreakBeforeNestedBlockParam
Kanglei Fang [Mon, 6 Apr 2020 19:45:38 +0000 (12:45 -0700)]
[clang-format] Don't break multi block parameters on ObjCBreakBeforeNestedBlockParam

Summary:
While [the original diff](https://reviews.llvm.org/D42493) makes a lot of sense, and multiple inline block parameter/trailing paramemter after inline block paramemter should be discouraged, the formatting result is different than what xcode does by default
For the exact same example provided in the original diff:
```
[object
  blockArgument:^{
    a = 42;
  }
     anotherArg:42];
```
The code is hard to read and not very visually pleasing

This diff uses `ObjCBreakBeforeNestedBlockParam` to shield from the formatting
When it's set to false, don't allign the inline block paramemters.

Reviewers: jolesiak, benhamilton, jinlin

Reviewed By: jolesiak

Subscribers: cfe-commits

Tags: #clang

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

4 years agoAdd more detailed symbol type categorization, based on a swift patch by
Jason Molenda [Fri, 3 Apr 2020 05:10:00 +0000 (22:10 -0700)]
Add more detailed symbol type categorization, based on a swift patch by
Greg Clayton a few years ago.

My patch to augment the symbol table in Mach-O files with the
dyld trie exports data structure only categorized symbols as code
or data, but Greg Clayton had a patch to do something similar to
swift a few years ago that had a more extensive categorization of
symbols, as well as extracting some objc class/ivar names from the
entries. This patch is basically just Greg's, updated a bit and
with a test case added to it.

<rdar://problem/50791451>

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

4 years ago[AMDGPU] Disable 'Skip Uniform Regions' optimization by default for AMDGPU.
Konstantin Pyzhov [Mon, 6 Apr 2020 13:05:58 +0000 (09:05 -0400)]
[AMDGPU] Disable 'Skip Uniform Regions' optimization by default for AMDGPU.

Reviewers: sameerds, dstuttard

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

4 years ago[llvm-objdump][NFC] Declare command-line externs in headers with namespace
Hubert Tong [Mon, 6 Apr 2020 20:56:13 +0000 (16:56 -0400)]
[llvm-objdump][NFC] Declare command-line externs in headers with namespace

Summary:
This patch moves the forward declarations of command-line `cl::*`
externs in `MachODump.cpp` and `llvm-objdump.cpp` into the headers
corresponding to the file that defines the variable. At the same time,
these externs are moved into the `llvm::objdump` namespace. The externs
that are not referenced outside their defining translation unit are made
static.

This does not factor out uses of the Mach-O options from
`llvm-objdump.cpp`.

Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty

Reviewed By: jhenderson, MaskRay

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[gn build] (manually) port 6c1a9fb174ac3c
Nico Weber [Mon, 6 Apr 2020 20:50:02 +0000 (16:50 -0400)]
[gn build] (manually) port 6c1a9fb174ac3c

4 years ago[AsmPrinter] Do not define local aliases for global objects in a comdat
Leonard Chan [Fri, 3 Apr 2020 20:29:14 +0000 (13:29 -0700)]
[AsmPrinter] Do not define local aliases for global objects in a comdat

A global symbol that is defined in a comdat should not generate an alias since
call sites that would've referred to that symbol will refer to their own
independent local aliases rather than the surviving global comdat one. This
could result in something that looks like:

```
ld.lld: error: relocation refers to a discarded section: .text._ZN3fbl8internal18NullFunctionTargetIvJjjPjEED1Ev.stub
>>> defined in user-x64-clang/obj/system/ulib/minfs/libminfs.a(minfs._sources.file.cc.o)
>>> section group signature: _ZN3fbl8internal18NullFunctionTargetIvJjjPjEED1Ev.stub
>>> prevailing definition is in user-x64-clang/obj/system/ulib/minfs/libminfs.a(minfs._sources.vnode.cc.o)
>>> referenced by function.h:169 (../../zircon/system/ulib/fbl/include/fbl/function.h:169)
>>>               minfs._sources.file.cc.o:(minfs::File::AllocateAndCommitData(std::__2::unique_ptr<minfs::Transaction, std::__2::default_delete<minfs::Transaction> >)) in archive user-x64-clang/obj/system/ulib/minfs/libminfs.a
```

We ran into this when experimenting with a new C++ ABI for fuchsia
(refer to D72959) which takes relative offsets between comdat'd functions
which is why the normal C++ user wouldn't run into this.

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

4 years agoMake llvm_source_root in llvm-lit relative too.
Nico Weber [Mon, 6 Apr 2020 20:46:24 +0000 (16:46 -0400)]
Make llvm_source_root in llvm-lit relative too.

No intended behavior change.

4 years ago[SelectionDAG] fix predecessor list for INLINEASM_BRs' parent
Nick Desaulniers [Mon, 6 Apr 2020 20:34:06 +0000 (13:34 -0700)]
[SelectionDAG] fix predecessor list for INLINEASM_BRs' parent

Summary:
A bug report mentioned that LLVM was producing jumps off the end of a
function when using "asm goto with outputs". Further digging pointed to
MachineBasicBlocks that had their address taken and were indirect
targets of INLINEASM_BR being removed by BranchFolder, because their
 predecessor list was empty, so they appeared to have no entry.

This was a cascading failure caused earlier, during Pre-RA instruction
scheduling. We have a few special cases in Pre-RA instruction scheduling
where we split a MachineBasicBlock in two.  This requires careful
handing of predecessor and successor lists for a MachineBasicBlock that
was split, and careful handing of PHI MachineInstrs that referred to the
MachineBasicBlock before it was split.

The clue that led to this fix was the observation that many callers of
MachineBasicBlock::splice() frequently call
MachineBasicBlock::transferSuccessorsAndUpdatePHIs() to update their PHI
nodes after a splice. We don't want to reuse that method, as we have
custom successor transferring logic for this block split.

This patch fixes 2 pre-existing bugs, and adds tests.

The first bug was that MachineBasicBlock::splice() correctly handles
updating most successors and predecessors; we don't need to do anything
more than removing the previous fallthrough block from the first half of
the split block post splice. Previously, we were updating the successor
list incorrectly (updating successors updates predecessors).

The second bug was that PHI nodes that needed registers from the first
half of the split block were not having entries populated.  The register
live out information was correct, and the FuncInfo->PHINodesToUpdate was
correct. Specifically, the check in SelectionDAGISel::FinishBasicBlock:

    for (unsigned i = 0, e = FuncInfo->PHINodesToUpdate.size(); i != e; ++i) {
      MachineInstrBuilder PHI(*MF, FuncInfo->PHINodesToUpdate[i].first);
      if (!FuncInfo->MBB->isSuccessor(PHI->getParent()))
        continue;
      PHI.addReg(FuncInfo->PHINodesToUpdate[i].second).addMBB(FuncInfo->MBB);

was `continue`ing because FuncInfo->MBB tracks the second half of
the post-split block; no one was updating PHI entries for the first half
of the post-split block.

SelectionDAGBuilder::UpdateSplitBlock() already expects to perform
special handling for MachineBasicBlocks that were split post calls to
ScheduleDAGSDNodes::EmitSchedule(), so I'm confident that it's both
correct for ScheduleDAGSDNodes::EmitSchedule() to return the second half
of the split block `CopyBB` which updates `FuncInfo->MBB` (ie. the
current MachineBasicBlock being processed), and perform special handling
for this in SelectionDAGBuilder::UpdateSplitBlock().

Reviewers: void, craig.topper, efriedma

Reviewed By: void, efriedma

Subscribers: hfinkel, fhahn, MatzeB, efriedma, hiraditya, llvm-commits, srhines

Tags: #llvm

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

4 years agoUpstream Bionic definitions of ctype_base/regex.
Dan Albert [Mon, 6 Apr 2020 20:34:27 +0000 (13:34 -0700)]
Upstream Bionic definitions of ctype_base/regex.

Summary:
This is a patch that Android has been carrying in its tree for several
years. This patch upstreams the existing ABI.

There's some historical cruft here. __regex_word used to be a part of
regex_traits rather than ctype_base. Bionic also used to use its own
ctype implementation because the libc++ builtin one wasn't available
yet. Bionic's ctype masks were 8 bits wide and already saturated, so a
wider type needed to be used for the regex mask, and the existing
value was already used so Android needed to specify its own.

Since then Android has migrated to the builtin ctype implementation
and this patch probably should have been dropped then. Unfortunately
that was not noticed at the time, so now we need to keep this to
maintain the current ABI.

Reviewers: EricWF, #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, ldionne, libcxx-commits

Tags: #libc

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

4 years ago[debugserver] Get rid of `else` after `return`. NFC.
Davide Italiano [Thu, 2 Apr 2020 20:22:52 +0000 (13:22 -0700)]
[debugserver] Get rid of `else` after `return`. NFC.

4 years ago[libunwind] Support the new libc++ test format
Sergej Jaskiewicz [Mon, 6 Apr 2020 20:26:37 +0000 (23:26 +0300)]
[libunwind] Support the new libc++ test format

Reviewers: ldionne, #libunwind, mstorsjo

Reviewed By: ldionne, #libunwind, mstorsjo

Subscribers: mstorsjo, dexonsmith, llvm-commits, libcxx-commits

Tags: #llvm, #libunwind

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

4 years agoMinor typo improvements in documentation, NFC.
Chris Lattner [Mon, 6 Apr 2020 20:18:49 +0000 (13:18 -0700)]
Minor typo improvements in documentation, NFC.

4 years agoAMDGPU: Remove dead paths for requiresUniformRegister
Matt Arsenault [Thu, 6 Feb 2020 17:02:51 +0000 (12:02 -0500)]
AMDGPU: Remove dead paths for requiresUniformRegister

The extracts from control flow intrinsics are already properly handled
by divergence analysis. The inline asm case isn't dead, but has also
never really worked correctly so leave it as-is for now.

4 years ago[CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non...
Erik Pilkington [Mon, 6 Apr 2020 14:17:30 +0000 (10:17 -0400)]
[CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non-trivial C struct

Zero sized bit-fields aren't included in the CGRecordLayout, so we shouldn't be
calling EmitLValueForField for them. rdar://60695105

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

4 years ago[clangd] Fix bad include
Kadir Cetinkaya [Mon, 6 Apr 2020 19:36:43 +0000 (21:36 +0200)]
[clangd] Fix bad include

4 years agoDelete a variable that's been unused since r313407.
Nico Weber [Mon, 6 Apr 2020 19:25:19 +0000 (15:25 -0400)]
Delete a variable that's been unused since r313407.

No intended behavior change.

4 years ago[gn build] Port 427c1dc4f42
LLVM GN Syncbot [Mon, 6 Apr 2020 19:22:43 +0000 (19:22 +0000)]
[gn build] Port 427c1dc4f42

4 years ago[clangd] Build ASTs only with fresh preambles or after building a new preamble
Kadir Cetinkaya [Sun, 15 Mar 2020 20:43:00 +0000 (21:43 +0100)]
[clangd] Build ASTs only with fresh preambles or after building a new preamble

Summary:
This is another step for out-of-order preamble builds. To keep the
diagnostic behavior same, we only build ASTs either with "usable" preambles,
the ones that are fully applicable to a given ParseInput, or after building a
new preamble. Which is the same behaviour as what we do today. ASTs
built in the latter is called golden ASTs.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[clangd] Update TUStatus api to accommodate preamble thread
Kadir Cetinkaya [Tue, 17 Mar 2020 18:08:23 +0000 (19:08 +0100)]
[clangd] Update TUStatus api to accommodate preamble thread

Summary:
TUStatus api had a single thread in mind. This introudces a section
action to represent state of the preamble thread. In the file status extension,
we keep old behavior almost the same. We only prepend current task with a
`parsing includes` if preamble thread is working. We omit the idle thread in the
output unless both threads are idle.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[clangd] Decouple preambleworker from astworker, NFCI
Kadir Cetinkaya [Fri, 13 Mar 2020 10:52:19 +0000 (11:52 +0100)]
[clangd] Decouple preambleworker from astworker, NFCI

Summary:
First step to enable deferred preamble builds. Not intending to land it
alone, will have follow-ups that will implement full deferred build
functionality and will land after all of them are ready.

Reviewers: sammccall

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

Tags: #clang

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

4 years agoFix mismatch from D77112 and D77499
Nathan James [Mon, 6 Apr 2020 19:19:12 +0000 (20:19 +0100)]
Fix mismatch from D77112 and D77499

4 years ago[ASTMatchers] Matchers that take enumerations args provide hints with invalid arguments
Nathan James [Sun, 5 Apr 2020 14:33:34 +0000 (15:33 +0100)]
[ASTMatchers] Matchers that take enumerations args provide hints with invalid arguments

Summary:
This adds support for giving hints when using dynamic matchers with enum args. Take this query, I couldn't figure out why the matcher wasn't working:
(Turns out it needed to be "IntegralToBoolean", but thats another bug itself)
```
clang-query> match implicitCastExpr(hasCastKind("CK_IntegralToBoolean"))
1:1: Error parsing argument 1 for matcher implicitCastExpr.
1:18: Error building matcher hasCastKind.
1:30: Incorrect type for arg 1. (Expected = string) != (Actual = String)
```
With this patch the new behaviour looks like this:
```
clang-query> match implicitCastExpr(hasCastKind("CK_IntegralToBoolean"))
1:1: Error parsing argument 1 for matcher implicitCastExpr.
1:18: Error building matcher hasCastKind.
1:30: Unknown value 'CK_IntegralToBoolean' for arg 1; did you mean 'IntegralToBoolean'
```

There are no test cases for this yet as there simply isn't any infrastructure for testing errors reported when parsing args that I can see.

Reviewers: klimek, jdoerfert, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

4 years ago[llvm][CodeGen] Avoid implicit cast of TypeSize to integer in `initActions`.
Francesco Petrogalli [Mon, 6 Apr 2020 18:25:17 +0000 (19:25 +0100)]
[llvm][CodeGen] Avoid implicit cast of TypeSize to integer in `initActions`.

Reviewers: sdesmalen, efriedma

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[WebAssembly] Handle event exports
Heejin Ahn [Sat, 4 Apr 2020 13:56:35 +0000 (06:56 -0700)]
[WebAssembly] Handle event exports

Summary: This handles exports of events, which was missing.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

4 years agoRemove math.h/cmath include from DataTypes.h
Reid Kleckner [Mon, 6 Apr 2020 18:14:59 +0000 (11:14 -0700)]
Remove math.h/cmath include from DataTypes.h

DataTypes.h is meant to wrap the integer type and limits headers, which
have some unfortunate variance. The FP math functions declared by math.h
are not unnecessary. math.h took a noticeable amount of time to parse
(~40ms), but that could be startup costs.

Anyway, we don't need to include it, so skipping it can't hurt.

This has been present since the initial CMake build was added in 2008.

4 years agoAdd InjectTLIMappings pass to new pass manager
Masoud Ataei jaliseh [Mon, 6 Apr 2020 18:16:48 +0000 (13:16 -0500)]
Add InjectTLIMappings pass to new pass manager

This pass is created in d6de5f12d485a85504bc99d384a85634574a27e2 and tested
for new and legacy pass manager but never added to new pass manager pipeline.
I am adding it to new pass manager pipeline.

This pass is get used in Vector Function Database (VFDatabase) and without
this pass in new pass manager pipeline, none of the vector libraries are work
ing with new pass manager.

Related passes:
66c120f02560ef528a60924104ead66f330190f1
https://reviews.llvm.org/D74944

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

4 years ago[mlir][AsmPrinter] Change value numbering for local scope to be the next isolated...
River Riddle [Mon, 6 Apr 2020 18:04:22 +0000 (11:04 -0700)]
[mlir][AsmPrinter] Change value numbering for local scope to be the next isolated operation.

Summary: This revision updates the value numbering when printing to number from the next parent operation that is isolated from above. This is the highest level to number from that still ensures thread-safety. This revision also changes the behavior of Operator::operator<< to use local scope to avoid thread races when numbering operations.

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

4 years ago[clang][CodeComplete] Dont perform fallback completion for incomplete member ref
Kadir Cetinkaya [Mon, 6 Apr 2020 17:13:08 +0000 (19:13 +0200)]
[clang][CodeComplete] Dont perform fallback completion for incomplete member ref

Summary:
Clang performs expression based completion whenever it can't figure out
base of a member reference expression. It might be quite confusing in cases like
incomplete types. This patch disables that fallback.

Unfortunately `ParsePostfixExpressionSuffix` is quite tangled and this patch
adds more to it.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[OpenMP] Fix layering problem with FrontendOpenMP
Johannes Doerfert [Mon, 6 Apr 2020 17:39:40 +0000 (12:39 -0500)]
[OpenMP] Fix layering problem with FrontendOpenMP

Summary:
ASTMatchers is used in various places and it now exposes the
LLVMFrontendOpenMP library to its users without them needing to depend
on it explicitly.

Reviewers: lebedev.ri

Subscribers: mgorny, yaxunl, bollu, guansong, martong, cfe-commits

Tags: #clang

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

4 years ago[SelectionDAGBuilder] Fix ISD::FREEZE creation for structs with fields of different...
Craig Topper [Mon, 6 Apr 2020 17:22:50 +0000 (10:22 -0700)]
[SelectionDAGBuilder] Fix ISD::FREEZE creation for structs with fields of different types.

The previous code used the type of the first field for the VT
passed to getNode for every field.

I've based the implementation here off what is done in visitSelect
as it removes the need to special case aggregates.

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

4 years ago[NFC] Minor fix for deferred diagnostics emitter
Yaxun (Sam) Liu [Mon, 6 Apr 2020 17:52:47 +0000 (13:52 -0400)]
[NFC] Minor fix for deferred diagnostics emitter

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

4 years ago[Hexagon] Make lld be the default linker for linux/musl
Sid Manning [Sun, 5 Apr 2020 00:36:00 +0000 (19:36 -0500)]
[Hexagon] Make lld be the default linker for linux/musl

When the target is hexagon-unknown-linux-musl select lld as the default
linker.

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

4 years ago[lit] Move the recursiveExpansionLimit setting to TestingConfig
Louis Dionne [Fri, 3 Apr 2020 16:49:09 +0000 (12:49 -0400)]
[lit] Move the recursiveExpansionLimit setting to TestingConfig

The LitConfig is shared across the whole test suite. However, since
enabling recursive expansion can be a breaking change for some test
suites, it's important to confine the setting to test suites that
enable it explicitly.

Note that other issues were raised with the way recursiveExpansionLimit
operates. However, this commit simply moves the setting to the right
place -- the mechanism by which it works can be improved independently.

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

4 years ago[gn build] Port 00a57558978
LLVM GN Syncbot [Mon, 6 Apr 2020 17:54:02 +0000 (17:54 +0000)]
[gn build] Port 00a57558978

4 years agoRevert e1730cfeb3588f20dcf4a96b181ad52761666e52
Konstantin Pyzhov [Mon, 6 Apr 2020 09:56:11 +0000 (05:56 -0400)]
Revert e1730cfeb3588f20dcf4a96b181ad52761666e52

4 years ago[clang-tidy] Add check llvmlibc-implementation-in-namespace.
Paula Toth [Mon, 6 Apr 2020 17:40:50 +0000 (10:40 -0700)]
[clang-tidy] Add check llvmlibc-implementation-in-namespace.

Summary:
This check makes sure all llvm-libc implementations falls within the `__llvm_libc` namespace.

Reviewers: alexfh, aaron.ballman, hokein, njames93

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, libc-commits, mgorny, xazax.hun, MaskRay, cfe-commits, sivachandra

Tags: #clang-tools-extra, #clang

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

4 years ago[CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo
Kirill Naumov [Mon, 6 Apr 2020 16:53:10 +0000 (16:53 +0000)]
[CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo

The patch introduces the system to distinctively store the information
needed for the Control Flow Graph as well as the instrumentary needed for
the follow-up changes: BlockFrequencyInfo and BranchProbabilityInfo.
The patch is a part of sequence of three patches, related to graphs Heat Coloring.

Reviewers: rcorcs, apilipenko, davidxl, sfertile, fedor.sergeev, eraman, bollu

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

4 years agoRemove llvm::Error include form Diagnostic.h
Reid Kleckner [Mon, 6 Apr 2020 17:32:16 +0000 (10:32 -0700)]
Remove llvm::Error include form Diagnostic.h

Saves ~400 related LLVM ADT. llvm/ADT/Error.h takes 90ms to parse.

$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \
    | grep '^[-+] ' | sort | uniq -c | sort -nr
    403 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Error.h
    403 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm-c/Error.h
    397 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Format.h
    397 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Debug.h
    377 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/StringExtras.h
    158 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm-c/ExternC.h
    138 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/ErrorOr.h
     13 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/raw_ostream.h
     13 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SmallString.h
      5 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/Twine.h

4 years ago[mlir] Fix typo in docs/DefiningAttributesAndTypes.md
Jean-Michel Gorius [Mon, 6 Apr 2020 17:38:00 +0000 (19:38 +0200)]
[mlir] Fix typo in docs/DefiningAttributesAndTypes.md

4 years ago[libc++] Make sure we execute tests with the current environment
Louis Dionne [Mon, 6 Apr 2020 16:43:55 +0000 (12:43 -0400)]
[libc++] Make sure we execute tests with the current environment

The new libc++ test format doesn't automatically do this (cause it
would be the wrong place to do it).

4 years ago[analyzer] Fix NSErrorChecker false positives on constructors.
Artem Dergachev [Mon, 6 Apr 2020 17:27:40 +0000 (20:27 +0300)]
[analyzer] Fix NSErrorChecker false positives on constructors.

Constructors and delete operators cannot return a boolean value.
Therefore they cannot possibly follow the NS/CFError-related coding
conventions.

Patch by Valeriy Savchenko!

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

4 years ago[analyzer] Fix scan-build and exploded-graph-rewriter tests on Windows.
Artem Dergachev [Mon, 6 Apr 2020 17:18:13 +0000 (20:18 +0300)]
[analyzer] Fix scan-build and exploded-graph-rewriter tests on Windows.

Detect script locations in a more straightforward way: we don't need to
search for them because we know exactly where they are anyway.

Fix a file path escaping issue in exploded-graph-rewriter with Windows
backslashes in the path.

'REQUIRES: shell' remains in scan-build tests for now, so that to
observe the buildbot reaction on removing it in a cleaner experiment.

Patch by Denys Petrov!

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

4 years ago[AST] Remove DeclCXX.h dep on ASTContext.h
Reid Kleckner [Mon, 6 Apr 2020 16:55:33 +0000 (09:55 -0700)]
[AST] Remove DeclCXX.h dep on ASTContext.h

Saves only 36 includes of ASTContext.h and related headers.

There are two deps on ASTContext.h:
- C++ method overrides iterator types (TinyPtrVector)
- getting LangOptions

For #1, duplicate the iterator type, which is
TinyPtrVector<>::const_iterator.

For #2, add an out-of-line accessor to get the language options. Getting
the ASTContext from a Decl is already an out of line method that loops
over the parent DeclContexts, so if it is ever performance critical, the
proper fix is to pass the context (or LangOpts) into the predicate in
question.

Other changes are just header fixups.

4 years agoSpeed up deferred diagnostic emitter
Yaxun (Sam) Liu [Thu, 2 Apr 2020 03:26:56 +0000 (23:26 -0400)]
Speed up deferred diagnostic emitter

Move function emitDeferredDiags from Sema to DeferredDiagsEmitter since it
is only used by DeferredDiagsEmitter.

Also skip visited functions to avoid exponential compile time.

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

4 years ago[AMDGPU] Disable 'Skip Uniform Regions' optimization by default for AMDGPU.
Konstantin Pyzhov [Mon, 6 Apr 2020 09:10:37 +0000 (05:10 -0400)]
[AMDGPU] Disable 'Skip Uniform Regions' optimization by default for AMDGPU.

Reviewers: sameerds, dstuttard

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

4 years ago[sanitizer_common] Update global_symbols.txt.
Matt Morehouse [Mon, 6 Apr 2020 16:55:56 +0000 (09:55 -0700)]
[sanitizer_common] Update global_symbols.txt.

4 years agoRevert "[sanitizer_common] Show new unexpected symbols."
Matt Morehouse [Mon, 6 Apr 2020 16:55:03 +0000 (09:55 -0700)]
Revert "[sanitizer_common] Show new unexpected symbols."

This reverts commit 68d73dfa1a422fd045e25d06c3e8ff01621c377a.