platform/upstream/llvm.git
6 years ago[AArch64] Fix a few InstRWs in the A53 scheduler model and enable FullInstRWOverlapCheck.
Craig Topper [Sun, 18 Mar 2018 22:16:53 +0000 (22:16 +0000)]
[AArch64] Fix a few InstRWs in the A53 scheduler model and enable FullInstRWOverlapCheck.

This fixes the errors found by the new check added in r327808.

llvm-svn: 327812

6 years ago[SelectionDAG] Don't default the SelectionDAG* parameter to SDValue::dump to nullptr...
Craig Topper [Sun, 18 Mar 2018 21:28:11 +0000 (21:28 +0000)]
[SelectionDAG] Don't default the SelectionDAG* parameter to SDValue::dump to nullptr. Use two different signatures instead.

This matches what we do in SDNode.

This should allow SDValue::dump to be used in the debugger without getting an error if you don't pass an argument.

llvm-svn: 327811

6 years agoMove the codebase to use: DWARFCompileUnit -> DWARFUnit
Jan Kratochvil [Sun, 18 Mar 2018 20:11:02 +0000 (20:11 +0000)]
Move the codebase to use: DWARFCompileUnit -> DWARFUnit

Now the codebase can use the DWARFUnit superclass. It will make it later
seamlessly work also with DWARFPartialUnit for DWZ.

This patch is only a search-and-replace easily undone, nothing interesting
in it.

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

llvm-svn: 327810

6 years agoDWARFUnit split out of DWARFCompileUnit
Jan Kratochvil [Sun, 18 Mar 2018 20:09:02 +0000 (20:09 +0000)]
DWARFUnit split out of DWARFCompileUnit

DW_TAG_partial_unit for DWZ can be then presented by DWARFPartialUnit also
inherited from DWARFUnit.

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

llvm-svn: 327809

6 years ago[TableGen] When trying to reuse a scheduler class for instructions from an InstRW...
Craig Topper [Sun, 18 Mar 2018 19:56:15 +0000 (19:56 +0000)]
[TableGen] When trying to reuse a scheduler class for instructions from an InstRW, make sure we haven't already seen another InstRW containing this instruction on this CPU.

This is similar to the check later when we remap some of the instructions from one class to a new one. But if we reuse the class we don't get to do that check.

So many CPUs have violations of this check that I had to add a flag to the SchedMachineModel to allow it to be disabled. Hopefully we can get those cleaned up quickly and remove this flag.

A lot of the violations are due to overlapping regular expressions, but that's not the only kind of issue it found.

llvm-svn: 327808

6 years ago[X86][Btver2] Fix crc32 schedule costs
Simon Pilgrim [Sun, 18 Mar 2018 19:54:42 +0000 (19:54 +0000)]
[X86][Btver2] Fix crc32 schedule costs

The default is currently FAdd for some reason

llvm-svn: 327807

6 years agoUpdated C++2a status with changes from Jacksonville WG21 meeting
Marshall Clow [Sun, 18 Mar 2018 19:29:21 +0000 (19:29 +0000)]
Updated C++2a status with changes from Jacksonville WG21 meeting

llvm-svn: 327806

6 years ago[X86][Btver2] Add crc32 resource tests
Simon Pilgrim [Sun, 18 Mar 2018 18:55:34 +0000 (18:55 +0000)]
[X86][Btver2] Add crc32 resource tests

llvm-svn: 327805

6 years ago[X86][Btver2] FADD/FHADD ymm instructions are double pumped on the JFPA functional...
Simon Pilgrim [Sun, 18 Mar 2018 18:45:57 +0000 (18:45 +0000)]
[X86][Btver2] FADD/FHADD ymm instructions are double pumped on the JFPA functional pipe

llvm-svn: 327804

6 years ago[X86][Btver2] Float bitwise ymm instructions are double pumped on the JFPX (JFPA...
Simon Pilgrim [Sun, 18 Mar 2018 17:10:12 +0000 (17:10 +0000)]
[X86][Btver2] Float bitwise ymm instructions are double pumped on the JFPX (JFPA/JFPM) functional pipes

llvm-svn: 327803

6 years agoResolve unused variable 'VR' warning in RetainCountChecker.cpp
Bjorn Pettersson [Sun, 18 Mar 2018 16:07:20 +0000 (16:07 +0000)]
Resolve unused variable 'VR' warning in RetainCountChecker.cpp

Getting rid of
  error: unused variable 'VR' [-Werror,-Wunused-variable]
warning/error at
  lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:1933

llvm-svn: 327802

6 years ago[X86][Btver2] F16C instructions are performed on the JSTC functional pipe
Simon Pilgrim [Sun, 18 Mar 2018 15:59:51 +0000 (15:59 +0000)]
[X86][Btver2] F16C instructions are performed on the JSTC functional pipe

llvm-svn: 327801

6 years ago[LICM] Salvage DI from dying Instructions
Anastasis Grammenos [Sun, 18 Mar 2018 15:59:19 +0000 (15:59 +0000)]
[LICM] Salvage DI from dying Instructions

LICM deletes trivially dead instructions which it won't attempt to sink.
Attempt to salvage debug values which reference these instructions.

llvm-svn: 327800

6 years ago[InstCombine] peek through unsigned FP casts for zero-equality compares (PR36682)
Roman Lebedev [Sun, 18 Mar 2018 15:53:02 +0000 (15:53 +0000)]
[InstCombine] peek through unsigned FP casts for zero-equality compares (PR36682)

Summary:
This pattern came up in PR36682 / D44390
https://bugs.llvm.org/show_bug.cgi?id=36682
https://reviews.llvm.org/D44390
https://godbolt.org/g/oKvT5H

See also D44416

Reviewers: spatel, majnemer, efriedma, arsenm

Reviewed By: spatel

Subscribers: wdng, llvm-commits

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

llvm-svn: 327799

6 years ago[llvm-mca] Allow the definition of multiple register files.
Andrea Di Biagio [Sun, 18 Mar 2018 15:33:27 +0000 (15:33 +0000)]
[llvm-mca] Allow the definition of multiple register files.

This is a refactoring in preparation for other two changes that will allow
scheduling models to define multiple register files. This is the first step
towards fixing PR36662.

class RegisterFile (in Dispatch.h) now can emulate multiple register files.
Internally, it tracks the number of available physical registers in each
register file (described by class RegisterFileInfo).

Each register file is associated to a list of MCRegisterClass indices. Knowing
the register class indices allows to map physical registers to register files.

The long term goal is to allow processor models to optionally specify how many
register files are implemented via tablegen.

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

llvm-svn: 327798

6 years ago[InstCombine] add nnan requirement for sqrt(x) * sqrt(y) -> sqrt(x*y)
Sanjay Patel [Sun, 18 Mar 2018 14:32:54 +0000 (14:32 +0000)]
[InstCombine] add nnan requirement for sqrt(x) * sqrt(y) -> sqrt(x*y)

This is similar to D43765.

llvm-svn: 327797

6 years ago[InstSimplify] loosen FMF for sqrt(X) * sqrt(X) --> X
Sanjay Patel [Sun, 18 Mar 2018 14:12:25 +0000 (14:12 +0000)]
[InstSimplify] loosen FMF for sqrt(X) * sqrt(X) --> X

As shown in the code comment, we don't need all of 'fast',
but we do need reassoc + nsz + nnan.

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

llvm-svn: 327796

6 years ago[X86][Btver2] Strip default latency/resource values. NFCI.
Simon Pilgrim [Sun, 18 Mar 2018 13:16:11 +0000 (13:16 +0000)]
[X86][Btver2] Strip default latency/resource values. NFCI.

llvm-svn: 327795

6 years ago[X86][Btver2] SSE4A EXTRQ/INSERTQ instructions are performed on the JVALU0/JVALU1...
Simon Pilgrim [Sun, 18 Mar 2018 13:05:09 +0000 (13:05 +0000)]
[X86][Btver2] SSE4A EXTRQ/INSERTQ instructions are performed on the JVALU0/JVALU1 functional pipes

llvm-svn: 327794

6 years ago[X86][Btver2] Modelled float bitwise instructions as being performed on the float...
Simon Pilgrim [Sun, 18 Mar 2018 12:37:35 +0000 (12:37 +0000)]
[X86][Btver2] Modelled float bitwise instructions as being performed on the float cluster (FPA/FPM) not the integer.

llvm-svn: 327793

6 years ago[dsymutil] Fix add_llvm_tool_symlink
Jonas Devlieghere [Sun, 18 Mar 2018 12:27:05 +0000 (12:27 +0000)]
[dsymutil] Fix add_llvm_tool_symlink

Update the arguments to add_llvm_tool_symlink to symlink llvm-dsymutil
to dsymutil.

llvm-svn: 327792

6 years ago[X86][Btver2] Correctly distinguish between scheduling pipe and functional unit for...
Simon Pilgrim [Sun, 18 Mar 2018 12:09:17 +0000 (12:09 +0000)]
[X86][Btver2] Correctly distinguish between scheduling pipe and functional unit for JWriteResFpuPair defs

Jaguar's FPU has 2 scheduler pipes (JFPU0/JFPU1) which forward to multiple functional sub-units each. We need to model that an micro-op will both consume the scheduler pipe and a functional unit.

This patch just handles the ops defined through JWriteResFpuPair, I'll go through the custom cases later.

llvm-svn: 327791

6 years ago[dsymutil] Rename llvm-dsymutil -> dsymutil
Jonas Devlieghere [Sun, 18 Mar 2018 11:38:41 +0000 (11:38 +0000)]
[dsymutil] Rename llvm-dsymutil -> dsymutil

Now that almost all functionality of Apple's dsymutil has been
upstreamed, the open source variant can be used as a drop in
replacement. Hence we feel it's no longer necessary to have the llvm
prefix.

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

llvm-svn: 327790

6 years ago[X86][Btver2] Merge equivalent VBLENDVY + VPERMILY schedule groups
Simon Pilgrim [Sun, 18 Mar 2018 10:22:35 +0000 (10:22 +0000)]
[X86][Btver2] Merge equivalent VBLENDVY + VPERMILY schedule groups

Thanks to Craig Topper for noticing this.

llvm-svn: 327789

6 years ago[X86][Btver2] Add llvm-mca tests to show pipe resource usage of most vector instructions
Simon Pilgrim [Sun, 18 Mar 2018 09:32:38 +0000 (09:32 +0000)]
[X86][Btver2] Add llvm-mca tests to show pipe resource usage of most vector instructions

Hopefully these tests can be easily reused should any other subtarget get in depth llvm-mca coverage (we can either copy the tests or move them into a common dir and run it with multiple prefixes).

llvm-svn: 327788

6 years ago[X86] Fix a bunch of overlapping regular expressions in the scheduler models.
Craig Topper [Sun, 18 Mar 2018 08:38:06 +0000 (08:38 +0000)]
[X86] Fix a bunch of overlapping regular expressions in the scheduler models.

llvm-svn: 327787

6 years ago[X86] Fix a couple typos in the Zen scheduler model.
Craig Topper [Sun, 18 Mar 2018 08:38:04 +0000 (08:38 +0000)]
[X86] Fix a couple typos in the Zen scheduler model.

llvm-svn: 327786

6 years ago[TableGen] Remove unnecessary uses of make_range.
Craig Topper [Sun, 18 Mar 2018 08:38:03 +0000 (08:38 +0000)]
[TableGen] Remove unnecessary uses of make_range.

llvm-svn: 327785

6 years ago[TableGen] Move some variables into for loop declaration. NFC
Craig Topper [Sun, 18 Mar 2018 08:38:02 +0000 (08:38 +0000)]
[TableGen] Move some variables into for loop declaration. NFC

They aren't needed after the loop.

llvm-svn: 327784

6 years ago[X86] Remove MMX_MASKMOVQ64 and VMASKMOVDQU from scheduler models.
Craig Topper [Sun, 18 Mar 2018 03:24:42 +0000 (03:24 +0000)]
[X86] Remove MMX_MASKMOVQ64 and VMASKMOVDQU from scheduler models.

The information was so wildly inaccurate and incomplete its better to just remove it.

MMX_MASKMOVQ64 showed up twice in several scheduler models. In Haswell and Broadwell they were on adjacent lines. On Skylake the copies had different information.

MMX_MASKMOVQ and MASKMOVDQU were completely missing.

MMX_MASKMOVQ64 was listed on Haswell/Broadwell as 1 cycle on port 1 despite it being a store instruction.

Filed PR36780 to track fixing this right.

llvm-svn: 327783

6 years ago[C++17] Allow an empty expression in an if init statement
Zhihao Yuan [Sat, 17 Mar 2018 21:42:10 +0000 (21:42 +0000)]
[C++17] Allow an empty expression in an if init statement

Summary:
This fixes [PR35381](https://llvm.org/pr35381) and an additional bug where clang didn't warn about the C++17 extension when having an expression in the init statement.

Thanks Nicolas Lesser for contributing the patch.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: erik.pilkington, cfe-commits

Tags: #clang

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

llvm-svn: 327782

6 years agoImplement DR2229, which prohibits unnamed bit-fields from having qualifiers in C++.
Aaron Ballman [Sat, 17 Mar 2018 21:08:40 +0000 (21:08 +0000)]
Implement DR2229, which prohibits unnamed bit-fields from having qualifiers in C++.

llvm-svn: 327781

6 years agoFix codegen for structured binding binding in conditions
Zhihao Yuan [Sat, 17 Mar 2018 21:01:27 +0000 (21:01 +0000)]
Fix codegen for structured binding binding in conditions

Summary:
The codegen for conditions assumes that a normal variable declaration is used in a condition, but this is not the case when a structured binding is used.

This fixes [PR36747](http://llvm.org/pr36747).

Thanks Nicolas Lesser for contributing the patch.

Reviewers: lichray, rsmith

Reviewed By: lichray

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 327780

6 years ago[AArch64] Skip an unnecessary getCopyToReg in DYNAMIC_STACKALLOC
Martin Storsjo [Sat, 17 Mar 2018 20:08:48 +0000 (20:08 +0000)]
[AArch64] Skip an unnecessary getCopyToReg in DYNAMIC_STACKALLOC

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

llvm-svn: 327779

6 years agoRevert "[DAG, X86] Revert r327197 "Revert r327170, r327171, r327172""
Nirav Dave [Sat, 17 Mar 2018 19:24:54 +0000 (19:24 +0000)]
Revert "[DAG, X86] Revert r327197 "Revert r327170, r327171, r327172""

as it times out building test-suite on PPC.

llvm-svn: 327778

6 years ago[DAG, X86] Revert r327197 "Revert r327170, r327171, r327172"
Nirav Dave [Sat, 17 Mar 2018 17:42:10 +0000 (17:42 +0000)]
[DAG, X86] Revert r327197 "Revert r327170, r327171, r327172"

Reland ISel cycle checking improvements after simplifying and reducing
node id invariant traversal.

llvm-svn: 327777

6 years agoFix some user facing typos
Sylvestre Ledru [Sat, 17 Mar 2018 17:30:08 +0000 (17:30 +0000)]
Fix some user facing typos

llvm-svn: 327776

6 years ago[Driver] Fix the descriptions for -Tdata and -Ttext options
Aaron Smith [Sat, 17 Mar 2018 15:24:35 +0000 (15:24 +0000)]
[Driver] Fix the descriptions for -Tdata and -Ttext options

Reviewers: llvm-commits

Subscribers: cfe-commits

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

llvm-svn: 327775

6 years agoAMDGPU/GlobalISel: Cleanup constant legality
Matt Arsenault [Sat, 17 Mar 2018 15:17:48 +0000 (15:17 +0000)]
AMDGPU/GlobalISel: Cleanup constant legality

llvm-svn: 327774

6 years agoAMDGPU/GlobalISel: Basic G_GEP legality
Matt Arsenault [Sat, 17 Mar 2018 15:17:45 +0000 (15:17 +0000)]
AMDGPU/GlobalISel: Basic G_GEP legality

llvm-svn: 327773

6 years agoAMDGPU/GlobalISel: Basic legality for load/store
Matt Arsenault [Sat, 17 Mar 2018 15:17:41 +0000 (15:17 +0000)]
AMDGPU/GlobalISel: Basic legality for load/store

llvm-svn: 327772

6 years ago[bindings/go] Add a missing `,` in the test code to fix a go compile
Chandler Carruth [Sat, 17 Mar 2018 15:12:52 +0000 (15:12 +0000)]
[bindings/go] Add a missing `,` in the test code to fix a go compile
failure.

llvm-svn: 327771

6 years ago[cxx_status] Add entry for the Reflection TS.
Richard Smith [Sat, 17 Mar 2018 14:34:21 +0000 (14:34 +0000)]
[cxx_status] Add entry for the Reflection TS.

llvm-svn: 327770

6 years ago[cxx_status] Update to match Jacksonville 2018 motions.
Richard Smith [Sat, 17 Mar 2018 14:28:47 +0000 (14:28 +0000)]
[cxx_status] Update to match Jacksonville 2018 motions.

Also rearrange how we list DR motions: rather than listing them as part of some
later standard, list them against the feature they are a DR against. Explicitly
add a description of how we handle DRs.

llvm-svn: 327769

6 years agoAdding nocf_check attribute for cf-protection fine tuning
Oren Ben Simhon [Sat, 17 Mar 2018 13:31:35 +0000 (13:31 +0000)]
Adding nocf_check attribute for cf-protection fine tuning

The patch adds nocf_check target independent attribute for disabling checks that were enabled by cf-protection flag.
The attribute can be appertained to functions and function pointers.
Attribute name follows GCC's similar attribute name.

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

llvm-svn: 327768

6 years ago[X86] Added support for nocf_check attribute for indirect Branch Tracking
Oren Ben Simhon [Sat, 17 Mar 2018 13:29:46 +0000 (13:29 +0000)]
[X86] Added support for nocf_check attribute for indirect Branch Tracking

X86 Supports Indirect Branch Tracking (IBT) as part of Control-Flow Enforcement Technology (CET).
IBT instruments ENDBR instructions used to specify valid targets of indirect call / jmp.
The `nocf_check` attribute has two roles in the context of X86 IBT technology:
1. Appertains to a function - do not add ENDBR instruction at the beginning of the function.
2. Appertains to a function pointer - do not track the target function of this pointer by adding nocf_check prefix to the indirect-call instruction.

This patch implements `nocf_check` context for Indirect Branch Tracking.
It also auto generates `nocf_check` prefixes before indirect branchs to jump tables that are guarded by range checks.

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

llvm-svn: 327767

6 years ago[SystemZ] Add 'REQUIRES: asserts' to test case using debug output.
Jonas Paulsson [Sat, 17 Mar 2018 09:15:13 +0000 (09:15 +0000)]
[SystemZ]  Add 'REQUIRES: asserts' to test case using debug output.

llvm-svn: 327766

6 years ago[SystemZ] computeKnownBitsForTargetNode() / ComputeNumSignBitsForTargetNode()
Jonas Paulsson [Sat, 17 Mar 2018 08:32:12 +0000 (08:32 +0000)]
[SystemZ]  computeKnownBitsForTargetNode() / ComputeNumSignBitsForTargetNode()

Improve/implement these methods to improve DAG combining. This mainly
concerns intrinsics.

Some constant operands to SystemZISD nodes have been marked Opaque to avoid
transforming back and forth between generic and target nodes infinitely.

Review: Ulrich Weigand
llvm-svn: 327765

6 years ago[SelectionDAG] Handle big endian target BITCAST in computeKnownBits()
Jonas Paulsson [Sat, 17 Mar 2018 08:04:00 +0000 (08:04 +0000)]
[SelectionDAG]  Handle big endian target BITCAST in computeKnownBits()

The BITCAST handling in computeKnownBits() previously only worked for little
endian.

This patch reverses the iteration over elements for a big endian target which
allows this to work in this case also.

SystemZ test case.

Review: Eli Friedman
https://reviews.llvm.org/D44249

llvm-svn: 327764

6 years agoBugfix, extern declarations for libomp functions are `extern "C"` declarations
George Rokos [Sat, 17 Mar 2018 02:07:42 +0000 (02:07 +0000)]
Bugfix, extern declarations for libomp functions are `extern "C"` declarations

llvm-svn: 327763

6 years agoRevert "Mmap interceptor new option, Write Exec runtime detector"
Vitaly Buka [Sat, 17 Mar 2018 00:31:41 +0000 (00:31 +0000)]
Revert "Mmap interceptor new option, Write Exec runtime detector"

Breaks Android bot.

This reverts commit r327747.

llvm-svn: 327762

6 years ago[GlobalsAA] Fix a pretty terrible bug that has been in GlobalsAA for
Chandler Carruth [Fri, 16 Mar 2018 23:51:33 +0000 (23:51 +0000)]
[GlobalsAA] Fix a pretty terrible bug that has been in GlobalsAA for
a long time.

The key thing is that we need to create value handles for every function
that we create a `FunctionInfo` object around. Without this, when that
function is deleted we can end up creating a new function that collides
with its address and look up a stale AA result. With that AA result we
can in turn miscompile code in ways that break.

This is seriously one of the most absurd miscompiles I've seen. It only
reproduced for us recently and only when building a very large server
with both ThinLTO and PGO.

A *HUGE* shout out to Wei Mi who tracked all of this down and came up
with this patch. I'm just landing it because I happened to still by at
a computer.

He or I can work on crafting a test case to hit this (now that we know
what to target) but it'll take a while, and we've been chasing this for
a long time and need it fix Right Now.

llvm-svn: 327761

6 years ago[MachineOutliner] Make KILLs invisible
Jessica Paquette [Fri, 16 Mar 2018 22:53:34 +0000 (22:53 +0000)]
[MachineOutliner] Make KILLs invisible

At the point the outliner runs, KILLs don't impact anything, but they're still
considered unique instructions. This commit makes them invisible like
DebugValues so that they can still be outlined without impacting outlining
decisions.

llvm-svn: 327760

6 years ago[Fuzzer] Build the shared memory hooks for Fuchsia
Petr Hosek [Fri, 16 Mar 2018 22:40:55 +0000 (22:40 +0000)]
[Fuzzer] Build the shared memory hooks for Fuchsia

This is needed otherwise we'll get undefined references when trying
to use the libFuzzer built for Fuchsia.

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

llvm-svn: 327759

6 years agoOpenBSD UBsan support final missing bits
Vitaly Buka [Fri, 16 Mar 2018 22:29:29 +0000 (22:29 +0000)]
OpenBSD UBsan support final missing bits

Summary:
One forgotten file change + reordering one header due to clang-format

Patch by David CARLIER

Reviewers: vitalybuka, vsk

Subscribers: kubamracek, fedor.sergeev, llvm-commits, #sanitizers

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

llvm-svn: 327758

6 years ago[llvm-mca] Remove method getSchedModel() from the Backend.
Andrea Di Biagio [Fri, 16 Mar 2018 22:21:52 +0000 (22:21 +0000)]
[llvm-mca] Remove method getSchedModel() from the Backend.

llvm-svn: 327756

6 years ago[MS] Fix bug in r327732 with devirtualized complete destructor calls
Reid Kleckner [Fri, 16 Mar 2018 22:20:57 +0000 (22:20 +0000)]
[MS] Fix bug in r327732 with devirtualized complete destructor calls

llvm-svn: 327754

6 years agoFix the Windows build after r327750
Frederic Riss [Fri, 16 Mar 2018 22:19:58 +0000 (22:19 +0000)]
Fix the Windows build after r327750

llvm-svn: 327753

6 years ago[asan] Replace vfork with fork.
Evgeniy Stepanov [Fri, 16 Mar 2018 22:15:05 +0000 (22:15 +0000)]
[asan] Replace vfork with fork.

Summary:
vfork is not ASan-friendly because it modifies stack shadow in the
parent process address space. While it is possible to compensate for that with, for example,
__asan_handle_no_return before each call to _exit or execve and friends, simply replacing
vfork with fork looks like by far the easiest solution.

Posix compliant programs can not detect the difference between vfork and fork.

Fixes https://github.com/google/sanitizers/issues/925

Reviewers: kcc, vitalybuka

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 327752

6 years ago[DWARFASTParserClang] Complete external record types before using them as a decl...
Frederic Riss [Fri, 16 Mar 2018 22:12:22 +0000 (22:12 +0000)]
[DWARFASTParserClang] Complete external record types before using them as a decl context.

Summary:
When in a gmodules-like debugging scenario, you can have a parent decl context
that gets imported from an external AST. When this happens, we must be careful
to complete this type before adding children to it, otherwise it sometimes
results in a crash.

Reviewers: clayborg, jingham

Subscribers: aprantl, JDevlieghere, lldb-commits

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

llvm-svn: 327750

6 years ago[llvm-mca] Remove unused methods from Backend. NFC
Andrea Di Biagio [Fri, 16 Mar 2018 22:02:47 +0000 (22:02 +0000)]
[llvm-mca] Remove unused methods from Backend. NFC

llvm-svn: 327749

6 years ago[asan] Remove empty fork interceptor.
Evgeniy Stepanov [Fri, 16 Mar 2018 21:31:49 +0000 (21:31 +0000)]
[asan] Remove empty fork interceptor.

After a partial revert, ASan somehow ended up with an empty interceptor for fork().

llvm-svn: 327748

6 years agoMmap interceptor new option, Write Exec runtime detector
Vitaly Buka [Fri, 16 Mar 2018 21:25:09 +0000 (21:25 +0000)]
Mmap interceptor new option, Write Exec runtime detector

Summary: Following-up the refactoring of mmap interceptors, adding a new common option to detect PROT_WRITE|PROT_EXEC pages request.

Patch by David CARLIER

Reviewers: vitalybuka, vsk

Reviewed By: vitalybuka

Subscribers: krytarowski, #sanitizers

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

llvm-svn: 327747

6 years ago[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Fri, 16 Mar 2018 21:22:42 +0000 (21:22 +0000)]
[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 327746

6 years agoQuiet unused variable warnings. NFC.
David L Kreitzer [Fri, 16 Mar 2018 21:21:23 +0000 (21:21 +0000)]
Quiet unused variable warnings. NFC.

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

llvm-svn: 327745

6 years ago[X86] Pass SelectionDAG into X86ISelAddressMode::dump and on to SDNode::dump.
Craig Topper [Fri, 16 Mar 2018 21:10:07 +0000 (21:10 +0000)]
[X86] Pass SelectionDAG into X86ISelAddressMode::dump and on to SDNode::dump.

This prevents a crash in SelectionDAGDumper with -debug when trying to print mem operands if one of the registers in the addressing mode comes from a load.

llvm-svn: 327744

6 years ago[InstSimplify] add NaN constant diversity; NFC
Sanjay Patel [Fri, 16 Mar 2018 20:55:55 +0000 (20:55 +0000)]
[InstSimplify] add NaN constant diversity; NFC

llvm-svn: 327743

6 years ago[Hexagon] Avoid bank conflicts in post-RA scheduler
Krzysztof Parzyszek [Fri, 16 Mar 2018 20:55:49 +0000 (20:55 +0000)]
[Hexagon] Avoid bank conflicts in post-RA scheduler

Avoid scheduling two loads in such a way that they would end up in the
same packet. If there is a load in a packet, try to schedule a non-load
next.

Patch by Brendon Cahoon.

llvm-svn: 327742

6 years ago[MS] Fix tests after r327738 that only fail with a default Windows target
Reid Kleckner [Fri, 16 Mar 2018 20:53:13 +0000 (20:53 +0000)]
[MS] Fix tests after r327738 that only fail with a default Windows target

llvm-svn: 327741

6 years agoMoved extern declarations to private header file, they are only used from within...
George Rokos [Fri, 16 Mar 2018 20:40:09 +0000 (20:40 +0000)]
Moved extern declarations to private header file, they are only used from within libomptarget, they don't need to be in omptarget.h.

llvm-svn: 327740

6 years ago[MS] Commit some changes that were intended to be part of r327738
Reid Kleckner [Fri, 16 Mar 2018 20:37:59 +0000 (20:37 +0000)]
[MS] Commit some changes that were intended to be part of r327738

llvm-svn: 327739

6 years ago[MS] Don't escape MS C++ names with \01
Reid Kleckner [Fri, 16 Mar 2018 20:36:49 +0000 (20:36 +0000)]
[MS] Don't escape MS C++ names with \01

It is not needed after LLVM r327734. Now it will be easier to copy-paste
IR symbol names from Clang.

llvm-svn: 327738

6 years ago[Hexagon] Add lit testcases for atomic intrinsics
Krzysztof Parzyszek [Fri, 16 Mar 2018 20:21:43 +0000 (20:21 +0000)]
[Hexagon] Add lit testcases for atomic intrinsics

Patch by Ben Craig.

llvm-svn: 327737

6 years ago[COFF] Clarify comment. NFC
Shoaib Meenai [Fri, 16 Mar 2018 20:20:01 +0000 (20:20 +0000)]
[COFF] Clarify comment. NFC

Reid pointed out the string table for supporting long section names is a
BFD extension and the comments should reflect that. Explicitly spell out
link.exe's and binutil's behavior around section names and the rationale
for LLD's behavior.

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

llvm-svn: 327736

6 years ago[Parser] Remove hard-coded bracket depth limit
Jan Korous [Fri, 16 Mar 2018 20:17:28 +0000 (20:17 +0000)]
[Parser] Remove hard-coded bracket depth limit

The diagnostics produced if assert fails are using proper limit from language definition already.

llvm-svn: 327735

6 years ago[IR] Avoid the need to prefix MS C++ symbols with '\01'
Reid Kleckner [Fri, 16 Mar 2018 20:13:32 +0000 (20:13 +0000)]
[IR] Avoid the need to prefix MS C++ symbols with '\01'

Now the Windows mangling modes ('w' and 'x') do not do any mangling for
symbols starting with '?'. This means that clang can stop adding the
hideous '\01' leading escape. This means LLVM debug logs are less likely
to contain ASCII escape characters and it will be easier to copy and
paste MS symbol names from IR.

Finally.

For non-Windows platforms, names starting with '?' still get IR
mangling, so once clang stops escaping MS C++ names, we will get extra
'_' prefixing on MachO. That's fine, since it is currently impossible to
construct a triple that uses the MS C++ ABI in clang and emits macho
object files.

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

llvm-svn: 327734

6 years agoRevert r327721 "This patch fixes the invalid usage of OptSize in Machine Combiner."
Reid Kleckner [Fri, 16 Mar 2018 20:11:55 +0000 (20:11 +0000)]
Revert r327721 "This patch fixes the invalid usage of OptSize in Machine Combiner."

It causes asserts when compiling Chromium on Win32 with optimizations.
We compile many things with -Os.

llvm-svn: 327733

6 years ago[MS] Always use base dtors in place of complete/vbase dtors when possible
Reid Kleckner [Fri, 16 Mar 2018 19:40:50 +0000 (19:40 +0000)]
[MS] Always use base dtors in place of complete/vbase dtors when possible

Summary:
Previously we tried too hard to uphold the fiction that destructor
variants work like they do on Itanium throughout the ABI-neutral parts
of clang. This lead to MS C++ ABI incompatiblities and other bugs. Now,
-mconstructor-aliases will no longer control this ABI detail, and clang
-cc1's LLVM IR output will be this much closer to the clang driver's.

Based on a patch by Zahira Ammarguellat:
  https://reviews.llvm.org/D39063

I've tried to move the logic that Zahira added into MicrosoftCXXABI.cpp.
There is only one ABI-specific detail sticking out, and that is in
CodeGenModule::getAddrOfCXXStructor, where we collapse complete dtors to
base dtors in the MS ABI.

This fixes PR32990.

Reviewers: erichkeane, zahiraam, majnemer, rjmccall

Subscribers: cfe-commits

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

llvm-svn: 327732

6 years agoSkip TestThreadSpecificBpPlusCondition on Darwin due to timeouts
Vedant Kumar [Fri, 16 Mar 2018 19:33:39 +0000 (19:33 +0000)]
Skip TestThreadSpecificBpPlusCondition on Darwin due to timeouts

Bot failure: https://ci.swift.org/job/oss-lldb-incremental-osx/1104/

llvm-svn: 327731

6 years ago[X86] Merge ADDSUB/SUBADD detection into single methods that can detect either and...
Craig Topper [Fri, 16 Mar 2018 18:25:59 +0000 (18:25 +0000)]
[X86] Merge ADDSUB/SUBADD detection into single methods that can detect either and indicate what they found.

Previously, we called the same functions twice with a bool flag determining whether we should look for ADDSUB or SUBADD. It would be more efficient to run the code once and detect either pattern with a flag to tell which type it found.

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

llvm-svn: 327730

6 years agoRemove -gmodules restriction from test
Adrian Prantl [Fri, 16 Mar 2018 18:21:48 +0000 (18:21 +0000)]
Remove -gmodules restriction from test

llvm-svn: 327729

6 years ago[CorrelatedValuePropagation] Use SelectInst::getCondition/getTrueValue/getFalseValue...
Craig Topper [Fri, 16 Mar 2018 18:18:47 +0000 (18:18 +0000)]
[CorrelatedValuePropagation] Use SelectInst::getCondition/getTrueValue/getFalseValue instead of getOperand for readability. NFC

llvm-svn: 327728

6 years ago[analyzer] Fix crashes in RetainCountChecker when underlying region is not a var
George Karpenkov [Fri, 16 Mar 2018 18:16:47 +0000 (18:16 +0000)]
[analyzer] Fix crashes in RetainCountChecker when underlying region is not a var

For other regions, the error message contains a good indication of the
problem, and there, in general, nothing helpful we can print.
Error pointer to the problematic expression seems enough.

rdar://37323555

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

llvm-svn: 327727

6 years ago[AMDGPU] Supported ds_write_b128 generation.
Farhana Aleen [Fri, 16 Mar 2018 18:12:00 +0000 (18:12 +0000)]
[AMDGPU] Supported ds_write_b128 generation.

Summary: This is a follow-on patch of https://reviews.llvm.org/D44210

Author: FarhanaAleen

Reviewed By: msearles

Subscribers: llvm-commits, AMDGPU

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

llvm-svn: 327726

6 years ago[docs] ReleaseNotes: document -Wextra-semi changes.
Roman Lebedev [Fri, 16 Mar 2018 18:01:07 +0000 (18:01 +0000)]
[docs] ReleaseNotes: document -Wextra-semi changes.

I should have done it in rL327558 / D43162, but forgot..

I'm not 100% sure about the text, but i don't think
it warrants a whole new differential revision.

llvm-svn: 327725

6 years ago[X86] Post process the DAG after isel to remove vector moves that were added to zero...
Craig Topper [Fri, 16 Mar 2018 17:13:42 +0000 (17:13 +0000)]
[X86] Post process the DAG after isel to remove vector moves that were added to zero upper bits.

We previously avoided inserting these moves during isel in a few cases which is implemented using a whitelist of opcodes. But it's too difficult to generate a perfect list of opcodes to whitelist. Especially with AVX512F without AVX512VL using 512 bit vectors to implement some 128/256 bit operations. Since isel is done bottoms up, we'd have to check the VT and opcode and subtarget in order to determine whether an EXTRACT_SUBREG would be generated for some operations.

So instead of doing that, this patch adds a post processing step that detects when the moves are unnecesssary after isel. At that point any EXTRACT_SUBREGs would have already been created and appear in the DAG. So then we just need to ensure the input to the move isn't one.

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

llvm-svn: 327724

6 years ago[AMDGPU][MC][GFX8][GFX9][DISASSEMBLER] Added "_e32" suffix to 32-bit VINTRP opcodes
Dmitry Preobrazhensky [Fri, 16 Mar 2018 16:38:04 +0000 (16:38 +0000)]
[AMDGPU][MC][GFX8][GFX9][DISASSEMBLER] Added "_e32" suffix to 32-bit VINTRP opcodes

See bug 36751: https://bugs.llvm.org/show_bug.cgi?id=36751

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

Reviewers: artem.tamazov, arsenm
llvm-svn: 327723

6 years ago[LICM/mustexec] Extend first iteration must execute logic to fcmps
Philip Reames [Fri, 16 Mar 2018 16:33:49 +0000 (16:33 +0000)]
[LICM/mustexec] Extend first iteration must execute logic to fcmps

This builds on the work from https://reviews.llvm.org/D44287. It turned out supporting fcmp was much easier than I realized, so let's do that now.

As an aside, our -O3 handling of a floating point IVs leaves a lot to be desired. We do convert the float IV to an integer IV, but do so late enough that many other optimizations are missed (e.g. we don't vectorize).

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

llvm-svn: 327722

6 years agoThis patch fixes the invalid usage of OptSize in Machine Combiner.
Andrew V. Tischenko [Fri, 16 Mar 2018 16:06:24 +0000 (16:06 +0000)]
This patch fixes the invalid usage of OptSize in Machine Combiner.
Differential Revision: https://reviews.llvm.org/D43813

llvm-svn: 327721

6 years ago[AMDGPU][MC] Corrected default values for unused SDWA operands
Dmitry Preobrazhensky [Fri, 16 Mar 2018 15:40:27 +0000 (15:40 +0000)]
[AMDGPU][MC] Corrected default values for unused SDWA operands

See bug 36355:  https://bugs.llvm.org/show_bug.cgi?id=36355

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

Reviewers: artem.tamazov, arsenm
llvm-svn: 327720

6 years agoRevert "Mmap interceptor new option, Write Exec runtime detector"
Jonas Devlieghere [Fri, 16 Mar 2018 15:34:09 +0000 (15:34 +0000)]
Revert "Mmap interceptor new option, Write Exec runtime detector"

This reverts r327696 because it is failing on GreenDragon.

  http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/43605/
  http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/10957/

llvm-svn: 327719

6 years ago[InstCombine] add nnan requirement to potential fabs folds tests; NFC
Sanjay Patel [Fri, 16 Mar 2018 15:27:39 +0000 (15:27 +0000)]
[InstCombine] add nnan requirement to potential fabs folds tests; NFC

As noted in D44550, we can't guarantee preserving the sign-bit of NaN
if we convert these to fabs().

llvm-svn: 327718

6 years ago[clangd] Handle multiple callbacks from Sema's completion
Ilya Biryukov [Fri, 16 Mar 2018 15:23:44 +0000 (15:23 +0000)]
[clangd] Handle multiple callbacks from Sema's completion

Summary:
When parser backtracks, we might receive multiple code completion
callbacks.
Previously we had a failing assertion there, now we take first results
and hope they are good enough.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 327717

6 years ago[clang-format] Disallow breaks before ']' in text proto extensions
Krasimir Georgiev [Fri, 16 Mar 2018 15:23:22 +0000 (15:23 +0000)]
[clang-format] Disallow breaks before ']' in text proto extensions

Summary: This disallows patterns like `[ext.name\n]` in text protos.

Subscribers: klimek, cfe-commits

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

llvm-svn: 327716

6 years ago[SystemZ] Make AnyRegBitRegClass unallocatable.
Jonas Paulsson [Fri, 16 Mar 2018 15:21:26 +0000 (15:21 +0000)]
[SystemZ]  Make AnyRegBitRegClass unallocatable.

AnyReg is just for the assembler and it is better to have it as not
allocatable in order to simplify (make more intuitive) the RegPressureSets.

Review: Ulrich Weigand
llvm-svn: 327715

6 years ago[GISel]: Remove unused header include in MachineIRBuilder.h
Aditya Nandakumar [Fri, 16 Mar 2018 15:14:18 +0000 (15:14 +0000)]
[GISel]: Remove unused header include in MachineIRBuilder.h

llvm-svn: 327714

6 years ago[JumpThreading] Track unreachable BBs to avoid processing
Brian M. Rzycki [Fri, 16 Mar 2018 15:13:47 +0000 (15:13 +0000)]
[JumpThreading] Track unreachable BBs to avoid processing

JumpThreading iterates over F until the IR quiesces. Transforming
unreachable BBs increases compile time and it is also possible to
never stabilize causing JumpThreading to hang. An older attempt at
fixing this problem was D3991 where removeUnreachableBlocks(F)
was called before JumpThreading began. This has a few drawbacks:
 * expensive - the routine attempts to fix up the IR to identify
   additional BBs that can be removed along with unreachable BBs.
 * aggressive - does not identify and preserve the shape of the IR.
   At a minimum it does not preserve loop hierarchies.
 * invasive - altering reachable blocks it may disrupt IR shapes
   that could have otherwise been JumpThreaded.

This patch avoids removeUnreachableBlocks(F) and instead tracks
unreachable BBs in a SmallPtrSet using DominatorTree to validate the
initial state of all BBs. We then rely on subsequent passes to identify
and remove these unreachable blocks from F.

Reviewers: dberlin, sebpop, kuhar, dinesh.d

Reviewed by: sebpop, kuhar

Subscribers: hiraditya, uabelho, llvm-commits

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

llvm-svn: 327713

6 years ago[Hexagon] Fix zero-extending non-HVX bool vectors
Krzysztof Parzyszek [Fri, 16 Mar 2018 15:03:37 +0000 (15:03 +0000)]
[Hexagon] Fix zero-extending non-HVX bool vectors

llvm-svn: 327712

6 years agoMove DraftMgr from ClangdServer to ClangdLSPServer
Simon Marchi [Fri, 16 Mar 2018 14:30:42 +0000 (14:30 +0000)]
Move DraftMgr from ClangdServer to ClangdLSPServer

Summary:
This patch moves the draft manager closer to the edge of Clangd, from
ClangdServer to ClangdLSPServer.  This will make it easier to implement
incremental document sync, by making ClangdServer only deal with
complete documents.

As a result, DraftStore doesn't have to deal with versioning, and thus
its API can be simplified.  It is replaced by a StringMap in
ClangdServer holding a current version number for each file.

Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Subscribers: klimek, mgorny, ilya-biryukov, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 327711

6 years ago[ARM] Convert more invalid NEON immediate loads
Mikhail Maltsev [Fri, 16 Mar 2018 14:10:56 +0000 (14:10 +0000)]
[ARM] Convert more invalid NEON immediate loads

Summary:
Currently the LLVM MC assembler is able to convert e.g.

  vmov.i32 d0, #0xabababab

(which is technically invalid) into a valid instruction

  vmov.i8 d0, #0xab

this patch adds support for vmov.i64 and for cases with the resulting
load types other than i8, e.g.:

  vmov.i32 d0, #0xab00ab00 ->
  vmov.i16 d0, #0xab00

Reviewers: olista01, rengolin

Reviewed By: rengolin

Subscribers: rengolin, javed.absar, kristof.beyls, rogfer01, llvm-commits

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

llvm-svn: 327709