platform/upstream/llvm.git
5 years agoEnsure __config_site definitions are passed to modules tests.
Eric Fiselier [Mon, 29 Jul 2019 22:48:34 +0000 (22:48 +0000)]
Ensure __config_site definitions are passed to modules tests.

The test configuration contained a bug where we only raised
the __config_site commands to the command line if modules were
enabled for all of the libc++ tests. However there are special
modules-only tests, and these tests weren't getting the correct
defines.

This patch corrects that issue.

llvm-svn: 367267

5 years ago[llvm-lipo] Fix test on Windows
Anusha Basana [Mon, 29 Jul 2019 22:27:27 +0000 (22:27 +0000)]
[llvm-lipo] Fix test on Windows

Error message outputs with lowercase on Windows.
Made test work on Widnows.

For example:
llvm-lipo: error: 'i386': no such file or directory

llvm-svn: 367266

5 years agoRevert "[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray...
Francis Visoiu Mistrih [Mon, 29 Jul 2019 22:08:12 +0000 (22:08 +0000)]
Revert "[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)"

This reverts commit r367250. It's failing on green dragon:
http://lab.llvm.org:8080/green/job/clang-stage1-RA/482/console.

llvm-svn: 367265

5 years ago[clang-doc] Fix failing tests on Windows
Diego Astiazaran [Mon, 29 Jul 2019 22:03:39 +0000 (22:03 +0000)]
[clang-doc] Fix failing tests on Windows

Tests on Windows were failing due to path separator differences.
Links in HTML should use posix-style paths.

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

llvm-svn: 367264

5 years ago[clang-tidy]: Google: new check 'google-upgrade-googletest-case'
Eric Fiselier [Mon, 29 Jul 2019 21:38:56 +0000 (21:38 +0000)]
[clang-tidy]: Google: new check 'google-upgrade-googletest-case'

Introduce a new check to upgrade user code based on API changes in Googletest.

The check finds uses of old Googletest APIs with "case" in their name and replaces them with the new APIs named with "suite".

Patch by Alex Strelnikov (strel@google.com)
Reviewed as D62977.

llvm-svn: 367263

5 years ago[Symbolication] Remove some dead code. Nothing exciting.
Davide Italiano [Mon, 29 Jul 2019 21:25:51 +0000 (21:25 +0000)]
[Symbolication] Remove some dead code. Nothing exciting.

llvm-svn: 367262

5 years ago[Symbolication] Remove a duplicate assignment.
Davide Italiano [Mon, 29 Jul 2019 21:25:45 +0000 (21:25 +0000)]
[Symbolication] Remove a duplicate assignment.

llvm-svn: 367261

5 years ago[Symbolication] Fix unicode compatibility between 2 and 3.
Davide Italiano [Mon, 29 Jul 2019 21:25:37 +0000 (21:25 +0000)]
[Symbolication] Fix unicode compatibility between 2 and 3.

Triples are always ASCII for now, but we were handed out a
unicode object.

<rdar://problem/53592772>

llvm-svn: 367260

5 years agogit-llvm: Restore compatibility with git 1.8.3.
James Y Knight [Mon, 29 Jul 2019 21:01:11 +0000 (21:01 +0000)]
git-llvm: Restore compatibility with git 1.8.3.

llvm-svn: 367259

5 years ago[Reproducers] Pass FileCollector around as a shared_ptr (NFC)
Jonas Devlieghere [Mon, 29 Jul 2019 20:54:02 +0000 (20:54 +0000)]
[Reproducers] Pass FileCollector around as a shared_ptr (NFC)

Instead of passing the FileCollector around as a reference or raw
pointer, use a shared_ptr. This change's motivation is twofold. First it
adds compatibility for the newly added `FileCollectorFileSystem`.
Secondly, it addresses a lifetime issue we only see when LLDB is used
from Xcode, where a reference to the FileCollector outlives the
reproducer instance.

llvm-svn: 367258

5 years ago[IR] Consolidate fixed metadata kind definitions (NFC)
Vedant Kumar [Mon, 29 Jul 2019 20:24:20 +0000 (20:24 +0000)]
[IR] Consolidate fixed metadata kind definitions (NFC)

Put the list of fixed metadata kinds in one place.

Testing: check-llvm with+without LLVM_ENABLE_MODULES=On

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

llvm-svn: 367257

5 years ago[driver][test] Use /dev/null in as-options.s instead
Jordan Rupprecht [Mon, 29 Jul 2019 20:09:20 +0000 (20:09 +0000)]
[driver][test] Use /dev/null in as-options.s instead

llvm-svn: 367256

5 years agoGive the 'signed/unsigned wchar_t' extension a warning flag, and follow
Richard Smith [Mon, 29 Jul 2019 20:00:46 +0000 (20:00 +0000)]
Give the 'signed/unsigned wchar_t' extension a warning flag, and follow
GCC 9 in promoting it to an error by default.

llvm-svn: 367255

5 years agoWhen determining whether a lambda-expression is implicitly constexpr,
Richard Smith [Mon, 29 Jul 2019 19:59:45 +0000 (19:59 +0000)]
When determining whether a lambda-expression is implicitly constexpr,
check the formal rules rather than seeing if the normal checks produce a
diagnostic.

This fixes the handling of C++2a extensions in lambdas in C++17 mode,
as well as some corner cases in earlier language modes where we issue
diagnostics for things other than not satisfying the formal constexpr
requirements.

llvm-svn: 367254

5 years ago[driver][test] Update as-options.s to not write to a readonly tree
Jordan Rupprecht [Mon, 29 Jul 2019 19:57:31 +0000 (19:57 +0000)]
[driver][test] Update as-options.s to not write to a readonly tree

The as-options.s test writes to the build tree as of r367165. Some build systems configure this to be readonly, so this fails. Explicitly write to the output tree using `%t` to avoid this.

llvm-svn: 367253

5 years ago[PowerPC][NFC]Fix a typo in comment.
Jinsong Ji [Mon, 29 Jul 2019 19:27:54 +0000 (19:27 +0000)]
[PowerPC][NFC]Fix a typo in comment.

llvm-svn: 367252

5 years ago[X86] Fix typo in comment. We're looking at a right shift not a left shift. NFC
Craig Topper [Mon, 29 Jul 2019 19:22:51 +0000 (19:22 +0000)]
[X86] Fix typo in comment. We're looking at a right shift not a left shift. NFC

llvm-svn: 367251

5 years ago[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)
Puyan Lotfi [Mon, 29 Jul 2019 19:21:58 +0000 (19:21 +0000)]
[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)

Second attempt.

Haven't found a better way to pass the libcxx include path for building
compiler-rt with libcxx; this seems to be missing only for xray.

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

llvm-svn: 367250

5 years agoFix taint-generic.c on Windows, handle case in OS error
Reid Kleckner [Mon, 29 Jul 2019 18:48:50 +0000 (18:48 +0000)]
Fix taint-generic.c on Windows, handle case in OS error

llvm-svn: 367249

5 years ago[llvm-lipo] Implement -replace
Anusha Basana [Mon, 29 Jul 2019 18:46:34 +0000 (18:46 +0000)]
[llvm-lipo] Implement -replace

Replaces specified architecture in universal binary input file with
slice from the file_name argument passed into the replace command.

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

llvm-svn: 367248

5 years agoTest load unloading of modules with libraries-svr4
Antonio Afonso [Mon, 29 Jul 2019 18:12:55 +0000 (18:12 +0000)]
Test load unloading of modules with libraries-svr4

Summary:
This doubles the 3 tests running right now on linux by also executing each test with libraries-svr4 enabled.
Not sure if there's a better way to do this as I had to copy/paste all the decorators as well...

Reviewers: labath, clayborg, xiaobai

Reviewed By: labath

Subscribers: srhines, lldb-commits

Tags: #lldb

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

llvm-svn: 367247

5 years ago[compiler-rt] Reverting r367239 (xray include path) to fix bot build breakage.
Puyan Lotfi [Mon, 29 Jul 2019 17:50:39 +0000 (17:50 +0000)]
[compiler-rt] Reverting r367239 (xray include path) to fix bot build breakage.

llvm-svn: 367246

5 years agogn build: Merge r367071
Vitaly Buka [Mon, 29 Jul 2019 17:48:02 +0000 (17:48 +0000)]
gn build: Merge r367071

> llvm-svn: 366289

llvm-svn: 367245

5 years ago[UpdateTestChecks] Emit warning when invalid value for -check-prefix(es) option
David Bolvansky [Mon, 29 Jul 2019 17:41:00 +0000 (17:41 +0000)]
[UpdateTestChecks] Emit warning when invalid value for -check-prefix(es) option

Summary:
The script is silent for the following issue:
FileCheck %s -check-prefix=CHECK,POPCOUNT

FileCheck will catch it later, but I think we can warn here too.

Now it warns:
 ./update_llc_test_checks.py file.ll
WARNING: Supplied prefix 'CHECK,POPCOUNT' is invalid. Prefix must contain only alphanumeric characters, hyphens and underscores. Did you mean --check-prefixes=CHECK,POPCOUNT?

Reviewers: lebedev.ri, spatel, RKSimon, craig.topper, nikic, gbedwell

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 367244

5 years ago[Remarks] Update error message format string
Francis Visoiu Mistrih [Mon, 29 Jul 2019 17:40:34 +0000 (17:40 +0000)]
[Remarks] Update error message format string

All the clang-cmake-armv{7,8} bots are failing this test. This is an
attempt to fix this.

llvm-svn: 367243

5 years agoThinLTOBitcodeWriter: Include globals associated with type metadata globals in the...
Peter Collingbourne [Mon, 29 Jul 2019 17:22:40 +0000 (17:22 +0000)]
ThinLTOBitcodeWriter: Include globals associated with type metadata globals in the merged module.

Globals that are associated with globals with type metadata need to appear
in the merged module because they will reference the global's section directly.

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

llvm-svn: 367242

5 years ago[lldb] Qualify includes of Properties[Enum].inc files. NFC
Jordan Rupprecht [Mon, 29 Jul 2019 17:22:10 +0000 (17:22 +0000)]
[lldb] Qualify includes of Properties[Enum].inc files. NFC

Summary:
This is a bit more explicit, and makes it possible to build LLDB without
varying the -I lines per-directory.
(The latter is useful because many build systems only allow this to be
configured per-library, and LLDB is insufficiently layered to be split into
multiple libraries on stricter build systems).

(My comment on D65185 has some more context)

Reviewers: JDevlieghere, labath, chandlerc, jdoerfert

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

Patch by Sam McCall!

llvm-svn: 367241

5 years ago[X86] resolveTargetShuffleInputs - add depth to limit recursion.
Simon Pilgrim [Mon, 29 Jul 2019 17:17:58 +0000 (17:17 +0000)]
[X86] resolveTargetShuffleInputs - add depth to limit recursion.

Avoids slow downs from calls to ComputeNumSignBits/computeKnownBits going too deep.

llvm-svn: 367240

5 years agoAppending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xray
Puyan Lotfi [Mon, 29 Jul 2019 16:46:35 +0000 (16:46 +0000)]
Appending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xray

Haven't found a better way to pass the libcxx include path for building
compiler-rt with libcxx; this seems to be missing only for xray.

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

llvm-svn: 367239

5 years ago[lldb] Also include the array definition in Properties.inc
Jonas Devlieghere [Mon, 29 Jul 2019 16:41:30 +0000 (16:41 +0000)]
[lldb] Also include the array definition in Properties.inc

Right now our Properties.inc only generates the initializer for the
options list but not the array declaration boilerplate around it. As the
array definition is identical for all arrays, we might as well also let
the Properties.inc generate it alongside the initializers.

Unfortunately we cannot do the same for enums, as there's this magic
ePropertyExperimental, which needs to come at the end to be interpreted
correctly. Hopefully we can get rid of this in the future and do the
same for the property enums.

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

llvm-svn: 367238

5 years agoAMDGPU/LoadStoreOptimizer: combine MMOs when merging instructions
Tom Stellard [Mon, 29 Jul 2019 16:40:58 +0000 (16:40 +0000)]
AMDGPU/LoadStoreOptimizer: combine MMOs when merging instructions

Summary:
The LoadStoreOptimizer was creating instructions with 2
MachineMemOperands, which meant they were assumed to alias with all other instructions,
because MachineInstr:mayAlias() returns true when an instruction has multiple
MachineMemOperands.

This was preventing these instructions from being merged again, and was
giving the scheduler less freedom to reorder them.

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367237

5 years ago[llvm-objcopy] Improve --add-section argument string parsing
Sergey Dmitriev [Mon, 29 Jul 2019 16:22:40 +0000 (16:22 +0000)]
[llvm-objcopy] Improve --add-section argument string parsing

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

llvm-svn: 367236

5 years ago[AMDGPU] Fix typo in error message
Jay Foad [Mon, 29 Jul 2019 16:17:13 +0000 (16:17 +0000)]
[AMDGPU] Fix typo in error message

llvm-svn: 367235

5 years ago[lldb] Increase testsuite packet-timeout 5secs -> 1min
Jan Kratochvil [Mon, 29 Jul 2019 16:10:16 +0000 (16:10 +0000)]
[lldb] Increase testsuite packet-timeout 5secs -> 1min

rL357954 did increase `packet-timeout` 1sec -> 5secs. Which is IMO about the
maximum timeout reasonable for regular use. But for testsuite I think the
timeout should be higher as the testsuite runs in parallel and it can be run
even on slow hosts and with other load (moreover if it runs on some slow arch).

I have chosen 60 secs, that should be enough hopefully.  Larger value could
make debugging with hanging `lldb-server` annoying.

This patch was based on this testsuite timeout:
http://lab.llvm.org:8014/builders/lldb-x86_64-fedora/builds/546/steps/test/logs/stdio
FAIL: test_connect (TestGDBRemoteClient.TestGDBRemoteClient)
   Test connecting to a remote gdb server
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py", line 13, in test_connect
    process = self.connect(target)
  File "/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py", line 480, in connect
    self.assertTrue(error.Success(), error.description)
AssertionError: False is not True : failed to get reply to handshake packet

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

llvm-svn: 367234

5 years ago[NFC][FPEnv] Pre-commit tests for canonicalize negated operand of fdiv.
Cameron McInally [Mon, 29 Jul 2019 16:09:56 +0000 (16:09 +0000)]
[NFC][FPEnv] Pre-commit tests for canonicalize negated operand of fdiv.

llvm-svn: 367233

5 years ago[X86] combineX86ShufflesRecursively - start recursion at depth = 0. NFCI.
Simon Pilgrim [Mon, 29 Jul 2019 15:57:06 +0000 (15:57 +0000)]
[X86] combineX86ShufflesRecursively - start recursion at depth = 0. NFCI.

As discussed on rL367171, we have a problem where the depth recursion used in combineX86ShufflesRecursively was subtly different to computeKnownBits etc. - it starts at Depth=1 instead of Depth=0 like the others and has a different maximum recursion depth.

This NFC patch fixes the recursion depth to start at 0, so we can more easily reuse depth values in calls from combineX86ShufflesRecursively and its helper functions in computeKnownBits etc.

llvm-svn: 367232

5 years agoSymbolVendor: Make SectionAddressesChanged a passthrough
Pavel Labath [Mon, 29 Jul 2019 15:53:36 +0000 (15:53 +0000)]
SymbolVendor: Make SectionAddressesChanged a passthrough

Summary:
This moves the implementation of the function into the SymbolFile class,
making it possible to excise the SymbolVendor passthrough functions in
follow-up patches.

Reviewers: clayborg, jingham, JDevlieghere

Subscribers: lldb-commits

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

llvm-svn: 367231

5 years ago[RISCV] Fix uninitialized variable after call to evaluateConstantImm
Francis Visoiu Mistrih [Mon, 29 Jul 2019 15:52:13 +0000 (15:52 +0000)]
[RISCV] Fix uninitialized variable after call to evaluateConstantImm

For llvm/test/MC/RISCV/rv64i-aliases-invalid.s, UBSan reports:

lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:371:9: runtime error:
load of value 3879186881, which is not a valid value for type
'RISCVMCExpr::VariantKind'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:371:9 in

It turns out that evaluateConstantImm does not set `VK` and it remains
unitialized when doing comparisons in `isImmXLenLI()`.

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

llvm-svn: 367230

5 years ago[OpenCL] Rename builtin definition classes
Sven van Haastregt [Mon, 29 Jul 2019 14:55:29 +0000 (14:55 +0000)]
[OpenCL] Rename builtin definition classes

Factor out some of the renames from D63434 and D63442, and generate
half type convert_ builtins.

Patch by Pierre Gondois and Sven van Haastregt.

llvm-svn: 367229

5 years ago[lldb] [test] Mark three new tests XFAIL on NetBSD
Michal Gorny [Mon, 29 Jul 2019 14:32:40 +0000 (14:32 +0000)]
[lldb] [test] Mark three new tests XFAIL on NetBSD

llvm-svn: 367228

5 years ago[InstCombine] fold fadd+fneg with fdiv/fmul betweena
Sanjay Patel [Mon, 29 Jul 2019 13:50:25 +0000 (13:50 +0000)]
[InstCombine] fold fadd+fneg with fdiv/fmul betweena

The backend already does this via isNegatibleForFree(),
but we may want to alter the fneg IR canonicalizations
that currently exist, so we need to try harder to fold
fneg in IR to avoid regressions.

llvm-svn: 367227

5 years ago[ValueTracking] Remove volatile check in isGuaranteedToTransferExecutionToSuccessor
Hideto Ueno [Mon, 29 Jul 2019 13:35:34 +0000 (13:35 +0000)]
[ValueTracking] Remove volatile check in isGuaranteedToTransferExecutionToSuccessor

Summary: As clarified in D53184, volatile load and store do not trap. Therefore, we should remove volatile checks for instructions in  `isGuaranteedToTransferExecutionToSuccessor`.

Reviewers: jdoerfert, efriedma, nikic

Reviewed By: nikic

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 367226

5 years agoclang-format clang/lib/Format
Nico Weber [Mon, 29 Jul 2019 13:26:48 +0000 (13:26 +0000)]
clang-format clang/lib/Format

llvm-svn: 367225

5 years ago[InstCombine] reduce code for fadd with fneg operand; NFC
Sanjay Patel [Mon, 29 Jul 2019 13:20:46 +0000 (13:20 +0000)]
[InstCombine] reduce code for fadd with fneg operand; NFC

llvm-svn: 367224

5 years ago[InstCombine] add tests for fadd with negated operand; NFC
Sanjay Patel [Mon, 29 Jul 2019 12:49:36 +0000 (12:49 +0000)]
[InstCombine] add tests for fadd with negated operand; NFC

llvm-svn: 367222

5 years ago[AMDGPU] Add amdgpu_kernel for consistency with other tests
Jay Foad [Mon, 29 Jul 2019 11:48:17 +0000 (11:48 +0000)]
[AMDGPU] Add amdgpu_kernel for consistency with other tests

llvm-svn: 367221

5 years ago[DAGCombine] narrowInsertExtractVectorBinOp - early out for binops that change value...
Simon Pilgrim [Mon, 29 Jul 2019 11:34:45 +0000 (11:34 +0000)]
[DAGCombine] narrowInsertExtractVectorBinOp - early out for binops that change value type. NFCI.

This is implicit in the value type checks in getSubVectorSrc - this just makes it upfront and obvious.

llvm-svn: 367220

5 years agodoc: Fix Google C++ Style Guide link.
Rafael Stahl [Mon, 29 Jul 2019 11:00:23 +0000 (11:00 +0000)]
doc: Fix Google C++ Style Guide link.

llvm-svn: 367219

5 years ago[DivergenceAnalysis] Add methods for querying divergence at use
Jay Foad [Mon, 29 Jul 2019 10:22:09 +0000 (10:22 +0000)]
[DivergenceAnalysis] Add methods for querying divergence at use

Summary:
The existing isDivergent(Value) methods query whether a value is
divergent at its definition. However even if a value is uniform at its
definition, a use of it in another basic block can be divergent because
of divergent control flow between the def and the use.

This patch adds new isDivergent(Use) methods to DivergenceAnalysis,
LegacyDivergenceAnalysis and GPUDivergenceAnalysis.

This might allow D63953 or other similar workarounds to be removed.

Reviewers: alex-t, nhaehnle, arsenm, rtaylor, rampitec, simoll, jingyue

Reviewed By: nhaehnle

Subscribers: jfb, jvesely, wdng, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367218

5 years ago[SystemZ] Regenerate <8 x i31> store test
Simon Pilgrim [Mon, 29 Jul 2019 09:49:23 +0000 (09:49 +0000)]
[SystemZ] Regenerate <8 x i31> store test

To help show the diffs from an upcoming SimplifyDemandedBits patch.

llvm-svn: 367216

5 years agoMark test/MC/RISCV/rv{32,64}i-aliases-invalid.s unsupported also on Windows
Hans Wennborg [Mon, 29 Jul 2019 09:49:04 +0000 (09:49 +0000)]
Mark test/MC/RISCV/rv{32,64}i-aliases-invalid.s unsupported also on Windows

Because they fail there too.

FAIL: LLVM :: MC/RISCV/rv32i-aliases-invalid.s (24397 of 32659)
******************** TEST 'LLVM :: MC/RISCV/rv32i-aliases-invalid.s' FAILED ********************
Script:
--
: 'RUN: at line 2';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s -triple=riscv32 -riscv-no-aliases 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s
: 'RUN: at line 3';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s -triple=riscv32 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 2"
$ "not" "c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s" "-triple=riscv32" "-riscv-no-aliases"
$ "c:\src\llvm.monorepo\build.release2\bin\filecheck.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s"
C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s:10:21: error: CHECK: expected string not found in input
li t4, foo # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
                    ^
<stdin>:5:1: note: scanning from here
li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
^
<stdin>:5:1: note: with "@LINE" equal to "10"
li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
^
<stdin>:5:38: note: possible intended match here
li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
                                     ^

error: command failed with exit status: 1

--

--
********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70
FAIL: LLVM :: MC/RISCV/rv64i-aliases-invalid.s (24416 of 32659)
******************** TEST 'LLVM :: MC/RISCV/rv64i-aliases-invalid.s' FAILED ********************
Script:
--
: 'RUN: at line 2';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s -triple=riscv64 -riscv-no-aliases 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s
: 'RUN: at line 3';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s -triple=riscv64 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 2"
$ "not" "c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s" "-triple=riscv64" "-riscv-no-aliases"
$ "c:\src\llvm.monorepo\build.release2\bin\filecheck.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s"
C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s:6:21: error: CHECK: expected string not found in input
li t4, foo # CHECK: :[[@LINE]]:8: error: operand must be a constant 64-bit integer
                    ^
<stdin>:2:1: note: scanning from here
li t5, 0x10000000000000000 # CHECK: :[[@LINE]]:8: error: unknown operand
^
<stdin>:2:1: note: with "@LINE" equal to "6"
li t5, 0x10000000000000000 # CHECK: :[[@LINE]]:8: error: unknown operand
^
<stdin>:13:67: note: possible intended match here
C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s:12:13: error: immediate must be an integer in the range [0, 63]
                                                                  ^

error: command failed with exit status: 1
llvm-svn: 367215

5 years ago[ARM] Regenerate rotation tests
Simon Pilgrim [Mon, 29 Jul 2019 09:48:07 +0000 (09:48 +0000)]
[ARM] Regenerate rotation tests

llvm-svn: 367214

5 years ago[AMDGPU] Regenerate v2i16 insertelement tests.
Simon Pilgrim [Mon, 29 Jul 2019 09:47:07 +0000 (09:47 +0000)]
[AMDGPU] Regenerate v2i16 insertelement tests.

To help show the diffs from an upcoming SimplifyDemandedBits patch.

llvm-svn: 367213

5 years ago[NFC][ARM[ParallelDSP] Cleanup of BinOpChain
Sam Parker [Mon, 29 Jul 2019 08:41:51 +0000 (08:41 +0000)]
[NFC][ARM[ParallelDSP] Cleanup of BinOpChain

- Remove some unused typedefs.
- Rename BinOpChain struct to MulCandidate.
- Remove the size method of MulCandidate.
- Store only the first input of the ValueList provided to
  MulCandidate, as it's the only value we care about. This means we
  don't have to perform any ugly (and unnecessary) iterations of the
  list later on.

llvm-svn: 367208

5 years ago[lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitter
Raphael Isemann [Mon, 29 Jul 2019 08:22:41 +0000 (08:22 +0000)]
[lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitter

Splitting the different logic is cleaner and we it will be easier
to implement the enum emitting (which otherwise would have to
reimplement the Record parsing).

llvm-svn: 367207

5 years ago[AMDGPU] Enable v4f16 and above for v_pk_fma instructions
David Stuttard [Mon, 29 Jul 2019 08:15:10 +0000 (08:15 +0000)]
[AMDGPU] Enable v4f16 and above for v_pk_fma instructions

Summary:
If isel is presented with <2 x half> vectors then it will correctly select
v_pk_fma style instructions.
If isel is presented with e.g. <4 x half> vectors it will scalarize, unlike for
other instruction types (such as fadd, fmul etc.)

Added extra support to enable this. Updated one of the tests to include a test
for this (as well as extending the test to GFX9)

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits

Tags: #llvm

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

Change-Id: I50a4577a3f8223fb53992af3b7d26121f65b71ee
llvm-svn: 367206

5 years ago[NFC][ARM][ParallelDSP] Remove AreSymmetrical
Sam Parker [Mon, 29 Jul 2019 08:12:24 +0000 (08:12 +0000)]
[NFC][ARM][ParallelDSP] Remove AreSymmetrical

We explicitly search for a parallel mac and we only care about its
inputs, checking for symmetry doesn't add anything here.

llvm-svn: 367205

5 years ago[NFC][ARM][ParallelDSP] Remove PopulateLoads
Sam Parker [Mon, 29 Jul 2019 08:07:23 +0000 (08:07 +0000)]
[NFC][ARM][ParallelDSP] Remove PopulateLoads

We no longer have to check what loads are used, all this
is performed at the start of the transform, so it's not
doing anything now.

llvm-svn: 367204

5 years ago[obj2yaml] - Report a error when unable to resolve a sh_link reference properly.
George Rimar [Mon, 29 Jul 2019 07:58:29 +0000 (07:58 +0000)]
[obj2yaml] - Report a error when unable to resolve a sh_link reference properly.

Because of a bug we did not report a error in the case
shown in the test. With this patch we do.

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

llvm-svn: 367203

5 years ago[llvm-objcopy] - Reimplement strip-dwo-groups.test to stop using the precompiled...
George Rimar [Mon, 29 Jul 2019 07:55:39 +0000 (07:55 +0000)]
[llvm-objcopy] - Reimplement strip-dwo-groups.test to stop using the precompiled object.

When llvm-copy removes .dwo sections the index of symbol table,
the indices of the symbols and the indices of the sections which go
after the removed ones changes. That affects on SHT_GROUP sections,
which needs to be updated.

Initially this test used a precompiled object, I rewrote it to use YAML
and improved a bit.

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

llvm-svn: 367202

5 years ago[lldb][NFC] Remove DiagnosticManager::CopyDiagnostics
Raphael Isemann [Mon, 29 Jul 2019 07:37:17 +0000 (07:37 +0000)]
[lldb][NFC] Remove DiagnosticManager::CopyDiagnostics

The Diagnostic class in LLDB is suppossed to be inherited from,
so just copying the diagnostics like this is wrong. The function
is also unused, so lets just get rid of it instead of creating
some cloning facility for it.

llvm-svn: 367201

5 years agoReturn early. NFC.
Rui Ueyama [Mon, 29 Jul 2019 05:24:51 +0000 (05:24 +0000)]
Return early. NFC.

llvm-svn: 367200

5 years agoImprove MSVC visualizers for DeclSpec and TemplateName
Mike Spertus [Mon, 29 Jul 2019 03:34:40 +0000 (03:34 +0000)]
Improve MSVC visualizers for DeclSpec and TemplateName

DeclSpec now shows the TypeRep, ExprRep, or DeclRep as appropriate
TemplateName decodes and displays the StorageType
A few minor refinements to other types

llvm-svn: 367199

5 years ago[X86] Don't use PMADDWD for vector add reductions of multiplies if the mul inputs...
Craig Topper [Mon, 29 Jul 2019 01:36:58 +0000 (01:36 +0000)]
[X86] Don't use PMADDWD for vector add reductions of multiplies if the mul inputs have an additional user.

The pmaddwd inserts a truncate, if that truncate would end up
creating additional instructions instead of making a zext
narrower, then we shouldn't do it.

I've restricted this to only sse4.1 targets since on prior
targets the zext will be done in stages. So the truncate will
probably not create additional instructions. Might need some
more investigation of mul shrinking and the other pmaddwd
transform to be sure this is the right decision.

There might be a slight regression on AVX1 targets due to add
splitting. Hard to say for sure. Maybe we need to look into
using the vector reduction flag to use 2 narrow loads and a
blend instead of extracting and inserting.

llvm-svn: 367198

5 years ago[X86] Add test cases to show missing one use check in combineLoopMAddPattern.
Craig Topper [Mon, 29 Jul 2019 01:36:54 +0000 (01:36 +0000)]
[X86] Add test cases to show missing one use check in combineLoopMAddPattern.

llvm-svn: 367197

5 years ago[NFC][InstCombine] Revisit tests in shift-amount-reassociation-with-truncation-shl.ll
Roman Lebedev [Sun, 28 Jul 2019 21:31:58 +0000 (21:31 +0000)]
[NFC][InstCombine] Revisit tests in shift-amount-reassociation-with-truncation-shl.ll

llvm-svn: 367196

5 years ago[X86] In combineLoopMAddPattern and combineLoopSADPattern, preserve the vector reduct...
Craig Topper [Sun, 28 Jul 2019 18:45:42 +0000 (18:45 +0000)]
[X86] In combineLoopMAddPattern and combineLoopSADPattern, preserve the vector reduction flag on the final add. Handle unrolled loops by letting DAG combine revisit.

This reverts r340478 and r340631 and replaces them with a simpler
method of just letting DAG combine revisit the nodes to handle
the other operand.

llvm-svn: 367195

5 years ago[InstCombine] fold fsub+fneg with fdiv/fmul between
Sanjay Patel [Sun, 28 Jul 2019 17:10:06 +0000 (17:10 +0000)]
[InstCombine] fold fsub+fneg with fdiv/fmul between

The backend already does this via isNegatibleForFree(),
but we may want to alter the fneg IR canonicalizations
that currently exist, so we need to try harder to fold
fneg in IR to avoid regressions.

llvm-svn: 367194

5 years agoBuildbot fix for r367190
Gabor Borsik [Sun, 28 Jul 2019 14:57:41 +0000 (14:57 +0000)]
Buildbot fix for r367190

llvm-svn: 367193

5 years ago[ARM] MVE VPNOT
David Green [Sun, 28 Jul 2019 14:07:48 +0000 (14:07 +0000)]
[ARM] MVE VPNOT

This adds the patterns required to transform xor P0, -1 to a VPNOT. The
instruction operands have to change a little for this, adding an in and an out
VCCR reg and using a custom DecodeMVEVPNOT for the decode.

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

llvm-svn: 367192

5 years ago[ARM] Better patterns for fp <> predicate vectors
David Green [Sun, 28 Jul 2019 13:53:39 +0000 (13:53 +0000)]
[ARM] Better patterns for fp <> predicate vectors

These are some better patterns for converting between predicates and floating
points. Much like the extends, we select "1"/"-1" or "0" depending on the
predicate value. Or we perform a compare against 0 to convert to a predicate.

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

llvm-svn: 367191

5 years ago[analyzer] Add yaml parser to GenericTaintChecker
Gabor Borsik [Sun, 28 Jul 2019 13:38:04 +0000 (13:38 +0000)]
[analyzer] Add yaml parser to GenericTaintChecker

While we implemented taint propagation rules for several
builtin/standard functions, there's a natural desire for users to add
such rules to custom functions.

A series of patches will implement an option that allows users to
annotate their functions with taint propagation rules through a YAML
file. This one adds parsing of the configuration file, which may be
specified in the commands line with the analyzer config:
alpha.security.taint.TaintPropagation:Config. The configuration may
contain propagation rules, filter functions (remove taint) and sink
functions (give a warning if it gets a tainted value).

I also added a new header for future checkers to conveniently read YAML
files as checker options.

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

llvm-svn: 367190

5 years ago[NFC][InstCombine] Shift amount reassociation: can have trunc between shl's
Roman Lebedev [Sun, 28 Jul 2019 13:13:46 +0000 (13:13 +0000)]
[NFC][InstCombine] Shift amount reassociation: can have trunc between shl's

https://rise4fun.com/Alive/OQbM
Not so simple for lshr/ashr, so those maybe later.

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

llvm-svn: 367189

5 years agoDon't initialize interceptor_metadata_map unless SI_POSIX is set
Eugene Leviant [Sun, 28 Jul 2019 08:58:44 +0000 (08:58 +0000)]
Don't initialize interceptor_metadata_map unless SI_POSIX is set

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

llvm-svn: 367188

5 years ago[Attributor] Deduce "align" attribute
Hideto Ueno [Sun, 28 Jul 2019 07:04:01 +0000 (07:04 +0000)]
[Attributor] Deduce "align" attribute

Summary:
Deduce "align" attribute in attributor.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367187

5 years ago[lldb] Also include the array definition in CommandOptions.inc
Raphael Isemann [Sun, 28 Jul 2019 06:24:07 +0000 (06:24 +0000)]
[lldb] Also include the array definition in CommandOptions.inc

Summary:
Right now our CommandOptions.inc only generates the initializer for the options list but
not the array declaration boilerplate around it. As the array definition is identical for all arrays,
we might as well also let the CommandOptions.inc generate it alongside the initializers.

This patch will also allow us to generate additional declarations related to that option list in
the future (e.g. a enum class representing the specific options which would make our
handling code less prone).

This patch also fixes a few option tables that didn't follow our naming style.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 367186

5 years ago[IR] Fix getPointerAlignment for CallBase
Hideto Ueno [Sun, 28 Jul 2019 06:17:46 +0000 (06:17 +0000)]
[IR] Fix getPointerAlignment for CallBase

Summary:
In current getPointerAlignemnt implementation, CallBase.getPointerAlignement(..) checks only parameter attriutes in the callsite.  For example,

```
declare align 8 i8* @foo()

define void @bar() {
    %a = tail call align 8 i8* @foo() ; getPointerAlignment returns 8
    %b = tail call i8* @foo() ; getPointerAlignemnt returns 0
    ret void
}
```

This patch will fix the problem.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367185

5 years ago[FunctionAttrs] Annotate "willreturn" for intrinsics
Hideto Ueno [Sun, 28 Jul 2019 06:09:56 +0000 (06:09 +0000)]
[FunctionAttrs] Annotate "willreturn" for intrinsics

Summary:
In D62801, new function attribute `willreturn` was introduced. In short, a function with `willreturn` is guaranteed to come back to the call site(more precise definition is in LangRef).

In this patch, willreturn is annotated for LLVM intrinsics.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: jvesely, nhaehnle, sstefan1, llvm-commits

Tags: #llvm

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

llvm-svn: 367184

5 years agoFix PR35637: suboptimal codegen for `vector<unsigned char>`.
Eric Fiselier [Sun, 28 Jul 2019 04:37:02 +0000 (04:37 +0000)]
Fix PR35637: suboptimal codegen for `vector<unsigned char>`.

The optimizer is petulant and temperamental. In this case LLVM failed to lower
the the "insert at end" loop used by`vector<unsigned char>` to a `memset` despite
`memset` being substantially faster over a range of bytes.

LLVM has the ability to lower loops to `memset` whet appropriate, but the
odd nature of libc++'s loops prevented the optimization from taking places.

This patch addresses the issue by rewriting the loops from the form
`do [ ... --__n; } while (__n > 0);` to instead use a for loop over a pointer
range (For example: `for (auto *__i = ...; __i < __e; ++__i)`).

This patch also rewrites the asan annotations to unposion all additional memory
at the start of the loop instead of once per iterations. This could potentially
permit false negatives where the constructor of element N attempts to access
element N + 1 during its construction.

The before and after results for the `BM_ConstructSize/vector_byte/5140480_mean`
benchmark (run 5 times) are:

--------------------------------------------------------------------------------------------
Benchmark                                                 Time             CPU   Iterations
--------------------------------------------------------------------------------------------
Before
------
BM_ConstructSize/vector_byte/5140480_mean          12530140 ns     12469693 ns            N/A
BM_ConstructSize/vector_byte/5140480_median        12512818 ns     12445571 ns            N/A
BM_ConstructSize/vector_byte/5140480_stddev          106224 ns       107907 ns            5
-----
After
-----
BM_ConstructSize/vector_byte/5140480_mean            167285 ns       166500 ns            N/A
BM_ConstructSize/vector_byte/5140480_median          166749 ns       166069 ns            N/A
BM_ConstructSize/vector_byte/5140480_stddev            3242 ns         3184 ns            5

llvm-svn: 367183

5 years ago[Driver] Additional fixup of NOWARN test case from r367165
Bjorn Pettersson [Sat, 27 Jul 2019 20:22:47 +0000 (20:22 +0000)]
[Driver] Additional fixup of NOWARN test case from r367165

Same kind of fix as in r367176, but for "RUN on line 76"
this time.

I'll ask for a post-commit review, to ensure this
matches the intention with the test added in r367165.
But I think this at least will make the buildbots a
little bit happier.

llvm-svn: 367182

5 years ago[DAGCombine] narrowInsertExtractVectorBinOp - early out for illegal op. NFCI.
Simon Pilgrim [Sat, 27 Jul 2019 19:42:58 +0000 (19:42 +0000)]
[DAGCombine] narrowInsertExtractVectorBinOp - early out for illegal op. NFCI.

If the subvector binop is illegal then early-out and avoid the subvector searches.

llvm-svn: 367181

5 years agoStricter check for the memory access.
Joerg Sonnenberger [Sat, 27 Jul 2019 18:57:59 +0000 (18:57 +0000)]
Stricter check for the memory access.

The current pattern would trigger for scheduling changes of the
post-load computation, since those are commutable with the inline asm.
Avoid this by explicitly check the order of load vs asm block.

llvm-svn: 367180

5 years agoRegenerate UXTB tests
Simon Pilgrim [Sat, 27 Jul 2019 18:44:15 +0000 (18:44 +0000)]
Regenerate UXTB tests

llvm-svn: 367179

5 years ago[clangd] Fix NDEBUG build problem introduced by rL366698
Bjorn Pettersson [Sat, 27 Jul 2019 17:09:15 +0000 (17:09 +0000)]
[clangd] Fix NDEBUG build problem introduced by rL366698

Sprinkled some #ifndef NDEBUG in Selection.cpp to make
it possible to build with NDEBUG defined.

The problem was introduced in rL366698 when using dlog
for some debug printouts. The dlog macro expands to
DEBUG_WITH_TYPE, which isn't using it's arguments in
optimized builds (when NDEBUG is defined).

llvm-svn: 367178

5 years ago[Driver] Fix "unannotated fall-through between switch labels". NFC
Bjorn Pettersson [Sat, 27 Jul 2019 17:09:08 +0000 (17:09 +0000)]
[Driver] Fix "unannotated fall-through between switch labels". NFC

Just a simple fix of Werror problem after r367165.

llvm-svn: 367177

5 years agoAttempt to make test in r367165 more robust.
Nico Weber [Sat, 27 Jul 2019 16:57:19 +0000 (16:57 +0000)]
Attempt to make test in r367165 more robust.

Some people were seeing this failure:

```
: 'RUN: at line 83';   clang -mrelax-all -fno-integrated-as /b/s/w/ir/k/llvm-project/clang/test/Driver/as-options.s -S 2>&1 \
         | /FileCheck --check-prefix=WARN --allow-empty clang/test/Driver/as-options.s
--
Exit Code: 1

Command Output (stderr):
--
clang/test/Driver/as-options.s:66:16: error: NOWARN-NOT: excluded string found in input
// NOWARN-NOT: unused
               ^
<stdin>:1:95: note: found here
clang-10: warning: clang/test/Driver/as-options.s: 'assembler' input unused [-Wunused-command-line-argument]
```

Maybe this helps with that.

llvm-svn: 367176

5 years ago[AMDGPU] Regenerate tests.
Simon Pilgrim [Sat, 27 Jul 2019 14:32:23 +0000 (14:32 +0000)]
[AMDGPU] Regenerate tests.

To help show the diffs from an upcoming SimplifyDemandedBits patch.

llvm-svn: 367175

5 years ago[TargetLowering] SimplifyMultipleUseDemandedBits - add BITCAST pass through support...
Simon Pilgrim [Sat, 27 Jul 2019 14:11:59 +0000 (14:11 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - add BITCAST pass through support (Reapplied)

This allows us to peek through BITCASTs, attempt to simplify the source operand, and then bitcast back.

This reapplies rL367091 which was reverted at rL367118 - we were inconsistently peeking through the bitcasts to the source value.

Fixes PR42777

llvm-svn: 367174

5 years ago[InstSimplify] remove quadratic time looping (PR42771)
Sanjay Patel [Sat, 27 Jul 2019 14:05:51 +0000 (14:05 +0000)]
[InstSimplify] remove quadratic time looping (PR42771)

The test case from:
https://bugs.llvm.org/show_bug.cgi?id=42771
...shows a ~30x slowdown caused by the awkward loop iteration (rL207302) that is
seemingly done just to avoid invalidating the instruction iterator. We can instead
delay instruction deletion until we reach the end of the block (or we could delay
until we reach the end of all blocks).

There's a test diff here for a degenerate case with llvm.assume that is not
meaningful in itself, but serves to verify this change in logic.

This change probably doesn't result in much overall compile-time improvement
because we call '-instsimplify' as a standalone pass only once in the standard
-O2 opt pipeline currently.

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

llvm-svn: 367173

5 years ago[X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBit...
Simon Pilgrim [Sat, 27 Jul 2019 13:30:29 +0000 (13:30 +0000)]
[X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBits handler (Reapplied)

Recommit rL367100 which was reverted at rL367141. Until PR42777 is fixed, we no longer get the benefits of peeking through bitcasts but it does still remove a GetDemandedBits user and gives us the equivalent combines.

llvm-svn: 367172

5 years ago[SelectionDAG] Check for any recursion depth greater than or equal to limit instead...
Simon Pilgrim [Sat, 27 Jul 2019 12:48:46 +0000 (12:48 +0000)]
[SelectionDAG] Check for any recursion depth greater than or equal to limit instead of just equal the limit.

If anything called the recursive isKnownNeverNaN/computeKnownBits/ComputeNumSignBits/SimplifyDemandedBits/SimplifyMultipleUseDemandedBits with an incorrect depth then we could continue to recurse if we'd already exceeded the depth limit.

This replaces the limit check (Depth == 6) with a (Depth >= 6) to make sure that we don't circumvent it.

This causes a couple of regressions as a mixture of calls (SimplifyMultipleUseDemandedBits + combineX86ShufflesRecursively) were calling with depths that were already over the limit. I've fixed SimplifyMultipleUseDemandedBits to not do this. combineX86ShufflesRecursively is trickier as we get a lot of regressions if we reduce its own limit from 8 to 6 (it also starts at Depth == 1 instead of Depth == 0 like the others....) - I'll see what I can do in future patches.

llvm-svn: 367171

5 years ago[compiler-rt] Fix running tests on macOS when XCode is not installed
Alexander Richardson [Sat, 27 Jul 2019 12:30:15 +0000 (12:30 +0000)]
[compiler-rt] Fix running tests on macOS when XCode is not installed

Summary:
If XCode is not installed, `xcodebuild -version -sdk macosx Path` will give
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
In this case the variable OSX_SYSROOT will be empty and
OSX_SYSROOT_FLAG is set to "-isysroot" (without a path).
This then causes the CompilerRTUnitTestCheckCxx target failed to for me
because "${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E" expanded to
"clang -isysroot -E". This results in a warning "sysroot -E does not exist"
and the target fails to run because the C++ headers cannot be found.

Reviewers: beanz, kubamracek

Reviewed By: beanz

Subscribers: dberris, mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 367170

5 years ago[TargetLowering] Add depth limit to SimplifyMultipleUseDemandedBits
Simon Pilgrim [Sat, 27 Jul 2019 12:23:36 +0000 (12:23 +0000)]
[TargetLowering] Add depth limit to SimplifyMultipleUseDemandedBits

We're getting reports of massive compile time increases because SimplifyMultipleUseDemandedBits was losing track of the depth and not earlying-out. No repro yet, but consider this a pre-emptive commit.

llvm-svn: 367169

5 years ago[mips] Add (dis)assembler tests for beqzl and bnezl instructions. NFC
Simon Atanasyan [Sat, 27 Jul 2019 08:13:27 +0000 (08:13 +0000)]
[mips] Add (dis)assembler tests for beqzl and bnezl instructions. NFC

llvm-svn: 367168

5 years agoclang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro.
Nico Weber [Sat, 27 Jul 2019 02:41:40 +0000 (02:41 +0000)]
clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro.

This is like r305666 (which added support for `if constexpr`) except
that it allows a macro name after the if.

This is slightly tricky for two reasons:

1. r305666 didn't add test coverage for all cases where it added a
   kw_constexpr, so I had to figure out what all the added cases were
   for. I now added tests for all `if constexpr` bits that didn't have
   tests. (This took a while, see e.g. https://reviews.llvm.org/D65223)

2. Parsing `if <ident> (` as an if means that `#if defined(` and
   `#if __has_include(` parse as ifs too. Add some special-case code
   to prevent this from happening where it's incorrect.

Fixes PR39248.

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

llvm-svn: 367167

5 years agoRevert "[ARM] Set default alignment to 64bits"
Petr Hosek [Sat, 27 Jul 2019 01:59:23 +0000 (01:59 +0000)]
Revert "[ARM] Set default alignment to 64bits"

This reverts commit r367119.

This broke several bots:

http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/26891/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Aexception-alignment.cpp
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/245/consoleFull

llvm-svn: 367166

5 years agodriver: Don't warn about assembler flags being unused when not assembling; different...
Nico Weber [Sat, 27 Jul 2019 01:13:00 +0000 (01:13 +0000)]
driver: Don't warn about assembler flags being unused when not assembling; different approach

This morally relands r365703 (and r365714), originally reviewed at
https://reviews.llvm.org/D64527, but with a different implementation.

Relanding the same approach with a fix for the revert reason got a bit
involved (see https://reviews.llvm.org/D65108) so use a simpler approach
with a more localized implementation (that in return duplicates code
a bit more).

This approach also doesn't validate flags for the integrated assembler
if the assembler step doesn't run.

Fixes PR42066.

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

llvm-svn: 367165

5 years ago[AArch64][GlobalISel] Implement narrowing of G_SEXT.
Amara Emerson [Fri, 26 Jul 2019 23:46:38 +0000 (23:46 +0000)]
[AArch64][GlobalISel] Implement narrowing of G_SEXT.

We need this to narrow a sext to s128.

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

llvm-svn: 367164

5 years ago[AArch64][GlobalISel] Select @llvm.aarch64.stlxr for 32-bit pointers
Jessica Paquette [Fri, 26 Jul 2019 23:28:53 +0000 (23:28 +0000)]
[AArch64][GlobalISel] Select @llvm.aarch64.stlxr for 32-bit pointers

Add partial instruction selection for intrinsics like this:

```
declare i32 @llvm.aarch64.stlxr(i64, i32*)
```

(This only handles the case where a G_ZEXT is feeding the intrinsic.)

Also make sure that the added store instruction actually has the memory op from
the original G_STORE.

Update select-stlxr-intrin.mir and arm64-ldxr-stxr.ll.

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

llvm-svn: 367163

5 years ago[Remarks] Silence Wreturn-type warning
Francis Visoiu Mistrih [Fri, 26 Jul 2019 22:42:54 +0000 (22:42 +0000)]
[Remarks] Silence Wreturn-type warning

Shows up here: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/27771/steps/annotate/logs/stdio.

llvm-svn: 367162