platform/upstream/llvm.git
5 years agoEnable frame pointer elimination for OpenBSD on powerpc.
Brad Smith [Fri, 19 Apr 2019 18:41:40 +0000 (18:41 +0000)]
Enable frame pointer elimination for OpenBSD on powerpc.

llvm-svn: 358775

5 years ago[gn] Support dots in CMake paths in the sync script
Petr Hosek [Fri, 19 Apr 2019 18:29:17 +0000 (18:29 +0000)]
[gn] Support dots in CMake paths in the sync script

Some file paths use dots to pick up sources from parent directories.

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

llvm-svn: 358774

5 years ago[Docs] Make Doxygen functional
Jonas Devlieghere [Fri, 19 Apr 2019 18:02:35 +0000 (18:02 +0000)]
[Docs] Make Doxygen functional

This fixes the doxygen configuration to be functional again. I removed
the customer header and footer, as well as the no-longer-existent style
sheet. I also widened the scope of the documentation, from just the
public API to include the private interfaces as well.

llvm-svn: 358773

5 years ago[LICM & MemorySSA] Make limit flags pass tuning options.
Alina Sbirlea [Fri, 19 Apr 2019 17:46:50 +0000 (17:46 +0000)]
[LICM & MemorySSA] Make limit flags pass tuning options.

Summary:
Make the flags in LICM + MemorySSA tuning options in the old and new
pass managers.

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

Tags: #llvm

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

llvm-svn: 358772

5 years agoRevert "[GlobalISel] Add legalization support for non-power-2 loads and stores"
Amara Emerson [Fri, 19 Apr 2019 17:42:13 +0000 (17:42 +0000)]
Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores"

This introduces some runtime failures which I'll need to investigate further.

llvm-svn: 358771

5 years agoRemoved regiser dump checks from FP unit test.
Mitch Phillips [Fri, 19 Apr 2019 17:36:58 +0000 (17:36 +0000)]
Removed regiser dump checks from FP unit test.

llvm-svn: 358770

5 years ago[HWASan] Added no-FP unit test for register dump.
Mitch Phillips [Fri, 19 Apr 2019 17:36:56 +0000 (17:36 +0000)]
[HWASan] Added no-FP unit test for register dump.

Summary: Unit test for D60798.

Reviewers: eugenis

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

Tags: #sanitizers, #llvm

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

llvm-svn: 358769

5 years agoUpdated test case.
Mitch Phillips [Fri, 19 Apr 2019 17:36:55 +0000 (17:36 +0000)]
Updated test case.

llvm-svn: 358768

5 years agoAdded no-FP unit test for register dump.
Mitch Phillips [Fri, 19 Apr 2019 17:36:53 +0000 (17:36 +0000)]
Added no-FP unit test for register dump.

llvm-svn: 358767

5 years ago[OPENMP][NVPTX] target [teams distribute] simd maybe run without
Alexey Bataev [Fri, 19 Apr 2019 16:48:38 +0000 (16:48 +0000)]
[OPENMP][NVPTX] target [teams distribute] simd maybe run without
runtime.

target [teams distribute] simd costructs do not require full runtime for
the correct execution, we can run them without full runtime.

llvm-svn: 358766

5 years agoUpdate to use PipelineTuningOptions. Corresponds to llvm change: D59723.
Alina Sbirlea [Fri, 19 Apr 2019 16:32:08 +0000 (16:32 +0000)]
Update to use PipelineTuningOptions. Corresponds to llvm change: D59723.

llvm-svn: 358765

5 years ago[GlobalISel][AArch64] Legalize vector G_FPOW
Jessica Paquette [Fri, 19 Apr 2019 16:28:08 +0000 (16:28 +0000)]
[GlobalISel][AArch64] Legalize vector G_FPOW

This instruction is legalized in the same way as G_FSIN, G_FCOS, G_FLOG10, etc.

Update legalize-pow.mir and arm64-vfloatintrinsics.ll to reflect the change.

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

llvm-svn: 358764

5 years ago[NewPassManager] Adding pass tuning options: loop vectorize.
Alina Sbirlea [Fri, 19 Apr 2019 16:11:59 +0000 (16:11 +0000)]
[NewPassManager] Adding pass tuning options: loop vectorize.

Summary:
Trying to add the plumbing necessary to add tuning options to the new pass manager.
Testing with the flags for loop vectorize.

Reviewers: chandlerc

Subscribers: sanjoy, mehdi_amini, jlebar, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

llvm-svn: 358763

5 years ago[dsymutil] DwarfLinker: delete unused parameter
Fangrui Song [Fri, 19 Apr 2019 15:45:25 +0000 (15:45 +0000)]
[dsymutil] DwarfLinker: delete unused parameter

llvm-svn: 358762

5 years ago[SelectionDAG] soften splat mask assert/unreachable (PR41535)
Sanjay Patel [Fri, 19 Apr 2019 15:31:11 +0000 (15:31 +0000)]
[SelectionDAG] soften splat mask assert/unreachable (PR41535)

These are general queries, so they should not die when given
a degenerate input like an all undef mask. Callers should be
able to deal with an op that will eventually be simplified away.

llvm-svn: 358761

5 years agollvm-undname: Attempt to fix leak-on-invalid found by oss-fuzz
Nico Weber [Fri, 19 Apr 2019 14:13:11 +0000 (14:13 +0000)]
llvm-undname: Attempt to fix leak-on-invalid found by oss-fuzz

llvm-svn: 358760

5 years ago[MinGW] Add an --appcontainer flag, passed through to lld-link
Martin Storsjo [Fri, 19 Apr 2019 13:50:43 +0000 (13:50 +0000)]
[MinGW] Add an --appcontainer flag, passed through to lld-link

GNU ld doesn't have such a flag though, so this is a lld specific
option.

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

llvm-svn: 358759

5 years agoDebian: Add two missing version code in sid
Sylvestre Ledru [Fri, 19 Apr 2019 13:48:52 +0000 (13:48 +0000)]
Debian: Add two missing version code in sid

llvm-svn: 358758

5 years agoAdd support of the future Debian (Debian 11 - Bullseye)
Sylvestre Ledru [Fri, 19 Apr 2019 13:46:58 +0000 (13:46 +0000)]
Add support of the future Debian (Debian 11 - Bullseye)
https://wiki.debian.org/DebianBullseye

llvm-svn: 358757

5 years agoAdd support of the next Ubuntu (Ubuntu 19.10 - Eoan EANIMAL)
Sylvestre Ledru [Fri, 19 Apr 2019 13:43:28 +0000 (13:43 +0000)]
Add support of the next Ubuntu (Ubuntu 19.10 - Eoan EANIMAL)

llvm-svn: 358756

5 years agogn build: Merge r358722
Nico Weber [Fri, 19 Apr 2019 13:18:41 +0000 (13:18 +0000)]
gn build: Merge r358722

llvm-svn: 358755

5 years agogn build: Merge r358691
Nico Weber [Fri, 19 Apr 2019 13:16:26 +0000 (13:16 +0000)]
gn build: Merge r358691

llvm-svn: 358754

5 years ago[LTO] Add plumbing to save stats during LTO on Darwin.
Florian Hahn [Fri, 19 Apr 2019 12:36:41 +0000 (12:36 +0000)]
[LTO] Add plumbing to save stats during LTO on Darwin.

Gold and ld on Linux already support saving stats, but the
infrastructure is missing on Darwin. Unfortunately it seems like the
configuration from lib/LTO/LTO.cpp is not used.

This patch adds a new LTOStatsFile option and adds plumbing in Clang to
use it on Darwin, similar to the way remarks are handled.

Currnetly the handling of LTO flags seems quite spread out, with a bunch
of duplication. But I am not sure if there is an easy way to improve
that?

Reviewers: anemet, tejohnson, thegameg, steven_wu

Reviewed By: steven_wu

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

llvm-svn: 358753

5 years ago[analyzer][NFC] Reimplement checker options
Kristof Umann [Fri, 19 Apr 2019 12:32:10 +0000 (12:32 +0000)]
[analyzer][NFC] Reimplement checker options

TL;DR:

* Add checker and package options to the TableGen files
* Added a new class called CmdLineOption, and both Package and Checker recieved
   a list<CmdLineOption> field.
* Added every existing checker and package option to Checkers.td.
* The CheckerRegistry class
  * Received some comments to most of it's inline classes
  * Received the CmdLineOption and PackageInfo inline classes, a list of
     CmdLineOption was added to CheckerInfo and PackageInfo
  * Added addCheckerOption and addPackageOption
  * Added a new field called Packages, used in addPackageOptions, filled up in
     addPackage

Detailed description:

In the last couple months, a lot of effort was put into tightening the
analyzer's command line interface. The main issue is that it's spectacularly
easy to mess up a lenghty enough invocation of the analyzer, and the user was
given no warnings or errors at all in that case.

We can divide the effort of resolving this into several chapters:

* Non-checker analyzer configurations:
    Gather every analyzer configuration into a dedicated file. Emit errors for
    non-existent configurations or incorrect values. Be able to list these
    configurations. Tighten AnalyzerOptions interface to disallow making such
    a mistake in the future.

* Fix the "Checker Naming Bug" by reimplementing checker dependencies:
    When cplusplus.InnerPointer was enabled, it implicitly registered
    unix.Malloc, which implicitly registered some sort of a modeling checker
    from the CStringChecker family. This resulted in all of these checker
    objects recieving the name "cplusplus.InnerPointer", making AnalyzerOptions
    asking for the wrong checker options from the command line:
      cplusplus.InnerPointer:Optimisic
    istead of
      unix.Malloc:Optimistic.
    This was resolved by making CheckerRegistry responsible for checker
    dependency handling, instead of checkers themselves.

* Checker options: (this patch included!)
    Same as the first item, but for checkers.

(+ minor fixes here and there, and everything else that is yet to come)

There were several issues regarding checker options, that non-checker
configurations didn't suffer from: checker plugins are loaded runtime, and they
could add new checkers and new options, meaning that unlike for non-checker
configurations, we can't collect every checker option purely by generating code.
Also, as seen from the "Checker Naming Bug" issue raised above, they are very
rarely used in practice, and all sorts of skeletons fell out of the closet while
working on this project.

They were extremely problematic for users as well, purely because of how long
they were. Consider the following monster of a checker option:

  alpha.cplusplus.UninitializedObject:CheckPointeeInitialization=false

While we were able to verify whether the checker itself (the part before the
colon) existed, any errors past that point were unreported, easily resulting
in 7+ hours of analyses going to waste.

This patch, similarly to how dependencies were reimplemented, uses TableGen to
register checker options into Checkers.td, so that Checkers.inc now contains
entries for both checker and package options. Using the preprocessor,
Checkers.inc is converted into code in CheckerRegistry, adding every builtin
(checkers and packages that have an entry in the Checkers.td file) checker and
package option to the registry. The new addPackageOption and addCheckerOption
functions expose the same functionality to statically-linked non-builtin and
plugin checkers and packages as well.

Emitting errors for incorrect user input, being able to list these options, and
some other functionalies will land in later patches.

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

llvm-svn: 358752

5 years agoChange \r\n -> \n for llvm-symbolizer/help.test after rL358749
Fangrui Song [Fri, 19 Apr 2019 12:28:36 +0000 (12:28 +0000)]
Change \r\n -> \n for llvm-symbolizer/help.test after rL358749

llvm-svn: 358751

5 years ago[analyzer] Fix an assertion failure if plugins added dependencies
Kristof Umann [Fri, 19 Apr 2019 11:01:35 +0000 (11:01 +0000)]
[analyzer] Fix an assertion failure if plugins added dependencies

Ideally, there is no reason behind not being able to depend on checkers that
come from a different plugin (or on builtin checkers) -- however, this is only
possible if all checkers are added to the registry before resolving checker
dependencies. Since I used a binary search in my addDependency method, this also
resulted in an assertion failure (due to CheckerRegistry::Checkers not being
sorted), since the function used by plugins to register their checkers
(clang_registerCheckers) calls addDependency.

This patch resolves this issue by only noting which dependencies have to
established when addDependency is called, and resolves them at a later stage
when no more checkers are added to the registry, by which point
CheckerRegistry::Checkers is already sorted.

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

llvm-svn: 358750

5 years ago[llvm-symbolizer] Add llvm-addr2line
Igor Kudrin [Fri, 19 Apr 2019 10:17:52 +0000 (10:17 +0000)]
[llvm-symbolizer] Add llvm-addr2line

This adds an alias for llvm-symbolizer with different defaults so that
it can be used as a drop-in replacement for GNU's addr2line.

If a substring "addr2line" is found in the tool's name:
  * it defaults "-i", "-f" and "-C" to OFF;
  * it uses "--output-style=GNU" by default.

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

llvm-svn: 358749

5 years ago[llvm-symbolizer] Unhide and document the "-output-style" option
Igor Kudrin [Fri, 19 Apr 2019 10:14:18 +0000 (10:14 +0000)]
[llvm-symbolizer] Unhide and document the "-output-style" option

With the latest changes, the option gets useful for users of
llvm-symbolizer, not only for the upcoming llvm-addr2line.

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

llvm-svn: 358748

5 years ago[llvm-symbolizer] Make the output with -output-style=GNU closer to addr2line's
Igor Kudrin [Fri, 19 Apr 2019 10:12:56 +0000 (10:12 +0000)]
[llvm-symbolizer] Make the output with -output-style=GNU closer to addr2line's

This patch addresses two differences in the output of llvm-symbolizer
and GNU's addr2line:

* llvm-symbolizer prints an empty line after the report for an address.

* With "-f -i=0", llvm-symbolizer replaces the name of an inlined
  function with the name from the symbol table, i. e., the top caller
  function in the inlining chain. addr2line preserves the name of the
  inlined function.

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

llvm-svn: 358747

5 years ago[AMDGPU] Regenerate extractelt->truncate test.
Simon Pilgrim [Fri, 19 Apr 2019 09:49:04 +0000 (09:49 +0000)]
[AMDGPU] Regenerate extractelt->truncate test.

Prep work for D60462

llvm-svn: 358746

5 years ago[LibTooling] Fix -Wsign-compare after r358697
Bjorn Pettersson [Fri, 19 Apr 2019 09:10:42 +0000 (09:10 +0000)]
[LibTooling] Fix -Wsign-compare after r358697

llvm-svn: 358745

5 years ago[CodeGen] Add "const" to MachineInstr::mayAlias
Bjorn Pettersson [Fri, 19 Apr 2019 09:08:38 +0000 (09:08 +0000)]
[CodeGen] Add "const" to MachineInstr::mayAlias

Summary:
The basic idea here is to make it possible to use
MachineInstr::mayAlias also when the MachineInstr
is const (or the "Other" MachineInstr is const).

The addition of const in MachineInstr::mayAlias
then rippled down to the need for adding const
in several other places, such as
TargetTransformInfo::getMemOperandWithOffset.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, MatzeB, arsenm, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 358744

5 years ago[PATCH] [MachineScheduler] Check pending instructions when an instruction is scheduled
James Molloy [Fri, 19 Apr 2019 09:00:55 +0000 (09:00 +0000)]
[PATCH] [MachineScheduler] Check pending instructions when an instruction is scheduled

Pending instructions that may have been blocked from being available by the HazardRecognizer may no longer may not be blocked any more when an instruction is scheduled; pending instructions should be re-checked in this case.

This is primarily aimed at VLIW targets with large parallelism and esoteric constraints.

No testcase as no in-tree targets have this behavior.

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

llvm-svn: 358743

5 years ago[MergeFunc] Delete unused FunctionNode::release()
Fangrui Song [Fri, 19 Apr 2019 08:03:20 +0000 (08:03 +0000)]
[MergeFunc] Delete unused FunctionNode::release()

llvm-svn: 358742

5 years ago[MergeFunc] removeUsers: call remove() only on direct users
Fangrui Song [Fri, 19 Apr 2019 07:57:51 +0000 (07:57 +0000)]
[MergeFunc] removeUsers: call remove() only on direct users

removeUsers uses a work list to collect indirect users and call remove()
on those functions. However it has a bug (`if (!Visited.insert(UU).second)`).

Actually, we don't have to collect indirect users.
After the merge of F and G, G's callers will be considered (added to
Deferred). If G's callers can be merged, G's callers' callers will be
considered.

Update the test unnamed-addr-reprocessing.ll to make it clear we can
still merge indirect callers.

llvm-svn: 358741

5 years ago[AMDGPU] Ignore non-SUnits edges
Piotr Sobczak [Fri, 19 Apr 2019 06:19:14 +0000 (06:19 +0000)]
[AMDGPU] Ignore non-SUnits edges

Summary:
Ignore edges to non-SUnits (e.g. ExitSU) when checking
for low latency instructions.

When calling the function isLowLatencyInstruction(),
an ExitSU could be on the list of successors, not necessarily
a regular SU. In other places in the code there is a check
"Succ->NodeNum >= DAGSize" to prevent further processing of
ExitSU as "Succ->getInstr()" is NULL in such a case.
Also, 8 out of 9 cases of "SUnit *Succ = SuccDep.getSUnit())"
has the guard, so it is clearly an omission here.

Change-Id: Ica86f0327c7b2e6bcb56958e804ea6c71084663b

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: MatzeB, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 358740

5 years ago[CallSite removal] Move the legacy PM, call graph, and some inliner
Chandler Carruth [Fri, 19 Apr 2019 05:59:42 +0000 (05:59 +0000)]
[CallSite removal]  Move the legacy PM, call graph, and some inliner
code to `CallBase`.

This patch focuses on the legacy PM, call graph, and some of inliner and legacy
passes interacting with those APIs from `CallSite` to the new `CallBase` class.
No interesting changes.

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

llvm-svn: 358739

5 years ago[MergeFunc] Use less_first() as the comparator of Schwartzian transform
Fangrui Song [Fri, 19 Apr 2019 05:49:29 +0000 (05:49 +0000)]
[MergeFunc] Use less_first() as the comparator of Schwartzian transform

llvm-svn: 358738

5 years ago[X86] Turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the AND could...
Craig Topper [Fri, 19 Apr 2019 05:48:13 +0000 (05:48 +0000)]
[X86] Turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the AND could match a movzx.

Could get further improvements by recognizing (i64 and (anyext (i32 shl))).

llvm-svn: 358737

5 years ago[X86] Add test cases for turning (and (shl X, C1), C2) into (shl (and X, (C1 >> C2...
Craig Topper [Fri, 19 Apr 2019 05:48:09 +0000 (05:48 +0000)]
[X86] Add test cases for turning (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) when the AND could match to a movzx.

We already reorder when C1 >> C2 would allow a smaller immediate encoding.

llvm-svn: 358736

5 years ago[X86] Make sure we copy the HandleSDNode back to N before executing the default code...
Craig Topper [Fri, 19 Apr 2019 04:52:21 +0000 (04:52 +0000)]
[X86] Make sure we copy the HandleSDNode back to N before executing the default code after the switch in matchAddressRecursively

Summary:
There are two places where we create a HandleSDNode in address matching in order to handle the case where N is changed by CSE. But if we end up not matching, we fall back to code at the bottom of the switch that really would like N to point to something that wasn't CSEd away. So we should make sure we copy the handle back to N on any paths that can reach that code.

This appears to be the true reason we needed to check DELETED_NODE in the negation matching. In pr32329.ll we had two subtracts back to back. We recursed through the first subtract, and onto the second subtract. The second subtract called matchAddressRecursively on its LHS which caused that subtract to CSE. We ultimately failed the match and ended up in the default code. But N was pointing at the old node that had been deleted, but the default code didn't know that and took it as the base register. Then we unwound back to the first subtract and tried to access this bogus base reg requiring the check for deleted node. With this patch we now use the CSE result as the base reg instead.

matchAdd has been broken since sometime in 2015 when it was pulled out of the switch into a helper function. The assignment to N at the end was still there, but N was passed by value and not by reference so the update didn't go anywhere.

Reviewers: niravd, spatel, RKSimon, bkramer

Reviewed By: niravd

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 358735

5 years ago[DWARF] Use hasFileAtIndex to properly verify DWARF 5 after rL358732
Fangrui Song [Fri, 19 Apr 2019 03:34:28 +0000 (03:34 +0000)]
[DWARF] Use hasFileAtIndex to properly verify DWARF 5 after rL358732

llvm-svn: 358734

5 years agoFix overly-long line after r358731.
Richard Smith [Fri, 19 Apr 2019 02:46:50 +0000 (02:46 +0000)]
Fix overly-long line after r358731.

llvm-svn: 358733

5 years ago[llvm] Prevent duplicate files in debug line header in dwarf 5: another attempt
Ali Tamur [Fri, 19 Apr 2019 02:26:56 +0000 (02:26 +0000)]
[llvm] Prevent duplicate files in debug line header in dwarf 5: another attempt

Another attempt to land the changes in debug line header to prevent duplicate
files in Dwarf 5. I rolled back my previous commit because of a mistake in
generating the object file in a test. Meanwhile, I addressed some offline
comments and changed the implementation; the largest difference is that
MCDwarfLineTableHeader does not keep DwarfVersion but gets it as a parameter. I
also merged the patch to fix two lld tests that will strt to fail into this
patch.

Original Commit:

https://reviews.llvm.org/D59515

Original Message:
Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf
5) However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

llvm-svn: 358732

5 years agoFix typo in function name [NFC]
Ali Tamur [Fri, 19 Apr 2019 02:15:57 +0000 (02:15 +0000)]
Fix typo in function name [NFC]

llvm-svn: 358731

5 years ago[APInt] Optimize umul_ov
Fangrui Song [Fri, 19 Apr 2019 02:06:06 +0000 (02:06 +0000)]
[APInt] Optimize umul_ov

Change two costly udiv() calls to lshr(1)*RHS + left-shift + plus

On one 64-bit umul_ov benchmark, I measured an obvious improvement: 12.8129s -> 3.6257s

Note, there may be some value to special case 64-bit (the most common
case) with __builtin_umulll_overflow().

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

llvm-svn: 358730

5 years ago[analyzer] Fix -Wunused-local-typedef after rC358695
Fangrui Song [Fri, 19 Apr 2019 01:54:36 +0000 (01:54 +0000)]
[analyzer] Fix -Wunused-local-typedef after rC358695

llvm-svn: 358729

5 years agoMergeFunc: preserve COMDAT information when creating a thunk
Saleem Abdulrasool [Fri, 19 Apr 2019 01:48:36 +0000 (01:48 +0000)]
MergeFunc: preserve COMDAT information when creating a thunk

We would previously drop the COMDAT on the thunk we generated when replacing a
function body with the forwarding thunk. This would result in a function that
may have been multiply emitted and multiply merged to be emitted with the same
name without the COMDAT. This is a hard error with PE/COFF where the COMDAT is
used for the deduplication of Value Witness functions for Swift.

llvm-svn: 358728

5 years ago[libFuzzer] revert part of r358726 committed by mistake (oops)
Kostya Serebryany [Fri, 19 Apr 2019 01:40:16 +0000 (01:40 +0000)]
[libFuzzer] revert part of r358726 committed by mistake (oops)

llvm-svn: 358727

5 years ago[libFuzzer] in fork mode, make sure the child stats are always collected. This should...
Kostya Serebryany [Fri, 19 Apr 2019 01:39:14 +0000 (01:39 +0000)]
[libFuzzer] in fork mode, make sure the child stats are always collected. This should fix the flakiness in fork-ubsan.test

llvm-svn: 358726

5 years ago[libc++] Make __debug_less::operator() constexpr
Thomas Anderson [Fri, 19 Apr 2019 00:52:54 +0000 (00:52 +0000)]
[libc++] Make __debug_less::operator() constexpr

This is a followup to [1] which added a new `__debug_less::operator()` overload.
[2] added `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the original
`__debug_less::operator()` between the time of writing [1] and landing it.  This
change adds `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the new overload too.

[1] https://reviews.llvm.org/rL358423
[2] https://reviews.llvm.org/rL358252

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

llvm-svn: 358725

5 years agoAdd header guard to Reusables.h [NFC]
Ali Tamur [Fri, 19 Apr 2019 00:42:54 +0000 (00:42 +0000)]
Add header guard to Reusables.h [NFC]

llvm-svn: 358724

5 years ago[LoopUnroll] Move list of params into a struct [NFCI].
Alina Sbirlea [Thu, 18 Apr 2019 23:43:49 +0000 (23:43 +0000)]
[LoopUnroll] Move list of params into a struct [NFCI].

Summary: Cleanup suggested in review of r358304.

Reviewers: sanjoy, efriedma

Subscribers: jlebar, zzheng, dmgreen, llvm-commits

Tags: #llvm

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

llvm-svn: 358723

5 years ago[analyzer] Make default bindings to variables actually work.
Artem Dergachev [Thu, 18 Apr 2019 23:35:56 +0000 (23:35 +0000)]
[analyzer] Make default bindings to variables actually work.

Default RegionStore bindings represent values that can be obtained by loading
from anywhere within the region, not just the specific offset within the region
that they are said to be bound to. For example, default-binding a character \0
to an int (eg., via memset()) means that the whole int is 0, not just
that its lower byte is 0.

Even though memset and bzero were modeled this way, it didn't work correctly
when applied to simple variables. Eg., in

  int x;
  memset(x, 0, sizeof(x));

we did produce a default binding, but were unable to read it later, and 'x'
was perceived as an uninitialized variable even after memset.

At the same time, if we replace 'x' with a variable of a structure or array
type, accessing fields or elements of such variable was working correctly,
which was enough for most cases. So this was only a problem for variables of
simple integer/enumeration/floating-point/pointer types.

Fix loading default bindings from RegionStore for regions of simple variables.

Add a unit test to document the API contract as well.

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

llvm-svn: 358722

5 years ago[Python] Simplify the code. NFCI.
Davide Italiano [Thu, 18 Apr 2019 23:24:54 +0000 (23:24 +0000)]
[Python] Simplify the code. NFCI.

llvm-svn: 358721

5 years ago[analyzer] NFC: Make reusable unittest mocks reusable.
Artem Dergachev [Thu, 18 Apr 2019 23:24:50 +0000 (23:24 +0000)]
[analyzer] NFC: Make reusable unittest mocks reusable.

Put them in a header for other Analyzer unittests to include.

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

llvm-svn: 358720

5 years ago[analyzer] NFC: MoveChecker: Refactor tests to use -verify=prefix.
Artem Dergachev [Thu, 18 Apr 2019 23:17:58 +0000 (23:17 +0000)]
[analyzer] NFC: MoveChecker: Refactor tests to use -verify=prefix.

This -verify=prefix feature is quite underrated.

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

llvm-svn: 358719

5 years ago[AArch64] add tests for mul-by-element; NFC
Sanjay Patel [Thu, 18 Apr 2019 21:48:46 +0000 (21:48 +0000)]
[AArch64] add tests for mul-by-element; NFC

llvm-svn: 358718

5 years ago[crashlog] Strip trailing `\n` from check_output return.
Davide Italiano [Thu, 18 Apr 2019 21:32:36 +0000 (21:32 +0000)]
[crashlog] Strip trailing `\n` from check_output return.

Generally having spurious `\n` doesn't matter, but here the
returning string is a command which is executed, so  we want
to strip it. Pointed out by Jason.

llvm-svn: 358717

5 years agoImplement sys::fs::copy_file using the macOS copyfile(3) API
Adrian Prantl [Thu, 18 Apr 2019 21:22:50 +0000 (21:22 +0000)]
Implement sys::fs::copy_file using the macOS copyfile(3) API
to support APFS clones.

This patch adds a Darwin-specific implementation of
llvm::sys::fs::copy_file() that uses the macOS copyfile(3) API to
support APFS copy-on-write clones, which should be faster and much
more space efficient.

https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html

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

This reapplies 358628 with an additional bugfix handling the case
where the destination file already exists. (Caught by the clang testsuite).

llvm-svn: 358716

5 years ago[GlobalISel][AArch64] Legalize/select G_(S/Z/ANY)_EXT for v8s8s
Jessica Paquette [Thu, 18 Apr 2019 21:15:48 +0000 (21:15 +0000)]
[GlobalISel][AArch64] Legalize/select G_(S/Z/ANY)_EXT for v8s8s

This adds legalization for G_SEXT, G_ZEXT, and G_ANYEXT for v8s8s.

We were falling back on G_ZEXT in arm64-vabs.ll before, preventing us from
selecting the @llvm.aarch64.neon.sabd.v8i8 intrinsic.

This adds legalizer support for those 3, which gives us selection via the
importer. Update the relevant tests (legalize-ext.mir, select-int-ext.mir) and
add a GISel line to arm64-vabs.ll.

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

llvm-svn: 358715

5 years ago[GlobalISel][AArch64] Legalize v8s8 loads
Jessica Paquette [Thu, 18 Apr 2019 21:13:58 +0000 (21:13 +0000)]
[GlobalISel][AArch64] Legalize v8s8 loads

Add legalizer support for loads of v8s8 and update legalize-load-store.mir.

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

llvm-svn: 358714

5 years ago[c++2a] Add semantic support for private module fragments.
Richard Smith [Thu, 18 Apr 2019 21:12:54 +0000 (21:12 +0000)]
[c++2a] Add semantic support for private module fragments.

llvm-svn: 358713

5 years ago[libc++] Link against libc++abi in the libc++abi tests
Louis Dionne [Thu, 18 Apr 2019 20:59:49 +0000 (20:59 +0000)]
[libc++] Link against libc++abi in the libc++abi tests

PR27405

llvm-svn: 358712

5 years ago[OpenMP][NFC] Fix requires target test.
Gheorghe-Teodor Bercea [Thu, 18 Apr 2019 20:34:43 +0000 (20:34 +0000)]
[OpenMP][NFC] Fix requires target test.

Summary:
Fix requires target test.

Reviewers: ABataev

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 358711

5 years ago[clang-format] Fix incorrect formatting of keyword macro definition
Owen Pan [Thu, 18 Apr 2019 20:17:08 +0000 (20:17 +0000)]
[clang-format] Fix incorrect formatting of keyword macro definition

See PR39719

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

llvm-svn: 358710

5 years ago[OpenMP] Add checks for requires and target directives.
Gheorghe-Teodor Bercea [Thu, 18 Apr 2019 19:53:43 +0000 (19:53 +0000)]
[OpenMP] Add checks for requires and target directives.

Summary: The requires directive containing target related clauses must appear before any target region in the compilation unit.

Reviewers: ABataev, AlexEichenberger, caomhin

Reviewed By: ABataev

Subscribers: guansong, jfb, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 358709

5 years agollvm-undname: Fix two more asserts-on-invalid, found by oss-fuzz
Nico Weber [Thu, 18 Apr 2019 19:52:32 +0000 (19:52 +0000)]
llvm-undname: Fix two more asserts-on-invalid, found by oss-fuzz

llvm-svn: 358708

5 years agollvm-undname: Fix two asserts-on-invalid
Nico Weber [Thu, 18 Apr 2019 19:30:21 +0000 (19:30 +0000)]
llvm-undname: Fix two asserts-on-invalid

llvm-svn: 358707

5 years ago[builtins] Build x86_64 with GENERIC_TF_SOURCES
Yi Kong [Thu, 18 Apr 2019 19:29:03 +0000 (19:29 +0000)]
[builtins] Build x86_64 with GENERIC_TF_SOURCES

llvm-svn: 358706

5 years ago[LibTooling] Fix build breakage from commit 7b7ce6683ee.
Yitzhak Mandelbaum [Thu, 18 Apr 2019 19:19:01 +0000 (19:19 +0000)]
[LibTooling] Fix build breakage from commit 7b7ce6683ee.

On configurations with -Werror,-Wmissing-field-initializers, the commit does not compile. This commit fixes the offending line.

Original Differential Revision: https://reviews.llvm.org/D60408

llvm-svn: 358705

5 years ago[GuardWidening] Wire up a NPM version of the LoopGuardWidening pass
Philip Reames [Thu, 18 Apr 2019 19:17:14 +0000 (19:17 +0000)]
[GuardWidening] Wire up a NPM version of the LoopGuardWidening pass

llvm-svn: 358704

5 years agoSummary:
Jonathan Metzman [Thu, 18 Apr 2019 18:49:11 +0000 (18:49 +0000)]
Summary:
Add close_fd_mask functionality to AFL driver.

Summary:
Add support for env var AFL_DRIVER_CLOSE_FD_MASK which behaves
the same as libFuzzer's -close_fd_mask=1.

Also add tests.

Reviewers: kcc, vitalybuka, morehouse

Reviewed By: morehouse

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 358703

5 years ago[NFC] FMF propagation for GlobalIsel
Michael Berg [Thu, 18 Apr 2019 18:48:57 +0000 (18:48 +0000)]
[NFC] FMF propagation for GlobalIsel

llvm-svn: 358702

5 years ago[BlockExtractor] Extend the file format to support the grouping of basic blocks
Quentin Colombet [Thu, 18 Apr 2019 18:28:30 +0000 (18:28 +0000)]
[BlockExtractor] Extend the file format to support the grouping of basic blocks

Prior to this patch, each basic block listed in the extrack-blocks-file
would be extracted to a different function.

This patch adds the support for comma separated list of basic blocks
to form group.

When the region formed by a group is not extractable, e.g., not single
entry, all the blocks of that group are left untouched.

Let us see this new format in action (comments are not part of the
file format):
;; funcName bbName[,bbName...]
   foo      bb1        ;; Extract bb1 in its own function
   foo      bb2,bb3    ;; Extract bb2,bb3 in their own function
   bar      bb1,bb4    ;; Extract bb1,bb4 in their own function
   bar      bb2        ;; Extract bb2 in its own function

Assuming all regions are extractable, this will create one function and
thus one call per region.

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

llvm-svn: 358701

5 years ago[pstl] Add a serial backend for the PSTL
Louis Dionne [Thu, 18 Apr 2019 18:20:19 +0000 (18:20 +0000)]
[pstl] Add a serial backend for the PSTL

Summary:
The serial backend performs all tasks serially and does not require
threads. It does not have any dependencies beyond normal C++, but
it is not very efficient either.

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, jdoerfert, libcxx-commits

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

llvm-svn: 358700

5 years ago[PowerPC] Add some PPC vec cost tests to prep for D60160 NFC
Roland Froese [Thu, 18 Apr 2019 18:12:09 +0000 (18:12 +0000)]
[PowerPC] Add some PPC vec cost tests to prep for D60160 NFC

llvm-svn: 358699

5 years ago[libc++] [test] Add missing required headers to midpoint.integer.pass.cpp
Billy Robert O'Neal III [Thu, 18 Apr 2019 18:02:14 +0000 (18:02 +0000)]
[libc++] [test] Add missing required headers to midpoint.integer.pass.cpp

This change authored by Paolo Torres <t-pator@microsoft.com>

llvm-svn: 358698

5 years ago[LibTooling] Extend Transformer to support multiple simultaneous changes.
Yitzhak Mandelbaum [Thu, 18 Apr 2019 17:52:24 +0000 (17:52 +0000)]
[LibTooling] Extend Transformer to support multiple simultaneous changes.

Summary: This revision allows users to specify independent changes to multiple (related) sections of the input.  Previously, only a single section of input could be selected for replacement.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: jfb, cfe-commits

Tags: #clang

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

llvm-svn: 358697

5 years ago[CodeComplete] Remove obsolete isOutputBinary().
Sam McCall [Thu, 18 Apr 2019 17:35:55 +0000 (17:35 +0000)]
[CodeComplete] Remove obsolete isOutputBinary().

Summary:
It's never set to true. Its only effect would be to set stdout to binary mode.
Hopefully we have better ways of doing this by now :-)

Reviewers: hokein

Subscribers: jkorous, arphaman, kadircet, llvm-commits

Tags: #llvm

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

llvm-svn: 358696

5 years ago[analyzer][NFC] Prefer binary searches in CheckerRegistry
Kristof Umann [Thu, 18 Apr 2019 17:34:45 +0000 (17:34 +0000)]
[analyzer][NFC] Prefer binary searches in CheckerRegistry

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

llvm-svn: 358695

5 years ago[analyzer][NFC] Clang-format CheckerRegistry
Kristof Umann [Thu, 18 Apr 2019 17:32:51 +0000 (17:32 +0000)]
[analyzer][NFC] Clang-format CheckerRegistry

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

llvm-svn: 358694

5 years ago[Docs] Add LLDB bots
Jonas Devlieghere [Thu, 18 Apr 2019 17:31:20 +0000 (17:31 +0000)]
[Docs] Add LLDB bots

llvm-svn: 358693

5 years ago[X86] combineVectorTruncationWithPACKUS - remove split/concatenation of mask
Simon Pilgrim [Thu, 18 Apr 2019 17:23:09 +0000 (17:23 +0000)]
[X86] combineVectorTruncationWithPACKUS - remove split/concatenation of mask

combineVectorTruncationWithPACKUS is currently splitting the upper bit bit masking into 128-bit subregs and then concatenating them back together.

This was originally done to avoid regressions that caused existing subregs to be concatenated to the larger type just for the AND masking before being extracted again. This was fixed by @spatel (notably rL303997 and rL347356).

This also lets SimplifyDemandedBits do some further improvements before it hits the recursive depth limit.

My only annoyance with this is that we were broadcasting some xmm masks but we seem to have lost them by moving to ymm - but that's a known issue as the logic in lowerBuildVectorAsBroadcast isn't great.

Differential Revision: https://reviews.llvm.org/D60375#inline-539623

llvm-svn: 358692

5 years ago[LibTooling] Add Stencil library for format-string style codegen.
Yitzhak Mandelbaum [Thu, 18 Apr 2019 17:23:01 +0000 (17:23 +0000)]
[LibTooling] Add Stencil library for format-string style codegen.

Summary:
This file defines the *Stencil* abstraction: a code-generating object, parameterized by named references to (bound) AST nodes.  Given a match result, a stencil can be evaluated to a string of source code.

A stencil is similar in spirit to a format string: it is composed of a series of raw text strings, references to nodes (the parameters) and helper code-generation operations.

See thread on cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling" for background.

Reviewers: sbenza

Reviewed By: sbenza

Subscribers: ilya-biryukov, mgorny, jfb, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 358691

5 years ago[libc++] Make sure we re-export some missing libc++abi symbols from libc++
Louis Dionne [Thu, 18 Apr 2019 17:18:15 +0000 (17:18 +0000)]
[libc++] Make sure we re-export some missing libc++abi symbols from libc++

Summary:
Ensure we re-export __cxa_throw_bad_array_new_length and
__cxa_uncaught_exceptions from libc++, since they are now
provided by libc++abi.

Doing this allows us to stop linking explicitly against libc++abi in
the libc++abi tests, since libc++ re-exports all the necessary symbols.
However, there is one caveat to that. We don't want libc++ to re-export
__cxa_uncaught_exception (the singular form), since it's only provided
for backwards compatibility. Hence, for the single test where we check
this backwards compatibility, we explicitly link against libc++abi.

PR27405
PR22654

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 358690

5 years ago[clang-format] Fix indent of trailing raw string param after newline
Krasimir Georgiev [Thu, 18 Apr 2019 17:14:05 +0000 (17:14 +0000)]
[clang-format] Fix indent of trailing raw string param after newline

Summary:
Currently clang-format uses ContinuationIndent to indent the contents of a raw
string literal that is the last parameter of the function call. This is to
achieve formatting similar to trailing:
```
f(1, 2, R"pb(
    x: y)pb");
```
However this had the unfortunate consequence of producing format like this:
```
fffffff(1, 2,
        R"pb(
    a: b
        )pb");
```

This patch makes clang-format consider indenting a trailing raw string param
after a newline based off the start of the format delimiter, producing:
```
fffffff(1, 2,
        R"pb(
          a: b
        )pb");
```

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 358689

5 years ago[LoopPred] Fix a blatantly obvious bug in r358684
Philip Reames [Thu, 18 Apr 2019 17:01:19 +0000 (17:01 +0000)]
[LoopPred] Fix a blatantly obvious bug in r358684

The bug is that I didn't check whether the operand of the invariant_loads were themselves invariant.  I don't know how this got missed in the patch and review.  I even had an unreduced test case locally, and I remember handling this case, but I must have lost it in one of the rebases.  Oops.

llvm-svn: 358688

5 years ago[x86] add tests for improved insertelement to index 0 (PR41512); NFC
Sanjay Patel [Thu, 18 Apr 2019 16:58:50 +0000 (16:58 +0000)]
[x86] add tests for improved insertelement to index 0 (PR41512); NFC

Patch proposal in D60852.

llvm-svn: 358687

5 years ago[CMake] Emit LLDB.framework.dSYM to avoid potential name collision with driver's...
Stefan Granitz [Thu, 18 Apr 2019 16:37:22 +0000 (16:37 +0000)]
[CMake] Emit LLDB.framework.dSYM to avoid potential name collision with driver's lldb.dSYM

Summary:
Emit framework's dSYM bundle as LLDB.framework.dSYM instead of LLDB.dSYM, because the latter could conflict with the driver's lldb.dSYM when emitted in the same directory on case-insensitive file systems.
Requires https://reviews.llvm.org/D60862

Reviewers: friss, beanz, bogner

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 358686

5 years ago[CMake] Allow custom extensions for externalized debug info
Stefan Granitz [Thu, 18 Apr 2019 16:37:07 +0000 (16:37 +0000)]
[CMake] Allow custom extensions for externalized debug info

Summary:
Extra flexibility for emitting debug info to external files (remains Darwin only for now).
LLDB needs this functionality to emit a LLDB.framework.dSYM instead of LLDB.dSYM when building the framework, because the latter could conflict with the driver's lldb.dSYM when emitted in the same directory on case-insensitive file systems.

Reviewers: friss, bogner, beanz

Subscribers: mgorny, aprantl, llvm-commits, #lldb

Tags: #llvm

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

llvm-svn: 358685

5 years ago[LoopPredication] Allow predication of loop invariant computations (within the loop)
Philip Reames [Thu, 18 Apr 2019 16:33:17 +0000 (16:33 +0000)]
[LoopPredication] Allow predication of loop invariant computations (within the loop)

The purpose of this patch is to eliminate a pass ordering dependence between LoopPredication and LICM. To understand the purpose, consider the following snippet of code inside some loop 'L' with IV 'i'
A = _a.length;
guard (i < A)
a = _a[i]
B = _b.length;
guard (i < B);
b = _b[i];
...
Z = _z.length;
guard (i < Z)
z = _z[i]
accum += a + b + ... + z;

Today, we need LICM to hoist the length loads, LoopPredication to make the guards loop invariant, and TrivialUnswitch to eliminate the loop invariant guard to establish must execute for the next length load. Today, if we can't prove speculation safety, we'd have to iterate these three passes 26 times to reduce this example down to the minimal form.

Using the fact that the array lengths are known to be invariant, we can short circuit this iteration. By forming the loop invariant form of all the guards at once, we remove the need for LoopPredication from the iterative cycle. At the moment, we'd still have to iterate LICM and TrivialUnswitch; we'll leave that part for later.

As a secondary benefit, this allows LoopPred to expose peeling oppurtunities in a much more obvious manner.  See the udiv test changes as an example.  If the udiv was not hoistable (i.e. we couldn't prove speculation safety) this would be an example where peeling becomes obviously profitable whereas it wasn't before.

A couple of subtleties in the implementation:
- SCEV's isSafeToExpand guarantees speculation safety (i.e. let's us expand at a new point).  It is not a precondition for expansion if we know the SCEV corresponds to a Value which dominates the requested expansion point.
- SCEV's isLoopInvariant returns true for expressions which compute the same value across all iterations executed, regardless of where the original Value is located.  (i.e. it can be in the loop)  This implies we have a speculation burden to prove before expanding them outside loops.
- invariant_loads and AA->pointsToConstantMemory are two cases that SCEV currently does not handle, but meets the SCEV definition of invariance.  I plan to sink this part into SCEV once this has baked for a bit.

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

llvm-svn: 358684

5 years agoClean up docstrings in swig interface files
Pavel Labath [Thu, 18 Apr 2019 16:23:33 +0000 (16:23 +0000)]
Clean up docstrings in swig interface files

Summary:
This patch removes the "//----" frames and "///" leading lines from
docstring comments.  We already have code doing transformations like this in
modify-python-lldb.py, but that's a script I'd like to remove. Instead
of running these transformations everytime we run swig, we can just
perform equivalent on its input once.

This patch can be reproduced (e.g. for downstream merges) with the
following "sweet" perl command:

  perl -i -p -e 'BEGIN{ $/ = undef;} s:(" *\n) *//-----*\n:\1:gs; s:^(     *)/// ?:\1:gsm; s:^ *//------*\n( *\n)?( *"):\2:gsm; s: *$::gsm; s:\n *"\):"):gsm' scripts/interface/*.i

This command produces nearly equivalent python files to those produced
by the relevant code in modify-python-lldb.py. The only difference I
noticed is that here I am slightly more agressive in removing trailing
newlines from docstring comments (the python script seems to leave
newlines in class-level docstrings).

Reviewers: amccarth, clayborg, jingham, aprantl

Subscribers: lldb-commits

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

llvm-svn: 358683

5 years ago[asan_symbolize] Workaround bug in old Python 2 versions.
Dan Liew [Thu, 18 Apr 2019 16:22:55 +0000 (16:22 +0000)]
[asan_symbolize] Workaround bug in old Python 2 versions.

The change landed in r358657 broke some of the buildbots because they
use an older version of Python 2 that raises this error.

```
File "/Volumes/data/dev/llvm/upstream/master/src/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py", line 509
  exec(f.read(), globals_space, None)
SyntaxError: unqualified exec is not allowed in function 'load_plugin_from_file' it contains a nested function with free variables
```

I can reproduce this problem when using Python 2.7.6.

To workaround this some indirection has been added to prevent the broken
(the line at fault would never be executed) SyntaxError error in old
Python versions from being raised.

rdar://problem/49476995

llvm-svn: 358682

5 years ago[SDA] Bug fix: Use IPD outside the loop as divergence bound
Nicolai Haehnle [Thu, 18 Apr 2019 16:17:35 +0000 (16:17 +0000)]
[SDA] Bug fix: Use IPD outside the loop as divergence bound

Summary:
The immediate post dominator of the loop header may be part of the divergent loop.
Since this /was/ the divergence propagation bound the SDA would not detect joins of divergent paths outside the loop.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: mmasten, arsenm, jvesely, llvm-commits

Tags: #llvm

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

llvm-svn: 358681

5 years agoFix a bug in SCEV's isSafeToExpand around speculation safety
Philip Reames [Thu, 18 Apr 2019 16:10:21 +0000 (16:10 +0000)]
Fix a bug in SCEV's isSafeToExpand around speculation safety

isSafeToExpand was making a common, but dangerously wrong, mistake in assuming that if any instruction within a basic block executes, that all instructions within that block must execute.  This can be trivially shown to be false by considering the following small example:
bb:
  add x, y  <-- InsertionPoint
  call @throws()
  udiv x, y <-- SCEV* S
  br ...

It's clearly not legal to expand S above the throwing call, but the previous logic would do so since S dominates (but not properlyDominates) the block containing the InsertionPoint.

Since iterating instructions w/in a block is expensive, this change special cases two cases: 1) S is an operand of InsertionPoint, and 2) InsertionPoint is the terminator of it's block.  These two together are enough to keep all current optimizations triggering while fixing the latent correctness issue.

As best I can tell, this is a silent bug in current ToT.  Given that, there's no tests with this change.  It was noticed in an upcoming optimization change (D60093), and was reviewed as part of that.  That change will include the test which caused me to notice the issue.  I'm submitting this seperately so that anyone bisecting a problem gets a clear explanation.

llvm-svn: 358680

5 years ago[Sema][NFC] Mark DR1563 as done (List-initialization and overloaded function disambig...
Bruno Ricci [Thu, 18 Apr 2019 15:45:08 +0000 (15:45 +0000)]
[Sema][NFC] Mark DR1563 as done (List-initialization and overloaded function disambiguation)

It has been supported since at least clang 3.1 so just mark it as done.

llvm-svn: 358679

5 years ago[Sema][NFC] Mark DR705 (Suppressing argument-dependent lookup via parentheses) as...
Bruno Ricci [Thu, 18 Apr 2019 15:34:03 +0000 (15:34 +0000)]
[Sema][NFC] Mark DR705 (Suppressing argument-dependent lookup via parentheses) as done

It was supported since at least clang 3 so just mark it as done.

llvm-svn: 358678

5 years ago[libc++] Unconditionally enable the __pad_and_output optimization
Louis Dionne [Thu, 18 Apr 2019 15:19:35 +0000 (15:19 +0000)]
[libc++] Unconditionally enable the __pad_and_output optimization

This used to be guarded on whether the deployment target was greater
than macosx10.8, however testing against the dylibs for 10.8 and earlier
with the function enabled works too. The revision that introduced
__pad_and_output is r164241 and it does not mention a reason for the
guard.

llvm-svn: 358677

5 years ago[analyzer][NFC] Use capital variable names, move methods out-of-line, rename some...
Kristof Umann [Thu, 18 Apr 2019 15:19:16 +0000 (15:19 +0000)]
[analyzer][NFC] Use capital variable names, move methods out-of-line, rename some in CheckerRegistry

There are barely any lines I haven't changed in these files, so I think I could
might as well leave it in an LLVM coding style conforming state. I also renamed
2 functions and moved addDependency out of line to ease on followup patches.

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

llvm-svn: 358676