platform/upstream/llvm.git
5 years agoUpdate two x86 datalayouts for r370083, looks like racing commits
Reid Kleckner [Tue, 27 Aug 2019 19:55:10 +0000 (19:55 +0000)]
Update two x86 datalayouts for r370083, looks like racing commits

llvm-svn: 370105

5 years ago[GlobalISel] Replace hard coded dynamic alloca handling with G_DYN_STACKALLOC.
Amara Emerson [Tue, 27 Aug 2019 19:54:27 +0000 (19:54 +0000)]
[GlobalISel] Replace hard coded dynamic alloca handling with G_DYN_STACKALLOC.

This change moves the actual stack pointer manipulation into the legalizer,
available to targets via lower(). The codegen is slightly different because
we're using explicit masks instead of G_PTRMASK, and using G_SUB rather than
adding a negative amount via G_GEP.

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

llvm-svn: 370104

5 years ago[clangd] Add a distinct highlighting for local variables
Nathan Ridge [Tue, 27 Aug 2019 19:39:11 +0000 (19:39 +0000)]
[clangd] Add a distinct highlighting for local variables

Summary:
It's useful to be able to distinguish local variables from namespace
scope variables.

Reviewers: hokein, jvikstrom

Reviewed By: hokein

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

Tags: #clang

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

llvm-svn: 370103

5 years ago[Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process
Philip Reames [Tue, 27 Aug 2019 19:34:43 +0000 (19:34 +0000)]
[Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process

The code we had isSafeToLoadUnconditionally was blatantly wrong. This function takes a "Size" argument which is supposed to describe the span loaded from. Instead, the code use the size of the pointer passed (which may be unrelated!) and only checks that span. For any Size > LoadSize, this can and does lead to miscompiles.

Worse, the generic code just a few lines above correctly handles the cases which *are* valid. So, let's delete said code.

Removing this code revealed two issues:
1) As noted by jdoerfert the removed code incorrectly handled external globals.  The test update in SROA is to stop testing incorrect behavior.
2) SROA was confusing bytes and bits, but this wasn't obvious as the Size parameter was being essentially ignored anyway.  Fixed.

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

llvm-svn: 370102

5 years agoAMDGPU: Always emit amdgpu-flat-work-group-size
Matt Arsenault [Tue, 27 Aug 2019 19:25:40 +0000 (19:25 +0000)]
AMDGPU: Always emit amdgpu-flat-work-group-size

The backend default maximum should be the hardware maximum, so the
frontend should set the implementation defined default maximum.

llvm-svn: 370101

5 years agoDiagnose both _Complex and _Imaginary as C99 extensions.
Aaron Ballman [Tue, 27 Aug 2019 19:15:24 +0000 (19:15 +0000)]
Diagnose both _Complex and _Imaginary as C99 extensions.

llvm-svn: 370100

5 years agoDAG: computeNumSignBits for MUL
Matt Arsenault [Tue, 27 Aug 2019 19:05:33 +0000 (19:05 +0000)]
DAG: computeNumSignBits for MUL

Copied directly from the IR version.

Most of the testcases I've added for this are somewhat problematic
because they really end up testing the yet to be implemented version
for MUL_I24/MUL_U24.

llvm-svn: 370099

5 years agoAMDGPU: Add baseline test for num sign bits of mul
Matt Arsenault [Tue, 27 Aug 2019 19:01:02 +0000 (19:01 +0000)]
AMDGPU: Add baseline test for num sign bits of mul

llvm-svn: 370098

5 years ago[XCOFF][AIX] Generate symbol table entries with llvm-readobj
Jason Liu [Tue, 27 Aug 2019 18:54:46 +0000 (18:54 +0000)]
[XCOFF][AIX] Generate symbol table entries with llvm-readobj

Summary:

This patch implements main entry and auxiliary entries of symbol table generation for llvm-readobj on AIX.
The source code of aix_xcoff_xlc_test8.o (compile with xlc) is:

-bash-4.2$ cat test8.c
extern int i;
extern int TestforXcoff;
extern int fun(int i);
static int static_i;
char* p="abcd";
int fun1(int j) {
  static_i++;
  j++;
  j=j+*p;
  return j;
}
int main() {
  i++;
  fun(i);
  return fun1(i);
}

Patch provided by DiggerLin

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

llvm-svn: 370097

5 years agoRemove clang-tidy-vs from clang-tools-extra (PR41791)
Alex Lorenz [Tue, 27 Aug 2019 18:36:08 +0000 (18:36 +0000)]
Remove clang-tidy-vs from clang-tools-extra (PR41791)

The clang-tidy-vs visual studio plugin in clang-tools-extra contains a
security vulnerability in the YamlDotNet package [1]. I posted to cfe-dev [2],
asking if there was anyone who was interested in updating the the plugin
to address the vulnerability. Reid mentioned that Zach (the original committer),
said that there's another plugin (Clang Power Tools) that provides clang-tidy support,
with additional extra features, so it would be ok to remove clang-tidy-vs.

This commit removes the plugin to address the security vulnerability, and adds
a section to the release notes that mentions that the plugin was removed, and
suggests to use Clang Power Tools.

Fixes PR 41791.

[1]: https://nvd.nist.gov/vuln/detail/CVE-2018-1000210
[2]: http://lists.llvm.org/pipermail/cfe-dev/2019-August/063196.html

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

llvm-svn: 370096

5 years agoRevert Autogenerate the shebang lines for tools/opt-viewer
Reid Kleckner [Tue, 27 Aug 2019 18:31:29 +0000 (18:31 +0000)]
Revert Autogenerate the shebang lines for tools/opt-viewer

This reverts r369486 (git commit 8d18384809957cc923752e10a86adab129e3df48)

The opt-viewer tests don't pass after this change, and fixing them isn't
trivial. opt-viewer.py imports optmap, which requires adjusting
pythonpath, which is more work than I'm willing to do to fix forward.

llvm-svn: 370095

5 years agoAdd GWP-ASan fuzz target to compiler-rt/tools.
Mitch Phillips [Tue, 27 Aug 2019 18:28:07 +0000 (18:28 +0000)]
Add GWP-ASan fuzz target to compiler-rt/tools.

Summary:
@eugenis to approve addition of //compiler-rt/tools.
@pree-jackie please confirm that this WFY.

D66494 introduced the GWP-ASan stack_trace_compressor_fuzzer. Building fuzz
targets in compiler-rt is a new affair, and has some challenges:
- If the host compiler doesn't have compiler-rt, the -fsanitize=fuzzer may not
  be able to link against `libclang_rt.fuzzer*`.
- Things in compiler-rt generally aren't built when you want to build with
  sanitizers using `-DLLVM_USE_SANITIZER`. This tricky to work around, so
  we create the new tools directory so that we can build fuzz targets with
  sanitizers. This has the added bonus of fixing the problem above as well, as
  we can now just guard the fuzz target build to only be done with
  `-DLLVM_USE_SANITIZE_COVERAGE=On`.

Reviewers: eugenis, pree-jackie

Reviewed By: eugenis, pree-jackie

Subscribers: dberris, mgorny, #sanitizers, llvm-commits, eugenis, pree-jackie, lebedev.ri, vitalybuka, morehouse

Tags: #sanitizers, #llvm

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

llvm-svn: 370094

5 years ago[driver][xray] fix the macOS support checker by supporting -macos
Alex Lorenz [Tue, 27 Aug 2019 18:26:36 +0000 (18:26 +0000)]
[driver][xray] fix the macOS support checker by supporting -macos
triple in addition to -darwin

The previous check incorrectly checked for macOS support by
allowing -darwin triples only, and -macos triple was not supported.

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

llvm-svn: 370093

5 years ago[ORCv2] - New Speculate Query Implementation
Praveen Velliengiri [Tue, 27 Aug 2019 18:23:36 +0000 (18:23 +0000)]
[ORCv2] - New Speculate Query Implementation

Summary:
This patch introduces, SequenceBBQuery - new heuristic to find likely next callable functions it tries to find the blocks with calls in order of execution sequence of Blocks.

It still uses BlockFrequencyAnalysis to find high frequency blocks. For a handful of hottest blocks (plan to customize), the algorithm traverse and discovered the caller blocks along the way to Entry Basic Block and Exit Basic Block. It uses Block Hint, to stop traversing the already visited blocks in both direction. It implicitly assumes that once the block is visited during discovering entry or exit nodes, revisiting them again does not add much. It also branch probability info (cached result) to traverse only hot edges (planned to customize) from hot blocks. Without BPI, the algorithm mostly return's all the blocks in the CFG with calls.

It also changes the heuristic queries, so they don't maintain states. Hence it is safe to call from multiple threads.

It also implements, new instrumentation to avoid jumping into JIT on every call to the function with the help _orc_speculate.decision.block and _orc_speculate.block.

"Speculator Registration Mechanism is also changed" - kudos to @lhames

Open to review, mostly looking to change implementation of SequeceBBQuery heuristics with good data structure choices.

Reviewers: lhames, dblaikie

Reviewed By: lhames

Subscribers: mgorny, hiraditya, mgrang, llvm-commits, lhames

Tags: #speculative_compilation_in_orc, #llvm

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

llvm-svn: 370092

5 years ago[Tblgen][MCA] Add the ability to mark groups as LoadQueue and StoreQueue. NFCI
Andrea Di Biagio [Tue, 27 Aug 2019 18:20:34 +0000 (18:20 +0000)]
[Tblgen][MCA] Add the ability to mark groups as LoadQueue and StoreQueue. NFCI

Before this patch, users were not allowed to optionally mark processor resource
groups as load/store queues. That is because tablegen class MemoryQueue was
originally declared as expecting a ProcResource template argument (instead of a
more generic ProcResourceKind).

That was an oversight, since the original intention from D54957 was to let user
mark any processor resource as either load/store queue.  This patch adds the
ability to use processor resource groups in MemoryQueue definitions. This is not
a user visible change.

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

llvm-svn: 370091

5 years ago[dotest] Remove results port
Jonas Devlieghere [Tue, 27 Aug 2019 18:18:46 +0000 (18:18 +0000)]
[dotest] Remove results port

The results port was used by dosep.py to deal with test results coming
form different processes. With dosep.py gone, I don't think we need this
any longer.

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

llvm-svn: 370090

5 years agoAMDGPU: Add amdgpu-32bit-address-high-bits to MIR serialization
Matt Arsenault [Tue, 27 Aug 2019 18:18:38 +0000 (18:18 +0000)]
AMDGPU: Add amdgpu-32bit-address-high-bits to MIR serialization

llvm-svn: 370089

5 years ago[JITLink] Fix bogus TimerGroup constructor call.
Lang Hames [Tue, 27 Aug 2019 18:05:05 +0000 (18:05 +0000)]
[JITLink] Fix bogus TimerGroup constructor call.

llvm-svn: 370088

5 years agoMove EH spec mismatches under -fms-compatibility
Reid Kleckner [Tue, 27 Aug 2019 17:52:03 +0000 (17:52 +0000)]
Move EH spec mismatches under -fms-compatibility

-fms-extensions is intended to enable conforming language extensions and
-fms-compatibility is intended to language rule relaxations, so a user
could plausibly compile with -fno-ms-compatibility on Windows while
still using dllexport, for example.  This exception specification
validation behavior has been handled as a warning since before
-fms-compatibility was added in 2011. I think it's just an oversight
that it hasn't been moved yet.

This will help users find conformance issues in their code such as those
found in _com_ptr_t as described in https://llvm.org/PR42842.

Reviewers: hans

Subscribers: STL_MSFT, cfe-commits

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

llvm-svn: 370087

5 years agoAMDGPU: Fix crash from inconsistent register types for v3i16/v3f16
Matt Arsenault [Tue, 27 Aug 2019 17:51:56 +0000 (17:51 +0000)]
AMDGPU: Fix crash from inconsistent register types for v3i16/v3f16

This is something of a workaround since computeRegisterProperties
seems to be doing the wrong thing.

llvm-svn: 370086

5 years ago[ORC] NFC remove unimplemented query
Praveen Velliengiri [Tue, 27 Aug 2019 17:51:50 +0000 (17:51 +0000)]
[ORC] NFC remove unimplemented query

Summary: CFGWalk Query is unimplemented for valid reasons. But the declaration got included in commit file.

Reviewers: lhames, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 370085

5 years agoRecommit "[GlobalISel] Import patterns containing INSERT_SUBREG"
Jessica Paquette [Tue, 27 Aug 2019 17:47:06 +0000 (17:47 +0000)]
Recommit  "[GlobalISel] Import patterns containing INSERT_SUBREG"

I thought `llvm::sort` was stable for some reason but it's not.

Use `llvm::stable_sort` in `CodeGenTarget::getSuperRegForSubReg`.

Original patch: https://reviews.llvm.org/D66498

llvm-svn: 370084

5 years agoChange the X86 datalayout to add three address spaces for 32 bit signed,
Amy Huang [Tue, 27 Aug 2019 17:46:53 +0000 (17:46 +0000)]
Change the X86 datalayout to add three address spaces for 32 bit signed,
32 bit unsigned, and 64 bit pointers.

llvm-svn: 370083

5 years agoUse FileEntryRef for PPCallbacks::HasInclude
Alex Lorenz [Tue, 27 Aug 2019 17:32:42 +0000 (17:32 +0000)]
Use FileEntryRef for PPCallbacks::HasInclude

This fixes the issue where a filename dependendency was missing if the file that
was referenced with __has_include() was accessed through a symlink in an earlier run,
if the file manager was reused between runs.

llvm-svn: 370081

5 years agoRevert "[GlobalISel] Import patterns containing INSERT_SUBREG"
Jessica Paquette [Tue, 27 Aug 2019 17:26:44 +0000 (17:26 +0000)]
Revert "[GlobalISel] Import patterns containing INSERT_SUBREG"

When EXPENSIVE_CHECKS are enabled, GlobalISelEmitterSubreg.td doesn't get
stable output.

Reverting while I debug it.

See: https://reviews.llvm.org/D66498
llvm-svn: 370080

5 years ago[X86] Remove encoding information from the TAILJMP instructions that are lowered...
Craig Topper [Tue, 27 Aug 2019 17:24:23 +0000 (17:24 +0000)]
[X86] Remove encoding information from the TAILJMP instructions that are lowered by MCInstLowering. Fix LowerPATCHABLE_TAIL_CALL to also convert them to regular JMP/JCC instructions

There are 5 instructions here that are converted from TAILJMP opcodes to regular JMP/JCC opcodes during MCInstLowering. So normally there encoding information isn't used. The exception being when XRay wraps them in PATCHABLE_TAIL_CALL.

For the ones that weren't already handled in MCInstLowering, add handling for those and remove their encoding information.

This patch fixes PATCHABLE_TAIL_CALL to do the same opcode conversion as the regular lowering patch. Then removes the encoding information.

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

llvm-svn: 370079

5 years ago[lldb] Fix x86 compilation
Tatyana Krasnukha [Tue, 27 Aug 2019 17:22:03 +0000 (17:22 +0000)]
[lldb] Fix x86 compilation

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

Patch by Leonid Mashinskiy

llvm-svn: 370078

5 years ago[JITLink] Add timers and -show-times option to llvm-jitlink.
Lang Hames [Tue, 27 Aug 2019 15:51:19 +0000 (15:51 +0000)]
[JITLink] Add timers and -show-times option to llvm-jitlink.

The timers track time spent loading objects, linking, and (if applicable)
running JIT-link'd code.

llvm-svn: 370075

5 years ago[JITLink][ORC] Track eh-frame section size for registration/deregistration.
Lang Hames [Tue, 27 Aug 2019 15:50:32 +0000 (15:50 +0000)]
[JITLink][ORC] Track eh-frame section size for registration/deregistration.

On MachO, processing of the eh-frame section should stop if the end of the
__eh_frame section is reached, regardless of whether or not there is a null CFI
length field at the end of the section. This patch tracks the eh-frame section
size and threads it through the appropriate APIs so that processing can be
terminated correctly.

No testcase yet: This patch is all API plumbing (rather than modification of
linked memory) which the existing infrastructure does not provide a way of
testing. Committing without a testcase until I have an idea of how to write
one.

llvm-svn: 370074

5 years ago[RISCV] Set MaxAtomicInlineWidth and MaxAtomicPromoteWidth for RV32/RV64 targets...
Sam Elliott [Tue, 27 Aug 2019 15:41:16 +0000 (15:41 +0000)]
[RISCV] Set MaxAtomicInlineWidth and MaxAtomicPromoteWidth for RV32/RV64 targets with atomics

Summary: This ensures that libcalls aren't generated when the target supports atomics. Atomics aren't in the base RV32I/RV64I instruction sets, so MaxAtomicInlineWidth and MaxAtomicPromoteWidth are set only when the atomics extension is being targeted. This must be done in setMaxAtomicWidth, as this should be done after handleTargetFeatures has been called.

Reviewers: jfb, jyknight, wmi, asb

Reviewed By: asb

Subscribers: pzheng, MaskRay, s.egerton, lenary, dexonsmith, psnobl, benna, Jim, JohnLLVM, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, lewis-revill, cfe-commits

Tags: #clang

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

llvm-svn: 370073

5 years ago[JITLink] Don't under-align zero-fill sections.
Lang Hames [Tue, 27 Aug 2019 15:22:23 +0000 (15:22 +0000)]
[JITLink] Don't under-align zero-fill sections.

If content sections have lower alignment than zero-fill sections then bump the
overall segment alignment to avoid under-aligning the zero-fill sections.

llvm-svn: 370072

5 years ago[DAGCombiner] cancel fnegs from multiplied operands of FMA
Sanjay Patel [Tue, 27 Aug 2019 15:17:46 +0000 (15:17 +0000)]
[DAGCombiner] cancel fnegs from multiplied operands of FMA

(-X) * (-Y) + Z --> X * Y + Z

This is a missing optimization that shows up as a potential regression in D66050,
so we should solve it first. We appear to be partly missing this fold in IR as well.

We do handle the simpler case already:
(-X) * (-Y) --> X * Y

And it might be beneficial to make the constraint less conservative (eg, if both
operands are cheap, but not necessarily cheaper), but that causes infinite looping
for the existing fmul transform.

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

llvm-svn: 370071

5 years agoHandle local commons for XCOFF object file writing
Jason Liu [Tue, 27 Aug 2019 15:14:45 +0000 (15:14 +0000)]
Handle local commons for XCOFF object file writing

Summary:
Adds support for emitting common local global symbols to an XCOFF object file.
Local commons are emitted into the .bss section with a storage class of
C_HIDEXT.

Patch by: daltenty

Reviewers: sfertile, hubert.reinterpretcast

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

llvm-svn: 370070

5 years agoRevert "[CodeGen] Do the Simple Early Return in block-placement pass to optimize...
Jinsong Ji [Tue, 27 Aug 2019 14:59:08 +0000 (14:59 +0000)]
Revert "[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks"

This reverts commit b3d258fc44b588f06eb35f8e4b9a6d1fc859acec.

@skatkov is reporting crash in D63972#1646303
Contacted @ZhangKang, and revert the commit on behalf of him.

llvm-svn: 370069

5 years agoUpdate the SARIF exporter to SARIF 2.1
Joe Ranieri [Tue, 27 Aug 2019 14:43:54 +0000 (14:43 +0000)]
Update the SARIF exporter to SARIF 2.1

This updates the SARIF exporter to produce SARIF 2.1 output. The bulk of the diffs come from two changes to SARIF:
* https://github.com/oasis-tcs/sarif-spec/issues/309
* https://github.com/oasis-tcs/sarif-spec/issues/179

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

llvm-svn: 370068

5 years ago[MIPS GlobalISel] ClampScalar G_SHL, G_ASHR and G_LSHR
Petar Avramovic [Tue, 27 Aug 2019 14:41:44 +0000 (14:41 +0000)]
[MIPS GlobalISel] ClampScalar G_SHL, G_ASHR and G_LSHR

ClampScalar G_SHL, G_ASHR and G_LSHR to s32 for MIPS32.

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

llvm-svn: 370067

5 years agoReplace some custom C11 extension warnings with the generic warning.
Aaron Ballman [Tue, 27 Aug 2019 14:41:39 +0000 (14:41 +0000)]
Replace some custom C11 extension warnings with the generic warning.

llvm-svn: 370066

5 years ago[GlobalISel] Factor narrowScalar for G_ASHR and G_LSHR. NFC
Petar Avramovic [Tue, 27 Aug 2019 14:33:05 +0000 (14:33 +0000)]
[GlobalISel] Factor narrowScalar for G_ASHR and G_LSHR. NFC

Main difference is in the way Hi for Long shift (HiL) is made.
G_LSHR fills HiL with zeros, while G_ASHR fills HiL with sign bit value.

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

llvm-svn: 370064

5 years ago[GlobalISel] Fix narrowScalar for shifts to match algorithm from SDAG
Petar Avramovic [Tue, 27 Aug 2019 14:22:32 +0000 (14:22 +0000)]
[GlobalISel] Fix narrowScalar for shifts to match algorithm from SDAG

Fix typos. Use Hi and Lo prefixes for Or instead of LHS and RHS
to match names of surrounding variables.

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

llvm-svn: 370062

5 years agoFix a SARIF exporter crash with macro expansions
Joe Ranieri [Tue, 27 Aug 2019 14:20:27 +0000 (14:20 +0000)]
Fix a SARIF exporter crash with macro expansions

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

llvm-svn: 370061

5 years agoFix text range end columns in SARIF to be exclusive
Joe Ranieri [Tue, 27 Aug 2019 13:49:45 +0000 (13:49 +0000)]
Fix text range end columns in SARIF to be exclusive

According to the SARIF specification, "a text region does not include the character specified by endColumn".

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

llvm-svn: 370060

5 years agoQuote the token being diagnosed for C11 extensions.
Aaron Ballman [Tue, 27 Aug 2019 13:47:51 +0000 (13:47 +0000)]
Quote the token being diagnosed for C11 extensions.

llvm-svn: 370059

5 years agoSpeculatively fix the build bots after r370052.
Aaron Ballman [Tue, 27 Aug 2019 13:45:42 +0000 (13:45 +0000)]
Speculatively fix the build bots after r370052.

llvm-svn: 370058

5 years ago[lldb][NFC] Add missing invalid_core_file to TestTargetCommand test
Raphael Isemann [Tue, 27 Aug 2019 13:34:15 +0000 (13:34 +0000)]
[lldb][NFC] Add missing invalid_core_file to TestTargetCommand test

llvm-svn: 370057

5 years ago[DAGCombiner] Add node to the worklist in topological order in parallelizeChainedStores
Amaury Sechet [Tue, 27 Aug 2019 13:27:57 +0000 (13:27 +0000)]
[DAGCombiner] Add node to the worklist in topological order in parallelizeChainedStores

Summary: As per title.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 370056

5 years ago[X86][AVX] Add SimplifyDemandedVectorElts support for KSHIFTL/KSHIFTR
Simon Pilgrim [Tue, 27 Aug 2019 13:13:17 +0000 (13:13 +0000)]
[X86][AVX] Add SimplifyDemandedVectorElts support for KSHIFTL/KSHIFTR

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

llvm-svn: 370055

5 years agoStabilize TestIOHandlerCompletion
Pavel Labath [Tue, 27 Aug 2019 13:09:40 +0000 (13:09 +0000)]
Stabilize TestIOHandlerCompletion

pexpect gives as raw data going to a terminal. This means that if the
completed line does not fit the emulated line, the returned data will
contain line breaks. On my machine these line breaks happened to be
inside the "iohandler/completion" string that the test was searching
for.

Work around this by telling pexpect to emulate a very wide terminal.

llvm-svn: 370054

5 years ago[IntrinsicEmitter] Support scalable vectors in intrinsics
Cullen Rhodes [Tue, 27 Aug 2019 12:57:09 +0000 (12:57 +0000)]
[IntrinsicEmitter] Support scalable vectors in intrinsics

Summary:
This patch adds support for scalable vectors in intrinsics, enabling
intrinsics such as the following to be defined:

    declare <vscale x 4 x i32> @llvm.something.nxv4i32(<vscale x 4 x i32>)

Support for this is implemented by defining a new type descriptor for
scalable vectors and adding mangling support for scalable vector types
in the name mangling scheme used by 'any' types in intrinsic signatures.

Tests have been added for IRBuilder to test scalable vectors work as
expected when using intrinsics through this interface. This required
implementing an intrinsic that is explicitly defined with scalable
vectors, e.g.  LLVMType<nxv4i32>, an SVE floating-point convert
intrinsic was used for this.  The behaviour of the overloaded type
LLVMScalarOrSameVectorWidth with scalable vectors is tested using the
existing masked load intrinsic. Also added an .ll test to test the
Verifier catches a bad intrinsic argument when passing a fixed-width
predicate (mask) to the masked.load intrinsic where a scalable is
expected.

Patch by Paul Walker

Reviewed By: sdesmalen

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

llvm-svn: 370053

5 years agoImplement codegen for MSVC unions with reference members.
Aaron Ballman [Tue, 27 Aug 2019 12:42:45 +0000 (12:42 +0000)]
Implement codegen for MSVC unions with reference members.

Currently, clang accepts a union with a reference member when given the -fms-extensions flag. This change fixes the codegen for this case.

Patch by Dominic Ferreira.

llvm-svn: 370052

5 years agoTesting commit access; NFC
Joe Ranieri [Tue, 27 Aug 2019 12:36:25 +0000 (12:36 +0000)]
Testing commit access; NFC

llvm-svn: 370051

5 years ago[lldb][NFC] Add some tests for the target subcommands
Raphael Isemann [Tue, 27 Aug 2019 11:57:26 +0000 (11:57 +0000)]
[lldb][NFC] Add some tests for the target subcommands

llvm-svn: 370050

5 years ago[ELF][ARM] Allow PT_LOAD to have overlapping p_offset ranges on EM_ARM
Fangrui Song [Tue, 27 Aug 2019 11:52:36 +0000 (11:52 +0000)]
[ELF][ARM] Allow PT_LOAD to have overlapping p_offset ranges on EM_ARM

Port the D64906 technique to ARM. It deletes 3 alignments at
PT_LOAD boundaries for the default case: the size of an arm binary
decreases by at most 12kb.

Reviewed By: grimar

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

llvm-svn: 370049

5 years ago[ELF][ARM] Add --no-show-raw-insn and -soname to some ARM tests
Fangrui Song [Tue, 27 Aug 2019 11:50:27 +0000 (11:50 +0000)]
[ELF][ARM] Add --no-show-raw-insn and -soname to some ARM tests

Delete some insignificant addresses to make it simpler for layout
changes.

llvm-svn: 370048

5 years ago[lldb][NFC] Give added test method a unique name
Raphael Isemann [Tue, 27 Aug 2019 11:43:54 +0000 (11:43 +0000)]
[lldb][NFC] Give added test method a unique name

Otherwise dotest doesn't run the test and just lets it always pass.
Also update the comment to explain that we do directory and not
file completion.

llvm-svn: 370047

5 years ago[NFC] Added tests for D66651
David Bolvansky [Tue, 27 Aug 2019 11:41:03 +0000 (11:41 +0000)]
[NFC] Added tests for D66651

llvm-svn: 370046

5 years ago[ASTImporter] Fix name conflict handling with different strategies
Gabor Marton [Tue, 27 Aug 2019 11:36:10 +0000 (11:36 +0000)]
[ASTImporter] Fix name conflict handling with different strategies

There are numorous flaws about the name conflict handling, this patch
attempts fixes them. Changes in details:

* HandleNameConflict return with a false DeclarationName

Hitherto we effectively never returned with a NameConflict error, even
if the preceding StructuralMatch indicated a conflict.
Because we just simply returned with the parameter `Name` in
HandleNameConflict and that name is almost always `true` when converted to
`bool`.

* Add tests which indicate wrong NameConflict handling

* Add to ConflictingDecls only if decl kind is different

Note, we might not indicate an ODR error when there is an existing record decl
and a enum is imported with same name.  But there are other cases. E.g. think
about the case when we import a FunctionTemplateDecl with name f and we found a
simple FunctionDecl with name f. They overload.  Or in case of a
ClassTemplateDecl and CXXRecordDecl, the CXXRecordDecl could be the 'templated'
class, so it would be false to report error.  So I think we should report a
name conflict error only when we are 100% sure of that.  That is why I think it
should be a general pattern to report the error only if the kind is the same.

* Fix failing ctu test with EnumConstandDecl

In ctu-main.c we have the enum class 'A' which brings in the enum
constant 'x' with value 0 into the global namespace.
In ctu-other.c we had the enum class 'B' which brought in the same name
('x') as an enum constant but with a different enum value (42). This is clearly
an ODR violation in the global namespace. The solution was to rename the
second enum constant.

 * Introduce ODR handling strategies

Reviewers: a_sidorin, shafik

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

llvm-svn: 370045

5 years ago[clang] Ensure that statements, expressions and types are trivially destructible
Bruno Ricci [Tue, 27 Aug 2019 11:35:49 +0000 (11:35 +0000)]
[clang] Ensure that statements, expressions and types are trivially destructible

Since statements, expressions and types are allocated with the BumpPtrAllocator
from ASTContext their destructor is not executed. Two classes are currently
exempted from the check : InitListExpr due to its ASTVector and
ConstantArrayType due to its APInt.

No functional changes.

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

Reviewed By: lebedev.ri, gribozavr

llvm-svn: 370044

5 years ago[lldb] Allow partial completions to fix directory completion.
Raphael Isemann [Tue, 27 Aug 2019 11:32:22 +0000 (11:32 +0000)]
[lldb] Allow partial completions to fix directory completion.

On the command line we usually insert a space after a completion to indicate that
the completion was successful. After the completion API refactoring, this also
happens with directories which essentially breaks file path completion (as
adding a space terminates the path and starts a new arg). This patch restores the old
behavior by again allowing partial completions. Also extends the iohandler
and SB API tests as the implementation for this is different in Editline
and SB API.

llvm-svn: 370043

5 years agoAdd error handling to the DataExtractor class
Pavel Labath [Tue, 27 Aug 2019 11:24:08 +0000 (11:24 +0000)]
Add error handling to the DataExtractor class

Summary:
This is motivated by D63591, where we realized that there isn't a really
good way of telling whether a DataExtractor is reading actual data, or
is it just returning default values because it reached the end of the
buffer.

This patch resolves that by providing a new "Cursor" class. A Cursor
object encapsulates two things:
- the current position/offset in the DataExtractor
- an error object

Storing the error object inside the Cursor enables one to use the same
pattern as the std::{io}stream API, where one can blindly perform a
sequence of reads and only check for errors once at the end of the
operation. Similarly to the stream API, as soon as we encounter one
error, all of the subsequent operations are skipped (return default
values) too, even if the would suceed with clear error state. Unlike the
std::stream API (but in line with other llvm APIs), we force the error
state to be checked through usage of llvm::Error.

Reviewers: probinson, dblaikie, JDevlieghere, aprantl, echristo

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 370042

5 years ago[clang] Ensure that comment classes are trivially destructible
Bruno Ricci [Tue, 27 Aug 2019 11:21:00 +0000 (11:21 +0000)]
[clang] Ensure that comment classes are trivially destructible

As in D66646, these classes are also allocated with a BumpPtrAllocator,
and therefore should be trivially destructible.

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

Reviewed By: Mordante, gribozavr

llvm-svn: 370041

5 years ago[DAGCombiner] Add node to the worklist in topological order after relegalization.
Amaury Sechet [Tue, 27 Aug 2019 11:06:09 +0000 (11:06 +0000)]
[DAGCombiner] Add node to the worklist in topological order after relegalization.

Summary: As per title.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 370040

5 years agoRefactor GlobList from an ad-hoc linked list to a vector
Dmitri Gribenko [Tue, 27 Aug 2019 10:56:13 +0000 (10:56 +0000)]
Refactor GlobList from an ad-hoc linked list to a vector

Summary: I think it makes method implementations more obvious.

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 370039

5 years ago[InstCombine] Fold select with ctlz to cttz
David Bolvansky [Tue, 27 Aug 2019 10:22:40 +0000 (10:22 +0000)]
[InstCombine] Fold select with ctlz to cttz

Summary:
Handle pattern [0]:

int ctz(unsigned int a)
{
  int c = __clz(a & -a);
  return a ? 31 - c : c;
}

In reality, the compiler can generate much better code for cttz, so fold away this pattern.

https://godbolt.org/z/c5kPtV

 [0] https://community.arm.com/community-help/f/discussions/2114/count-trailing-zeros

Reviewers: spatel, nikic, lebedev.ri, dmgreen, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

llvm-svn: 370037

5 years agoAArch64: avoid creating cycle in DAG for post-increment NEON ops.
Tim Northover [Tue, 27 Aug 2019 10:21:11 +0000 (10:21 +0000)]
AArch64: avoid creating cycle in DAG for post-increment NEON ops.

Inserting a value into Visited has the effect of terminating a search for
predecessors if that node is seen. This is legitimate for the base address, and
acts as a slight performance optimization, but the vector-building node can be
paert of a legitimate cycle so we shouldn't stop searching there.

PR43056.

llvm-svn: 370036

5 years ago[ReleaseNotes] MemorySanitizer support of ASLR on FreeBSD
David Carlier [Tue, 27 Aug 2019 10:04:03 +0000 (10:04 +0000)]
[ReleaseNotes] MemorySanitizer support of ASLR on FreeBSD

Reviewers: sylvestre.ledru, kcc

Reviewed By: sylvestre.ledru

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

llvm-svn: 370035

5 years ago[llvm-objdump] - Remove one overload of reportError. NFCI.
George Rimar [Tue, 27 Aug 2019 10:03:45 +0000 (10:03 +0000)]
[llvm-objdump] - Remove one overload of reportError. NFCI.

There is a problem with reportError we have.
Declaration says we have ArchiveName
that follows the FileName:

reportError(Error E, StringRef FileName, StringRef ArchiveName,...

Though implementation have them reversed. I cleaned it up and
removed an excessive reportError(Error E, StringRef File) version.

Rebased on top of D66418.

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

llvm-svn: 370034

5 years ago[Driver] Add an option for createInvocationFromCommandLine to recover on errors
Ilya Biryukov [Tue, 27 Aug 2019 10:02:18 +0000 (10:02 +0000)]
[Driver] Add an option for createInvocationFromCommandLine to recover on errors

Summary:
Previously, it would always return nullptr on any error.
This change adds a parameter, controlling whether the function should
attempt to return a non-null result even if unknown arguments (or other
errors were encountered).

The new behavior is only used in clangd.

Considered an alternative of changing the return value instead of adding
a new parameter, but that would require updating all callsites. Settled
with the parameter to minimize the code changes.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: nridge, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 370033

5 years ago[yaml2obj] - Don't allow setting StOther and Other/Visibility at the same time.
George Rimar [Tue, 27 Aug 2019 09:58:39 +0000 (09:58 +0000)]
[yaml2obj] - Don't allow setting StOther and Other/Visibility at the same time.

This is a follow up discussed in the comments of D66583.

Currently, if for example, we have both StOther and Other set in YAML document for a symbol,
then yaml2obj reports an "unknown key 'Other'" error.
It happens because 'mapOptional()' is never called for 'Other/Visibility' in this case,
leaving those unhandled.

This message does not describe the reason of the error well. This patch fixes it.

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

llvm-svn: 370032

5 years ago[clangd] Fix for r370029 test that got left in my client
Sam McCall [Tue, 27 Aug 2019 09:27:00 +0000 (09:27 +0000)]
[clangd] Fix for r370029 test that got left in my client

llvm-svn: 370030

5 years ago[clangd] Fix toHalfOpenFileRange where start/end endpoints are in different files...
Sam McCall [Tue, 27 Aug 2019 08:44:06 +0000 (08:44 +0000)]
[clangd] Fix toHalfOpenFileRange where start/end endpoints are in different files due to #include

Summary: https://github.com/clangd/clangd/issues/129

Reviewers: SureYeaah

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

Tags: #clang

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

llvm-svn: 370029

5 years agoGlobList: added a clear test for pattern priority
Dmitri Gribenko [Tue, 27 Aug 2019 08:42:42 +0000 (08:42 +0000)]
GlobList: added a clear test for pattern priority

Summary:
The last glob that matches the string decides whether that string is
included or excluded.

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 370028

5 years agoDWARFExpression: Simplify class interface
Pavel Labath [Tue, 27 Aug 2019 07:49:41 +0000 (07:49 +0000)]
DWARFExpression: Simplify class interface

Summary:
The DWARFExpression methods have a lot of arguments. This removes two of
them by removing the ability to slice the expression via two offset+size
parameters. This is a functionality that it is not always needed, and
when it is, we already have a different handy way of slicing a data
extractor which we can use instead.

Reviewers: JDevlieghere, clayborg

Subscribers: aprantl, lldb-commits

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

llvm-svn: 370027

5 years agoFix an unused variable warning in no-assert builds
Pavel Labath [Tue, 27 Aug 2019 07:46:07 +0000 (07:46 +0000)]
Fix an unused variable warning in no-assert builds

llvm-svn: 370026

5 years ago[asan_symbolize] Fix broken pipe handling for python 2.7
Alexander Richardson [Tue, 27 Aug 2019 07:27:41 +0000 (07:27 +0000)]
[asan_symbolize] Fix broken pipe handling for python 2.7

I D65322 I added a check for BrokenPipeError. However, python 2.7 doesn't
have BrokenPipeError. To be python 2.7 and 3 compatible we need to catch
IOError instead and check for errno == errno.EPIPE.

llvm-svn: 370025

5 years agoNFC: clang-format r370008 to suppress lint errors
Vitaly Buka [Tue, 27 Aug 2019 06:59:57 +0000 (06:59 +0000)]
NFC: clang-format r370008 to suppress lint errors

llvm-svn: 370023

5 years agoRevert "[clangd] Release notes" (wrong branch)
Sam McCall [Tue, 27 Aug 2019 06:58:05 +0000 (06:58 +0000)]
Revert "[clangd] Release notes" (wrong branch)

This reverts commit 51029e5c153bd33efa015e2ec35b60247d046ce4.

llvm-svn: 370022

5 years agoRelax test introduced in D65322
Alexander Richardson [Tue, 27 Aug 2019 06:50:36 +0000 (06:50 +0000)]
Relax test introduced in D65322

It is possible that addr2line returns a valid function and file name for
the passed address on some build configuations.
The test is only checking that asan_symbolize doesn't assert any more when
passed a valid file with an invalid address so there is no need to check
that it can't find a valid function name.
This should fix http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux

llvm-svn: 370021

5 years agoFix TestStdCXXDisassembly.py
Pavel Labath [Tue, 27 Aug 2019 06:43:45 +0000 (06:43 +0000)]
Fix TestStdCXXDisassembly.py

missing decorator import.

llvm-svn: 370020

5 years agoCommandObjectExpression: Fix a misleading-indentation warning
Pavel Labath [Tue, 27 Aug 2019 06:42:42 +0000 (06:42 +0000)]
CommandObjectExpression: Fix a misleading-indentation warning

llvm-svn: 370019

5 years ago[SelectionDAGBuilder] Hide existence of ConstantDataVector vector from visitGetElemen...
Craig Topper [Tue, 27 Aug 2019 06:39:50 +0000 (06:39 +0000)]
[SelectionDAGBuilder] Hide existence of ConstantDataVector vector from visitGetElementPtr.

ConstantDataVector is a specialized verison of ConstantVector
that stores data in a packed array of bits instead of as
individual pointers to other Constants. But we really shouldn't
expose that if we can void it. And we should handle regular
ConstantVector equally well.

This removes a dyn_cast to ConstantDataVector and just calls
getSplatValue directly on a Constant* if the type is a vector.

llvm-svn: 370018

5 years ago[SelectionDAGBuilder] Fix typo in comment. NFC
Craig Topper [Tue, 27 Aug 2019 06:38:51 +0000 (06:38 +0000)]
[SelectionDAGBuilder] Fix typo in comment. NFC

llvm-svn: 370017

5 years ago[ValueTracking] Add AllowNonInbounds parameter to GetPointerBaseWithConstantOffset...
Hideto Ueno [Tue, 27 Aug 2019 06:30:33 +0000 (06:30 +0000)]
[ValueTracking] Add AllowNonInbounds parameter to GetPointerBaseWithConstantOffset function

This commit was part of D65402.

llvm-svn: 370016

5 years ago[Attributor] Clamp operator to extend known state
Hideto Ueno [Tue, 27 Aug 2019 06:02:56 +0000 (06:02 +0000)]
[Attributor] Clamp operator to extend known state

Summary:
Similar to `^=` operator for IntegerState, this patch introduces a `+=` operator to "clamp" known information.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 370015

5 years ago[Attributor] Introduce an API to delete stuff
Johannes Doerfert [Tue, 27 Aug 2019 04:57:54 +0000 (04:57 +0000)]
[Attributor] Introduce an API to delete stuff

Summary:
During the fixpoint iteration, including the manifest stage, we should
not delete stuff as other abstract attributes might have a reference to
the value. Through the API this can now be done safely at the very end.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 370014

5 years ago[NFC] Replace the FIXME I added in rL369989 with a comment clarifying the current...
Philip Reames [Tue, 27 Aug 2019 04:52:35 +0000 (04:52 +0000)]
[NFC] Replace the FIXME I added in rL369989 with a comment clarifying the current code

The current approach is restrictive (as all of geps must be multiples of the alignment), but correct.

llvm-svn: 370013

5 years ago[lld][WebAssembly] Create optional symbols after handling --export/--undefined
Sam Clegg [Tue, 27 Aug 2019 04:27:57 +0000 (04:27 +0000)]
[lld][WebAssembly] Create optional symbols after handling --export/--undefined

Handling of --export/--undefined can pull in lazy symbols which in turn
can pull in referenced to optional symbols.  We need to delay the
creation of optional symbols until all possible references to them have
been created.

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

llvm-svn: 370012

5 years agoFix buildbot
David Carlier [Tue, 27 Aug 2019 04:24:19 +0000 (04:24 +0000)]
Fix buildbot

llvm-svn: 370011

5 years ago[lld][WebAssembly] Store table base in config rather than passing it around. NFC.
Sam Clegg [Tue, 27 Aug 2019 04:19:34 +0000 (04:19 +0000)]
[lld][WebAssembly] Store table base in config rather than passing it around. NFC.

I've got another change that makes more use of this value in other
places.

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

llvm-svn: 370010

5 years ago[Sanitizer] Using huge page on FreeBSD for shadow mapping
David Carlier [Tue, 27 Aug 2019 04:02:19 +0000 (04:02 +0000)]
[Sanitizer] Using huge page on FreeBSD for shadow mapping

- Unless explicit configuration, using FreeBSD super pages feature for shadow mapping.
- asan only for now.

Reviewers: dim, emaste, vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 370008

5 years ago[sanitizer] Add lld into dependency of sanitizer_common unittests
Vitaly Buka [Tue, 27 Aug 2019 02:06:34 +0000 (02:06 +0000)]
[sanitizer] Add lld into dependency of sanitizer_common unittests

llvm-svn: 370007

5 years agoRevert r369927 - [DAGCombiner] Remove a bunch of redundant AddToWorklist calls.
Richard Trieu [Tue, 27 Aug 2019 02:04:11 +0000 (02:04 +0000)]
Revert r369927 - [DAGCombiner] Remove a bunch of redundant AddToWorklist calls.

This change causes instrumented builds of Clang to have a fatal error in the
backend.  https://reviews.llvm.org/D66537 has the details.

llvm-svn: 370006

5 years ago[WinEH] Allocate space in funclets stack to save XMM CSRs
Pengfei Wang [Tue, 27 Aug 2019 01:53:24 +0000 (01:53 +0000)]
[WinEH] Allocate space in funclets stack to save XMM CSRs

Summary:
This is an alternate approach to D63396

Currently funclets reuse the same stack slots that are used in the
parent function for saving callee-saved xmm registers. If the parent
function modifies a callee-saved xmm register before an excpetion is
thrown, the catch handler will overwrite the original saved value.

This patch allocates space in funclets stack for saving callee-saved xmm
registers and uses RSP instead RBP to access memory.

Signed-off-by: Pengfei Wang <pengfei.wang@intel.com>
Reviewers: rnk, RKSimon, craig.topper, annita.zhang, LuoYuanke, andrew.w.kaylor

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

Signed-off-by: Pengfei Wang <pengfei.wang@intel.com>
llvm-svn: 370005

5 years agoFix clangd's IndexAction for FileSkipped API update
Alex Lorenz [Tue, 27 Aug 2019 01:36:00 +0000 (01:36 +0000)]
Fix clangd's IndexAction for FileSkipped API update

llvm-svn: 370004

5 years ago[test] Disable two of the recently (re)enabled tests on Windows.
Jonas Devlieghere [Tue, 27 Aug 2019 01:34:19 +0000 (01:34 +0000)]
[test] Disable two of the recently (re)enabled tests on Windows.

This disables two tests on Windows that I re-enabled in r369995.

llvm-svn: 370003

5 years ago[ConnectionFileDescriptor] Add shutdown check in ::Write.
Jonas Devlieghere [Tue, 27 Aug 2019 01:34:16 +0000 (01:34 +0000)]
[ConnectionFileDescriptor] Add shutdown check in ::Write.

The disconnect method sets the shutdown flag to true. This currently
only prevents any reads from happening, but not writes, which is
incorrect. Presumably this was just an oversight when adding
synchronization to the class. This adds the same shutdown check to the
Write method.

Over-the-shoulder reviewed by Jim!

llvm-svn: 370002

5 years ago[Analysis] In EmitGEPOffset, use Constant::getUniqueInteger to handle struct indices...
Craig Topper [Tue, 27 Aug 2019 01:07:37 +0000 (01:07 +0000)]
[Analysis] In EmitGEPOffset, use Constant::getUniqueInteger to handle struct indices in vector GEPs.

We previously called getSplatValue if the index had a vector type,
but getSplatValue returns null for non-splats. This would cause
a nullptr dereference if it wasn't a splat.

Using getUniqueInteger gives us an assert if its a vector type,
but the value isn't a splat. This is what is used in
SelectionDAGBuilder's code that expands GEPs as well.

llvm-svn: 370001

5 years agoRevert "[clang-scan-deps] Minimizer: Correctly handle multi-line content with CR...
Richard Smith [Tue, 27 Aug 2019 01:06:23 +0000 (01:06 +0000)]
Revert "[clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings"

This reverts commit r369986.

This change added a dependency on the 'dos2unix' tool, which is not one
of our accepted test dependencies and may not exist on all machines that
build Clang.

llvm-svn: 370000

5 years agoDon't lose the FoundDecl and template arguments for a DeclRefExpr in
Richard Smith [Tue, 27 Aug 2019 01:06:21 +0000 (01:06 +0000)]
Don't lose the FoundDecl and template arguments for a DeclRefExpr in
TreeTransform.

llvm-svn: 369999

5 years agoUse FileEntryRef for PPCallbacks::FileSkipped
Alex Lorenz [Tue, 27 Aug 2019 01:03:25 +0000 (01:03 +0000)]
Use FileEntryRef for PPCallbacks::FileSkipped

This fixes the issue where a filename dependendency was missing if the file that
was skipped was included through a symlink in an earlier run, if the file
manager was reused between runs.

llvm-svn: 369998

5 years ago[MemorySSA] Fix insertUse.
Alina Sbirlea [Tue, 27 Aug 2019 00:34:47 +0000 (00:34 +0000)]
[MemorySSA] Fix insertUse.

Actually call the renamePass on inserted Phis.
Fixes PR42940.

Subscribers: llvm-commits
llvm-svn: 369997