platform/upstream/llvm.git
4 years ago[NFC][SanitizerCoverage] Simplify alignment calculation
Vitaly Buka [Thu, 9 Apr 2020 05:13:19 +0000 (22:13 -0700)]
[NFC][SanitizerCoverage] Simplify alignment calculation

This reverts commit e42f2a0cd8b8007c816d0e63f5000c444e29105e.

4 years ago[Attributor] Disable three tests until the SCC update bug was fixed
Johannes Doerfert [Thu, 9 Apr 2020 05:31:41 +0000 (00:31 -0500)]
[Attributor] Disable three tests until the SCC update bug was fixed

D76588 exposed an SCC update bug in three tests which manifests
sometimes, e.g., on this bot that runs expensive checks:
  http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23032/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Afp80.ll

We disable the tests temporarily to investigate.

4 years ago[gn build] Port a3dc9490004
LLVM GN Syncbot [Thu, 9 Apr 2020 05:18:49 +0000 (05:18 +0000)]
[gn build] Port a3dc9490004

4 years ago[X86] Add TSXLDTRK instructions.
WangTianQing [Thu, 9 Apr 2020 05:15:42 +0000 (13:15 +0800)]
[X86] Add TSXLDTRK instructions.

Summary: For more details about these instructions, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference

Reviewers: craig.topper, RKSimon, LuoYuanke

Reviewed By: craig.topper

Subscribers: mgorny, hiraditya, cfe-commits

Tags: #clang

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

4 years ago[Attributor] Unify testing (=updates,prefixes,run configurations,...)
Johannes Doerfert [Thu, 9 Apr 2020 00:04:57 +0000 (19:04 -0500)]
[Attributor] Unify testing (=updates,prefixes,run configurations,...)

When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.

Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }

Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.

Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.

An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.

Tests have been adjusted in the process but we tried to keep their
intend unchanged.

Reviewed By: sstefan1

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

4 years ago[CallGraphUpdater] Remove dead constants before replacing a function
Johannes Doerfert [Mon, 23 Mar 2020 06:09:49 +0000 (01:09 -0500)]
[CallGraphUpdater] Remove dead constants before replacing a function

Dead constants might be left when a function is replaced, we can
gracefully handle this case and avoid complexity for the users who would
see an assertion otherwise.

4 years ago[ORC] Make mangling convenience methods part of the public API of LLJIT.
Lang Hames [Thu, 9 Apr 2020 02:23:02 +0000 (19:23 -0700)]
[ORC] Make mangling convenience methods part of the public API of LLJIT.

This saves clients from having to manually construct a MangleAndInterner.

4 years ago[MLIR] ShapedType accessor minor fixes + add isDynamicDim accessor
Uday Bondhugula [Wed, 8 Apr 2020 07:01:48 +0000 (12:31 +0530)]
[MLIR] ShapedType accessor minor fixes + add isDynamicDim accessor

Minor fixes and cleanup for ShapedType accessors, use
ShapedType::kDynamicSize, add ShapedType::isDynamicDim.

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

4 years ago[lldb/Docs] Elaborate on reproducer testing
Jonas Devlieghere [Thu, 9 Apr 2020 00:35:05 +0000 (17:35 -0700)]
[lldb/Docs] Elaborate on reproducer testing

4 years agoMIR: Use Register
Matt Arsenault [Wed, 8 Apr 2020 21:25:21 +0000 (17:25 -0400)]
MIR: Use Register

4 years ago[mlir][NFC] Wrap the cl::opts in JitRunner within a struct to avoid global initializers.
River Riddle [Thu, 9 Apr 2020 01:33:24 +0000 (18:33 -0700)]
[mlir][NFC] Wrap the cl::opts in JitRunner within a struct to avoid global initializers.

Summary: This avoids the need for having global static initializers within the JITRunner support library, and only constructs the options when the runner is invoked.

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

4 years ago[WebAssembly][MC] Use StringRef over std::string pointer
Sam Clegg [Tue, 7 Apr 2020 21:02:20 +0000 (14:02 -0700)]
[WebAssembly][MC] Use StringRef over std::string pointer

This is followup based on feedback on 5be42f36f56.
See: https://reviews.llvm.org/D77627.

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

4 years ago[LoopVectorize] Move testing for SVML vectorization of exp2f_finite/exp2_finite from...
Craig Topper [Thu, 9 Apr 2020 01:04:28 +0000 (18:04 -0700)]
[LoopVectorize] Move testing for SVML vectorization of exp2f_finite/exp2_finite from svml-calls.ll to svml-calls-finite.ll where the finite versions of log, pow, and exp already were.

4 years ago[InstCombine] Avoid a call to deprecated version of CreateCall.
Craig Topper [Wed, 8 Apr 2020 23:59:36 +0000 (16:59 -0700)]
[InstCombine] Avoid a call to deprecated version of CreateCall.

Passing a Value * to CreateCall has to call getPointerElementType
to find the type of the pointer.

In this case we can rely on the fact that Intrinsic::getDeclaration
returns a Function * and use that version of CreateCall.

4 years ago[Attributor][NFC] Split AbstractAttributes out of Attributor.cpp
Johannes Doerfert [Wed, 8 Apr 2020 22:24:24 +0000 (17:24 -0500)]
[Attributor][NFC] Split AbstractAttributes out of Attributor.cpp

Attributor.cpp became quite big and we need to start provide structure.
The Attributor code is now in Attributor.cpp and the classes derived
from AbstractAttribute are in AttributorAttributes.cpp. Minor changes
were required but no intended functional changes.

We also minimized includes as part of this.

Reviewed By: baziotis

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

4 years ago[mlir] Mark ClassID::getID as LLVM_EXTERNAL_VISIBILITY to ensure only one version...
River Riddle [Wed, 8 Apr 2020 23:51:26 +0000 (16:51 -0700)]
[mlir] Mark ClassID::getID as LLVM_EXTERNAL_VISIBILITY to ensure only one version exists

Summary: ClassID is used as a type id and must be unique in the face of shared libraries to ensure correctness. This fixes failures related to BUILD_SHARED_LIBs on macos.

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

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Wed, 8 Apr 2020 23:17:08 +0000 (16:17 -0700)]
Clean up usages of asserting vector getters in Type

Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: espindola, efriedma, sdesmalen

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Wed, 8 Apr 2020 22:27:41 +0000 (15:27 -0700)]
Clean up usages of asserting vector getters in Type

Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: hfinkel, efriedma, sdesmalen

Reviewed By: efriedma

Subscribers: wuzish, nemanjai, hiraditya, kbarton, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Python] Add lldbconfig module to make the lldb module configurable
Jonas Devlieghere [Wed, 8 Apr 2020 22:34:13 +0000 (15:34 -0700)]
[lldb/Python] Add lldbconfig module to make the lldb module configurable

Using the approach suggested by Pavel in D77588, this patch introduces a
new lldbconfig module that lives next to the lldb module. It makes it
possible to make the lldb module configurable before importing it. More
specifically it makes it possible to delay initializing the debugger,
which is needed for testing the reproducer.

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

4 years ago[mlir] Remove need for static global ctors from mlir-translate
Jonathan Roelofs [Sun, 5 Apr 2020 20:42:16 +0000 (14:42 -0600)]
[mlir] Remove need for static global ctors from mlir-translate

Summary: https://bugs.llvm.org/show_bug.cgi?id=45436

Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer

Reviewed By: mehdi_amini, rriddle, stephenneuendorffer

Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits

Tags: #llvm

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

4 years ago[libc++] Fix failing concepts tests
Eric Fiselier [Wed, 8 Apr 2020 22:25:01 +0000 (18:25 -0400)]
[libc++] Fix failing concepts tests

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Wed, 8 Apr 2020 17:42:22 +0000 (10:42 -0700)]
Clean up usages of asserting vector getters in Type

Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: sdesmalen, rriddle, efriedma

Reviewed By: sdesmalen

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoFix -Wdeprecated-copy warning in XcodeSDK.
Eric Christopher [Wed, 8 Apr 2020 22:12:53 +0000 (15:12 -0700)]
Fix -Wdeprecated-copy warning in XcodeSDK.

4 years ago[libcxx] Adds [concept.same]
Eric Fiselier [Wed, 8 Apr 2020 22:00:13 +0000 (18:00 -0400)]
[libcxx] Adds [concept.same]

Patch from Christopher Di Bella (cjdb@google.com)
Reviewed as https://reviews.llvm.org/D74291

Adds `std::same_as` to libc++. Since there aren't clang-format rules for
//requires-expressions//, I'll need to disable the formatter in certain areas.

4 years agoGlobalISel: Add a setInstrAndDebugLoc(MachineInstr&) convenience helper to MachineIRB...
Amara Emerson [Wed, 8 Apr 2020 21:15:25 +0000 (14:15 -0700)]
GlobalISel: Add a setInstrAndDebugLoc(MachineInstr&) convenience helper to MachineIRBuilder. NFC.

This saves doing two separate calls to set the Instr and DebugLoc from an existing MI.

4 years ago[mlir][NFC] Wrap static DenseMap inside of a function to avoid the need for a global...
River Riddle [Wed, 8 Apr 2020 21:18:15 +0000 (14:18 -0700)]
[mlir][NFC] Wrap static DenseMap inside of a function to avoid the need for a global static initializer

This also helps to abstract away the exact implementation details of the loopup method if we wish to change it in the future.

4 years agoCodeGen: Use Register in MachineInstrBuilder
Matt Arsenault [Wed, 8 Apr 2020 20:37:44 +0000 (16:37 -0400)]
CodeGen: Use Register in MachineInstrBuilder

4 years ago[mlir][Linalg] Add a test for a fused Linalg pass based on DRR to go from matmul...
Nicolas Vasilache [Wed, 8 Apr 2020 18:53:37 +0000 (14:53 -0400)]
[mlir][Linalg] Add a test for a fused Linalg pass based on DRR to go from matmul to vectors

This revision builds a simple "fused pass" consisting of 2 levels of tiling, memory promotion and vectorization using linalg transformations written as composable pattern rewrites.

4 years ago[mlir][NFC] Remove cl::opts for LoopUnroll now that the pass uses PassOptions
River Riddle [Wed, 8 Apr 2020 20:23:13 +0000 (13:23 -0700)]
[mlir][NFC] Remove cl::opts for LoopUnroll now that the pass uses PassOptions
instead.

These were missed when the opts were replaced, and are unused.

4 years agoMake target features check work with ctor and dtor-
Erich Keane [Wed, 8 Apr 2020 20:14:33 +0000 (13:14 -0700)]
Make target features check work with ctor and dtor-

The problem was reported in PR45468, applying target features to an
always_inline constructor/destructor runs afoul of GlobalDecl
construction assert when checking for target-feature compatibility.

The core problem is fixed by using the version of the check that takes a
FunctionDecl rather than the GlobalDecl. However, while writing the
test, I discovered that source locations weren't properly set for this
check on ctors/dtors. This patch also fixes constructors and CALLED destructors.

Unfortunately, it doesn't seem too possible to get a meaningful source
location for a 'cleanup' destructor, so those are still 'frontend' level
errors unfortunately. A fixme was added to the test to cover that
situation.

4 years ago[libc++] CI: Always build for both i386 and x86_64 in the back-deployment script
Louis Dionne [Wed, 8 Apr 2020 20:05:02 +0000 (16:05 -0400)]
[libc++] CI: Always build for both i386 and x86_64 in the back-deployment script

4 years ago[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.
River Riddle [Wed, 8 Apr 2020 19:57:02 +0000 (12:57 -0700)]
[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.

Summary: Pass options are a better choice for various reasons and avoid the need for static constructors.

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

4 years ago[gn build] Port 8b67853a83c
LLVM GN Syncbot [Wed, 8 Apr 2020 20:00:26 +0000 (20:00 +0000)]
[gn build] Port 8b67853a83c

4 years ago[CFGPrinter] Adding heat coloring to CFGPrinter
Kirill Naumov [Tue, 31 Mar 2020 18:43:25 +0000 (18:43 +0000)]
[CFGPrinter] Adding heat coloring to CFGPrinter

This patch introduces the heat coloring of the Control Flow Graph which is based
on the relative "hotness" of each BB. The patch is a part of sequence of three
patches, related to graphs Heat Coloring.

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

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

4 years ago[clang][CodeGen] Handle throw expression in conditional operator constant folding
Raul Tambre [Wed, 8 Apr 2020 19:05:49 +0000 (12:05 -0700)]
[clang][CodeGen] Handle throw expression in conditional operator constant folding

Summary:
We're smart and do constant folding when emitting conditional operators.
Thus we emit the live value as a lvalue. This doesn't work if the live value is a throw expression.
Handle this by emitting the throw and returning the dead value as the lvalue.

Fixes PR28184.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

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

4 years agounittest: Disable MachineInstrClone.CopyCallSiteInfo entirely
Vedant Kumar [Wed, 8 Apr 2020 19:16:20 +0000 (12:16 -0700)]
unittest: Disable MachineInstrClone.CopyCallSiteInfo entirely

Somehow, details about the host architecture are creeping into the bogus
target set up in MFCommon.inc, causing call site info to be disabled:

http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/41476
http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/17987

Disable the test to unblock the bots until I can figure this out.

4 years agounittest: Disable MachineInstrClone.CopyCallSiteInfo on Windows
Vedant Kumar [Wed, 8 Apr 2020 19:09:01 +0000 (12:09 -0700)]
unittest: Disable MachineInstrClone.CopyCallSiteInfo on Windows

A bot error (http://45.33.8.238/win/12463/step_11.txt) reports 'unknown
file: error: SEH exception with code 0x3221225477 thrown in the test
body', but I don't know what causes this.

It looks like this has come up before, but afaict the root causes could
be different:

  https://reviews.llvm.org/rL329195, and in
  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180910/587425.html

I tried testing locally with UBSan, but that didn't uncover anything.

4 years ago[Driver] Default arm-linux-androideabi to -z max-page-size=4096
Fangrui Song [Wed, 8 Apr 2020 17:22:09 +0000 (10:22 -0700)]
[Driver] Default arm-linux-androideabi to -z max-page-size=4096

Similar to D55029. The requirement arises when discussing increasing
default max-page-size for lld ARM (D77330).

For the record, the default max-page-size on the 3 commonly used linkers:

* GNU ld since 2014 (https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7572ca8989ead4c3425a1500bc241eaaeffa2c89) defaults to 65536
* GNU gold remains 4096
* lld<=10 uses 4096. lld from 11 onwards will use 65536 (D77330)

Reviewed By: srhines, thieta

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

4 years ago[libc++] Update the documentation for running Lit to reflect reality
Louis Dionne [Tue, 7 Apr 2020 19:02:37 +0000 (15:02 -0400)]
[libc++] Update the documentation for running Lit to reflect reality

Our documentation for running LIT is basically wrong, since it doesn't
mention `llvm-lit`, and nothing works without it. Note that this
documentation improvement reflects the current reality outside of
the recent efforts on improving the test suite. My goal is to document
the current way of running the test suite, so that everybody agrees on
how things currently work. As the configuration system for libc++ gets
simplified, we can come back and keep this documentation up to date to
reflect those changes.

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

4 years agoFirst test commit - empty
Michael Wyman [Wed, 8 Apr 2020 18:31:51 +0000 (11:31 -0700)]
First test commit - empty

4 years agoCodeGen: Use Register in MachineSSAUpdater
Matt Arsenault [Wed, 8 Apr 2020 17:50:35 +0000 (13:50 -0400)]
CodeGen: Use Register in MachineSSAUpdater

4 years ago[CUDA] Improve testing of libdevice detection.
Artem Belevich [Tue, 7 Apr 2020 22:51:23 +0000 (15:51 -0700)]
[CUDA] Improve testing of libdevice detection.

Added new testcases for libdevice in CUDA-9+ and removed unused checks.

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

4 years ago[CUDA] Add partial support for recent CUDA versions.
Artem Belevich [Tue, 7 Apr 2020 18:00:19 +0000 (11:00 -0700)]
[CUDA] Add partial support for recent CUDA versions.

Generate PTX using newer versions of PTX and allow using sm_80 with CUDA-11.
None of the new features of CUDA-10.2+ have been implemented yet, so using these
versions will still produce a warning.

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

4 years ago[CUDA] Simplify GPU variant handling. NFC.
Artem Belevich [Mon, 6 Apr 2020 22:21:24 +0000 (15:21 -0700)]
[CUDA] Simplify GPU variant handling. NFC.

Instead of hardcoding individual GPU mappings in multiple functions, keep them
all in one table and use it to look up the mappings.

We also don't care about 'virtual' architecture much, so the API is trimmed down
down to a simpler GPU->Virtual arch name lookup.

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

4 years ago[DWARF] Not all the constant variables are "static".
Davide Italiano [Wed, 8 Apr 2020 18:06:00 +0000 (11:06 -0700)]
[DWARF] Not all the constant variables are "static".

Fixes rdar://problem/61402307

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

4 years agoMachineFunction: Copy call site info when duplicating insts
Vedant Kumar [Tue, 7 Apr 2020 20:09:29 +0000 (13:09 -0700)]
MachineFunction: Copy call site info when duplicating insts

Summary:
Preserve call site info for duplicated instructions. We copy over the
call site info in CloneMachineInstrBundle to avoid repeated calls to
copyCallSiteInfo in CloneMachineInstr.

(Alternatively, we could copy call site info higher up the stack, e.g.
into TargetInstrInfo::duplicate, or even into individual backend passes.
However, I don't see how that would be safer or more general than the
current approach.)

Reviewers: aprantl, djtodoro, dstenb

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[commands] Support autorepeat in SBCommands
Walter Erquinigo [Sat, 4 Apr 2020 00:16:15 +0000 (17:16 -0700)]
[commands] Support autorepeat in SBCommands

Summary:
This adds support for commands created through the API to support autorepeat.
This covers the case of single word and multiword commands.

Comprehensive tests are included as well.

Reviewers: labath, clayborg

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoFix e796c77b26acab0b530ac6516f1dda21b8494733
Walter Erquinigo [Wed, 8 Apr 2020 17:46:30 +0000 (10:46 -0700)]
Fix e796c77b26acab0b530ac6516f1dda21b8494733

Failure:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/14556/testReport/junit/lldb-api/tools_lldb-vscode_breakpoint-events/TestVSCode_breakpointEvents_py/

Diff:
[lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request
https://reviews.llvm.org/D76968

It failed a test TestVSCode_breakpointEvents that only runs Darwin that needed to be updated to match the current logic.
The change is simple.

4 years agoDAG: Use Register
Matt Arsenault [Wed, 8 Apr 2020 16:26:32 +0000 (12:26 -0400)]
DAG: Use Register

4 years ago[PowerPC][AIX][NFC] Replace deprecated getByValAlign call.
Sean Fertile [Wed, 8 Apr 2020 17:25:06 +0000 (13:25 -0400)]
[PowerPC][AIX][NFC] Replace deprecated getByValAlign call.

Replace call to deprecated 'getByValAlign()' with
'getNonZeroByValAlign()'.

4 years ago[libc][NFC] Make all top of file comments consistent.
Paula Toth [Wed, 8 Apr 2020 17:16:30 +0000 (10:16 -0700)]
[libc][NFC] Make all top of file comments consistent.

Summary:
Made all header files consistent based of this documentation: https://llvm.org/docs/CodingStandards.html#file-headers.
And did the same for all source files top of file comments.

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra, abrachet

Subscribers: MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years ago[InstCombine] Regenerate phi-preserve-ir-flags.ll test checks to fix issue reported...
Simon Pilgrim [Wed, 8 Apr 2020 17:12:55 +0000 (18:12 +0100)]
[InstCombine] Regenerate phi-preserve-ir-flags.ll test checks to fix issue reported on D77354

4 years agoFix __is_pointer builtin type trait to work with Objective-C pointer types.
zoecarver [Wed, 8 Apr 2020 17:01:14 +0000 (10:01 -0700)]
Fix __is_pointer builtin type trait to work with Objective-C pointer types.

Summary: 5ade17e broke __is_pointer for Objective-C pointer types. This patch fixes the builtin and re-applies the change to type_traits.

Tags: #clang, #libc

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

4 years ago[PowerPC] Regenerate optcmp.ll test checks to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 16:52:26 +0000 (17:52 +0100)]
[PowerPC] Regenerate optcmp.ll test checks to fix issue reported on D77354

4 years ago[lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request
Walter Erquinigo [Sat, 28 Mar 2020 02:31:14 +0000 (19:31 -0700)]
[lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request

Summary:
When using source maps for a breakpoint, in order to find the actual source that breakpoint has resolved, we
need to use a query similar to what CommandObjectSource::DumpLinesInSymbolContexts does, which is the logic
used by the CLI to display the source line at a given breakpoint. That's necessary because from a breakpoint
location you only have an address, which points to the original source location, not the source mapped one.

in the setBreakpoints request handler, we haven't been doing such query and we were returning the original
source location, which was breaking the UX of VSCode, as many breakpoints were being set but not displayed
in the source file next to each line. Besides, clicking the source path of a breakpoint in the breakpoints
view in the debug tab was not working for this case, as VSCode was trying to open a non-existent file, thus
showing an error to the user.

Ideally, we should do the query mentioned above to find the actual source location to respond to the IDE,
however, that query is expensive and users can have an arbitrary number of breakpoints set. As a simpler fix,
the request sent by VSCode already contains the full source path, which exists because the user set it from
the IDE itself, so we can simply reuse it instead of querying from the SB API.

I wrote a test for this, and found out that I had to move SetSourceMapFromArguments after RunInitCommands in
lldb-vscode.cpp, because an init command used in all tests is `settings clear -all`, which would clear the
source map unless specified after initCommands. And in any case, I think it makes sense to have initCommands
run before anything the debugger would do.

Reviewers: clayborg, kusmour, labath, aadsm

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[MLIR] Fix test case typos in unroll.mlir
Uday Bondhugula [Wed, 8 Apr 2020 16:09:43 +0000 (21:39 +0530)]
[MLIR] Fix test case typos in unroll.mlir

Fix check line typos in test/Dialect/Affine/unroll.mlir.

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

4 years ago[libc++] Remove std::optional from ObjC is_scalar test.
zoecarver [Wed, 8 Apr 2020 16:40:33 +0000 (09:40 -0700)]
[libc++] Remove std::optional from ObjC is_scalar test.

std::optional requires C++17. Instead of only running the test above
C++14, this commit removes uses of std::optional from the test (it's
already tested in block.objc.pass.mm).

4 years ago[PowerPC] Fix fold-rlwinm.mir typos in checks to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 16:34:28 +0000 (17:34 +0100)]
[PowerPC] Fix fold-rlwinm.mir typos in checks to fix issue reported on D77354

4 years ago[ELF] --warn-backrefs: don't warn if -u/--export-dynamic-symbol
Fangrui Song [Tue, 7 Apr 2020 04:12:19 +0000 (21:12 -0700)]
[ELF] --warn-backrefs: don't warn if -u/--export-dynamic-symbol

Reviewed By: grimar

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

4 years ago[RDA] Try to fix build, again (NFC)
Nikita Popov [Wed, 8 Apr 2020 16:29:55 +0000 (18:29 +0200)]
[RDA] Try to fix build, again (NFC)

4 years ago[PowerPC] Fix fold-frame-offset-using-rr.mir typos in checks to fix issue reported...
Simon Pilgrim [Wed, 8 Apr 2020 16:17:44 +0000 (17:17 +0100)]
[PowerPC] Fix fold-frame-offset-using-rr.mir typos in checks to fix issue reported on D77354

Extra spaces, copy+paste duplicates and missing test name check

4 years ago[RDA] Try to fix build (NFC)
Nikita Popov [Wed, 8 Apr 2020 16:13:24 +0000 (18:13 +0200)]
[RDA] Try to fix build (NFC)

fuchsia-x86_64-linux builder fails with:

/b/fuchsia-x86_64-linux/llvm.src/llvm/include/llvm/ADT/TinyPtrVector.h:85:15:
error: no matching conversion for C-style cast from 'nullptr_t' to 'llvm::ReachingDef'
    RHS.Val = (EltTy)nullptr;

Let's see whether adding an explicit nullptr_t constructor helps.

4 years agoFastISel: Partially use Register
Matt Arsenault [Wed, 8 Apr 2020 14:57:11 +0000 (10:57 -0400)]
FastISel: Partially use Register

Doesn't try to convert the cases that depend on generated code.

4 years agoCodeGen: Use Register more in CallLowering
Matt Arsenault [Wed, 8 Apr 2020 14:49:37 +0000 (10:49 -0400)]
CodeGen: Use Register more in CallLowering

Some of these MCPhysReg uses should probably be MCRegister, but right
now this would require more invasive changes.

4 years agoCodeGen: Use Register in MachineBasicBlock
Matt Arsenault [Wed, 8 Apr 2020 14:40:26 +0000 (10:40 -0400)]
CodeGen: Use Register in MachineBasicBlock

4 years agoCodeGen: Use Register in TargetLowering
Matt Arsenault [Wed, 8 Apr 2020 14:29:30 +0000 (10:29 -0400)]
CodeGen: Use Register in TargetLowering

4 years ago[AMDGPU] Refresh fmin_legacy.ll checks to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 16:05:14 +0000 (17:05 +0100)]
[AMDGPU] Refresh fmin_legacy.ll checks to fix issue reported on D77354

Some of the condition codes had inverted since this was generated

4 years ago[TimePasses] Small fix in "-time-passes" flag that makes it more stable
Kirill Naumov [Fri, 27 Mar 2020 18:38:32 +0000 (18:38 +0000)]
[TimePasses] Small fix in "-time-passes" flag that makes it more stable

Adds StringMap for TimingData.

Differential Revision: https://reviews.llvm.org/D76946
Reviewed By: fedor.sergeev

4 years ago[MLIR][Vector] Update ShapeCastOp folder to use producer-consumer value forwarding.
Andy Davis [Wed, 8 Apr 2020 15:39:48 +0000 (08:39 -0700)]
[MLIR][Vector] Update ShapeCastOp folder to use producer-consumer value forwarding.

Summary:
Update ShapeCastOp folder to use producer-consumer value forwarding.
Support is added for tracking sub-vectors through trivial shape cast operations,
where the sub-vector shape is preserved across shape cast operations and only
leading ones are added or removed.
Support is preserved for cancelling shape cast operations.
One unit test is added and two are updated.

Reviewers: aartbik, nicolasvasilache

Reviewed By: aartbik, nicolasvasilache

Subscribers: frgossen, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, llvm-commits

Tags: #llvm

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

4 years ago[RDA] Use TinyPtrVector to store reaching defs (NFCI)
Nikita Popov [Sun, 5 Apr 2020 15:59:57 +0000 (17:59 +0200)]
[RDA] Use TinyPtrVector to store reaching defs (NFCI)

RDA currently uses SmallVector<int, 1> to store reaching definitions.
A SmallVector<int, 1> is 24 bytes large, and X86 currently has
164 register units, which means we need 3936 bytes per block.
If you have a large function with 1000 blocks, that's already 4MB.

A large fraction of these reg units will not have any reaching defs
(say, those corresponding to zmm registers), and many will have just
one. A TinyPtrVector serves this use-case much better, as it only
needs 8 bytes per register if it has 0 or 1 reaching defs.

As the name implies, TinyPtrVector is designed to work with pointers,
so we need to add some boilerplate to treat our reaching def integers
as pointers, using an appropriate encoding. We need to keep the low
bit free for tagging, and make sure at least one bit is set to
distinguish the null pointer.

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

4 years ago[PowerPC][AIX] Enable passing byval formal arguments in multiple registers.
Sean Fertile [Tue, 24 Mar 2020 17:17:22 +0000 (13:17 -0400)]
[PowerPC][AIX] Enable passing byval formal arguments in multiple registers.

Any or all the argument registers can be used to pass a byval formal
argument, with the limitation that the argument must fit in the
available registers (ie: is not split between registers and stack).

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

4 years ago[ARM] Fix thumb1_return_sequence typo in check to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 15:00:32 +0000 (16:00 +0100)]
[ARM] Fix thumb1_return_sequence typo in check to fix issue reported on D77354

4 years ago[libunwind] Fix incorrect lit substitutions in tests
Louis Dionne [Wed, 8 Apr 2020 14:48:22 +0000 (10:48 -0400)]
[libunwind] Fix incorrect lit substitutions in tests

The LIT substitutions used in libunwind are the same as those from
libc++, and we forgot to update the libunwind tests after the libc++
substitutions started being delimited by braces.

4 years ago[ARM] Fix misched-int-basic-thumb2.mir typo in check to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 14:48:18 +0000 (15:48 +0100)]
[ARM] Fix misched-int-basic-thumb2.mir typo in check to fix issue reported on D77354

4 years ago[Fixed Point] Add triples to test cases.
Bevin Hansson [Wed, 8 Apr 2020 14:28:31 +0000 (16:28 +0200)]
[Fixed Point] Add triples to test cases.

This was causing some test failures.

4 years ago[AARCH64][GISEL] arm64-fallback.ll - Refresh remarks to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 14:28:41 +0000 (15:28 +0100)]
[AARCH64][GISEL] arm64-fallback.ll - Refresh remarks to fix issue reported on D77354

4 years ago[DSE,MSSA] Add additional test cases for multi-path elimination (NFC).
Florian Hahn [Wed, 8 Apr 2020 14:23:58 +0000 (15:23 +0100)]
[DSE,MSSA] Add additional test cases for multi-path elimination (NFC).

This adds additional test cases for more scenarios and also with objects
that are accessible after the functions return and allocas.

4 years ago[X86] Fix x86-header-warnings.c test not detecting regressions as intended.
Pierre Gousseau [Wed, 8 Apr 2020 14:15:39 +0000 (15:15 +0100)]
[X86] Fix x86-header-warnings.c test not detecting regressions as intended.

Use -verify -fsyntax-only and expected-no-diagnostics as
recommended by Paul.

Reviewed By: probinson

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

4 years ago[MemorySSA] invariant-groups.ll - add missing check to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 14:17:48 +0000 (15:17 +0100)]
[MemorySSA] invariant-groups.ll - add missing check to fix issue reported on D77354

4 years ago[DSE.MSSA] Only use callCapturesBefore for calls.
Florian Hahn [Wed, 8 Apr 2020 13:22:43 +0000 (14:22 +0100)]
[DSE.MSSA] Only use callCapturesBefore for calls.

callCapturesBefore always returns ModRef , if UseInst isn't a call. As
we only call it if we already know Mod is set, this only destroys the
Must bit for non-calls.

4 years ago[DSE,MSSA] Hoist getMemoryAccess call (NFC).
Florian Hahn [Wed, 8 Apr 2020 13:17:48 +0000 (14:17 +0100)]
[DSE,MSSA] Hoist getMemoryAccess call (NFC).

4 years ago[llvm-exegesis] Fix build with !HAS_LIBPFM.
Clement Courbet [Wed, 8 Apr 2020 14:01:24 +0000 (16:01 +0200)]
[llvm-exegesis] Fix build with !HAS_LIBPFM.

Fixes 9fb871866e2b.

4 years ago[CodeExtractor] Fix typo in check label to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 13:59:01 +0000 (14:59 +0100)]
[CodeExtractor] Fix typo in check label to fix issue reported on D77354

4 years ago[MLIR] Fix more gcc-5 build issues from D77528
Uday Bondhugula [Wed, 8 Apr 2020 13:41:43 +0000 (19:11 +0530)]
[MLIR] Fix more gcc-5 build issues from D77528

820c420d4e1c630b5ead285917c6ecdd2f5092ad did not really fix all build
issues by D77528. This gets rid of two unnecessary 'using' declarations.

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

4 years ago[DWARFLinker][dsymutil] followup for 88c2137b6d49f88186d0957a4e2d8030a3967334
Alexey Lapshin [Wed, 8 Apr 2020 12:21:21 +0000 (15:21 +0300)]
[DWARFLinker][dsymutil] followup for 88c2137b6d49f88186d0957a4e2d8030a3967334

That patch is a followup for "Move DwarfStreamer into DWARFLinker".
It fixes build with LLVM_LINK_LLVM_DYLIB.

4 years ago[llvm-exegesis][NFC] Let the pfm::Counter own the PerfHelper.
Clement Courbet [Wed, 8 Apr 2020 12:37:38 +0000 (14:37 +0200)]
[llvm-exegesis][NFC] Let the pfm::Counter own the PerfHelper.

A perf helper is always only ever cretaed to be checked for validity
then passed as Counter ctor argument, never to be touched again.
Its lifetime should outlive that of the counter, and there is never any
reason to have two different counters of top of the perf helper.
Make sure these assumptions always hold by making the Counter consume the
PerfHelper.

4 years ago[Parser] Improve diagnostic and error recovery when C++ keywords are used as identifiers.
Haojian Wu [Wed, 8 Apr 2020 13:08:48 +0000 (15:08 +0200)]
[Parser] Improve diagnostic and error recovery when C++ keywords are used as identifiers.

Summary:
Previously, clang emitted a less-usefull diagnostic and didnt recover
well when the keywords is used as identifier in function paramter.

```
void foo(int case, int x); // previously we drop all parameters after
`int case`.
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[PowerPC][Future] Add Support For Functions That Do Not Use A TOC.
Stefan Pintilie [Wed, 8 Apr 2020 13:07:35 +0000 (08:07 -0500)]
[PowerPC][Future] Add Support For Functions That Do Not Use A TOC.

On PowerPC most functions require a valid TOC pointer.

This is the case because either the function itself needs to use this
pointer to access the TOC or because other functions that are called
from that function expect a valid TOC pointer in the register R2.
The main exception to this is leaf functions that do not access the TOC
since they are guaranteed not to need a valid TOC pointer.

This patch introduces a feature that will allow more functions to not
require a valid TOC pointer in R2.

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

4 years ago[libc++] Explicitly specify that we use libc++abi in Apple's cache
Louis Dionne [Wed, 8 Apr 2020 13:03:58 +0000 (09:03 -0400)]
[libc++] Explicitly specify that we use libc++abi in Apple's cache

4 years ago[LangRef] update text for shufflevector
Sanjay Patel [Wed, 8 Apr 2020 13:01:01 +0000 (09:01 -0400)]
[LangRef] update text for shufflevector

D72467 updated the shufflevector instruction to include a constant mask
rather than a mask operand. The LangRef text was vague enough to still
make sense, but it is better to update here too, so there's no confusion
about valid mask values. The text here is adapted from the documentation
code comments for "class ShuffleVectorInst".

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

4 years ago[InstCombine] exclude bitcast of ppc_fp128 in icmp signbit fold
Sanjay Patel [Wed, 8 Apr 2020 12:54:28 +0000 (08:54 -0400)]
[InstCombine] exclude bitcast of ppc_fp128 in icmp signbit fold

Based on the post-commit comments for rG0f56bbc, there might
be a problem with this transform:

(bitcast (fpext/fptrunc X)) to iX) < 0 --> (bitcast X to iY) < 0

...and the ppc_fp128 data type, so conservatively bypass if we
are bitcasting a ppc_fp128.

We might be able to account for endian or other differences to
enable this for PowerPC again if that is useful.

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

4 years ago[libTooling] Simplify the representation of Transformer's RewriteRules.
Yitzhak Mandelbaum [Fri, 3 Apr 2020 17:10:51 +0000 (13:10 -0400)]
[libTooling] Simplify the representation of Transformer's RewriteRules.

Summary:
This revision simplifies the representation of edits in rewrite rules. The
simplified form is more general, allowing the user more flexibility in building
custom edit specifications.

The changes extend the API, without changing the signature of existing
functions. So this only risks breaking users that directly accessed the
`RewriteRule` struct.

Reviewers: gribozavr2

Subscribers: jfb, cfe-commits

Tags: #clang

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

4 years ago[AST] Compress the FixedPointSemantics type better.
Bevin Hansson [Thu, 23 Jan 2020 08:16:31 +0000 (09:16 +0100)]
[AST] Compress the FixedPointSemantics type better.

Reviewers: rjmccall, leonardchan, bjope

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[CodeGen] Emit IR for compound assignment with fixed-point operands.
Bevin Hansson [Wed, 8 Jan 2020 13:01:30 +0000 (14:01 +0100)]
[CodeGen] Emit IR for compound assignment with fixed-point operands.

Reviewers: rjmccall, leonardchan

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[CodeGen] Emit IR for fixed-point unary operators.
Bevin Hansson [Wed, 8 Jan 2020 10:12:55 +0000 (11:12 +0100)]
[CodeGen] Emit IR for fixed-point unary operators.

Reviewers: rjmccall, leonardchan

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[CodeGen] Emit IR for fixed-point multiplication and division.
Bevin Hansson [Tue, 19 Nov 2019 12:15:06 +0000 (13:15 +0100)]
[CodeGen] Emit IR for fixed-point multiplication and division.

Reviewers: rjmccall, leonardchan

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[llvm-exegesis][NFC] Remove dead code.
Clement Courbet [Wed, 8 Apr 2020 12:17:57 +0000 (14:17 +0200)]
[llvm-exegesis][NFC] Remove dead code.

4 years ago[compiler-rt] Don't use __libc_stack_end on ARM
Ilya Leoshkevich [Wed, 8 Apr 2020 12:25:20 +0000 (14:25 +0200)]
[compiler-rt] Don't use __libc_stack_end on ARM

Summary:
Commit b684c1a50f70 ("Add a `Symbolizer::GetEnvP()` method that allows
symbolizer implementations to customise the environment of the
symbolizer binary.") exposed a latent ARM issue, and that broke

http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-full-sh

This coincided with breakage caused by my commit 5f5fb56c68e4
("[compiler-rt] Intercept the uname() function"), so I had to
investigate.

The issue is that GetArgsAndEnv does not work on ARM: there glibc's
_start overwrites argc value stored at __libc_start_end, breaking the
existing argv/envp parsing logic.

Fix by inferring argc from argv.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

Subscribers: dberris, kristof.beyls, danielkiss, #sanitizers, delcypher

Tags: #sanitizers

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

4 years ago[clangd] Add missing GoToStmt in FindTarget.
Haojian Wu [Wed, 8 Apr 2020 09:03:50 +0000 (11:03 +0200)]
[clangd] Add missing GoToStmt in FindTarget.

Summary: so that go-to-def on label can work.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[AMDGPU] Regenerate vector-extract-insert test checks to fix issue reported on D77354
Simon Pilgrim [Wed, 8 Apr 2020 12:18:32 +0000 (13:18 +0100)]
[AMDGPU] Regenerate vector-extract-insert test checks to fix issue reported on D77354