Commit Graph

320302 Commits

Author SHA1 Message Date
JF Bastien f34711d9a0 Fix Bitcode/invalid.test
On the armv8 bot the failure is slightly different in the number it prints. Don't check the numbers. This was caused by r364464.

llvm-svn: 364488
2019-06-26 23:08:29 +00:00
Mitch Phillips 45763ee407 [GWP-ASan] D63736 broke ARMv7/v8 sanitizer bots.
Remove ARM32/ARM64 support for GWP-ASan due to a strange SEGV when
running scudo's preinit.c test. Disabling to make the bots go green
while investigating.

llvm-svn: 364486
2019-06-26 22:24:15 +00:00
Pengxuan Zheng 4030631bfa [cmake] Allow config.guess to be run with MSYS on Windows
Summary:
With r363420, config.guess can no longer be run with MSYS on Windows and this
patch should be able to fix this particular case.

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 364485
2019-06-26 22:07:43 +00:00
Jason Molenda 1659276bee Support nested target.xml register definition files, lack of reg group markers.
The qemu x86_64 target returns a target.xml register definition file which
includes other xml files and they include others, etc.  Also, the registers
are not put in register groups like lldb wants to see.

This patch (1) puts registers that aren't in a register group in a "general"
register group, (2) change ProcessGDBRemote::GetGDBServerRegisterInfo to
be a method that starts the parsing, asking a recurisve function to fetch
and parse target.xml, (3) adds 
ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess which can recusively
call itself to read and parse included xml files, (4) in addition to expecting
the top-level <target> element (which only happens in the top level xml file),
also an xml file that consists of a <feature> node - read the register 
defintions and includes from that <feature> element.  

<rdar://problem/49537922> 
Differential revision: https://reviews.llvm.org/D63802

llvm-svn: 364484
2019-06-26 21:59:39 +00:00
Gerolf Hoflehner e311a4d5c4 [SCCP] Fix non-deterministic uselists of return values (DenseMap -> MapVector)
llvm-svn: 364482
2019-06-26 21:44:37 +00:00
Jason Molenda ddf025e8dc Use the // integer divide operator in these
target definition files, like Davide's change to x86_64_target_definition.py.

llvm-svn: 364481
2019-06-26 21:41:07 +00:00
Aaron Puchert 4561161345 Fix formatting after r364479
The reflowing obscurs the functional changes, so here is a separate
commit.

llvm-svn: 364480
2019-06-26 21:39:19 +00:00
Aaron Puchert b207baeb28 [Clang] Remove unused -split-dwarf and obsolete -enable-split-dwarf
Summary:
The changes in D59673 made the choice redundant, since we can achieve
single-file split DWARF just by not setting an output file name.
Like llc we can also derive whether to enable Split DWARF from whether
-split-dwarf-file is set, so we don't need the flag at all anymore.

The test CodeGen/split-debug-filename.c distinguished between having set
or not set -enable-split-dwarf with -split-dwarf-file, but we can
probably just always emit the metadata into the IR.

The flag -split-dwarf wasn't used at all anymore.

Reviewers: dblaikie, echristo

Reviewed By: dblaikie

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

llvm-svn: 364479
2019-06-26 21:36:35 +00:00
Vasileios Porpodas 574cb0eb3a [SLP] Look-ahead operand reordering heuristic.
Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example).

Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk

Reviewed By: RKSimon, dtemirbulatov

Subscribers: rnk, rcorcs, llvm-commits

Tags: #llvm

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

llvm-svn: 364478
2019-06-26 21:25:24 +00:00
Sanjay Patel b5999f17d4 [InstCombine] change 'tmp' variable names; NFC
I don't think there was anything going wrong here,
but the auto-generating CHECK line script is known
to have problems with 'TMP' because it uses that
to match nameless values.

This is a retry of rL364452.

llvm-svn: 364477
2019-06-26 21:19:31 +00:00
Reid Kleckner e6f2ff2c8d Revert r363191 "[MS] Pretend constexpr variable template specializations are inline"
The next Visual Studio update will fix this issue, and it doesn't make
sense to implement this non-conforming behavior going forward.

llvm-svn: 364476
2019-06-26 21:16:51 +00:00
Alex Lorenz d5f7196feb [clang-scan-deps] Introduce the DependencyScanning library with the
thread worker code and better error handling

This commit extracts out the code that will powers the fast scanning
worker into a new file in a new DependencyScanning library. The error
and output handling is improved so that the clients can gather
errors/results from the worker directly.

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

llvm-svn: 364474
2019-06-26 21:11:51 +00:00
Matt Arsenault c0cad98363 AMDGPU: Assert SPAdj is 0
llvm-svn: 364473
2019-06-26 20:56:18 +00:00
Matt Arsenault 47345534aa PEI: Add default handling of spills to registers
llvm-svn: 364472
2019-06-26 20:56:15 +00:00
Jinsong Ji 968a454182 [UpdateTestChecks][NFC] Remove entries with same prefix
Matching is 'lossy', triples with same prefix can be dropped.

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

llvm-svn: 364471
2019-06-26 20:35:19 +00:00
Matt Arsenault 6a87e0fc6a [AMDGPU] Fix Livereg computation during epilogue insertion
The LivePhysRegs calculated in order to find a scratch register in the
epilogue code wrongly uses 'LiveIns'. Instead, it should use the
'Liveout' sets.  For the liveness, also considering the operands of
the terminator (return) instruction which is the insertion point for
the scratch-exec-copy instruction.

Patch by Christudasan Devadasan

llvm-svn: 364470
2019-06-26 20:35:18 +00:00
Craig Topper 3d12971e1c [X86] Rework the logic in LowerBuildVectorv16i8 to make better use of any_extend and break false dependencies. Other improvements
This patch rewrites the loop iteration to only visit every other element starting with element 0. And we work on the "even" element and "next" element at the same time. The "First" logic has been moved to the bottom of the loop and doesn't run on every element. I believe it could create dangling nodes previously since we didn't check if we were going to use SCALAR_TO_VECTOR for the first insertion. I got rid of the "First" variable and just do a null check on V which should be equivalent. We also no longer use undef as the starting V for vectors with no zeroes to avoid false dependencies. This matches v8i16.

I've changed all the extends and OR operations to use MVT::i32 since that's what they'll be promoted to anyway. I've tried to use zero_extend only when necessary and use any_extend otherwise. This resulted in some improvements in tests where we are now able to promote aligned (i32 (extload i8)) to a 32-bit load.

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

llvm-svn: 364469
2019-06-26 20:16:19 +00:00
Guanzhong Chen 9aad997a5a [WebAssembly] Implement Address Sanitizer for Emscripten
Summary:
This diff enables address sanitizer on Emscripten.

On Emscripten, real memory starts at the value passed to --global-base.

All memory before this is used as shadow memory, and thus the shadow mapping
function is simply dividing by 8.

Reviewers: tlively, aheejin, sbc100

Reviewed By: sbc100

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 364468
2019-06-26 20:16:14 +00:00
Guanzhong Chen e15dc95466 [wasm-ld] Add __global_base symbol to mark the value of --global-base
Summary:
This is needed for address sanitizer on Emscripten. As everything in
memory starts at the value passed to --global-base, everything before
that can be used as shadow memory.

This symbol is added so that the library for the ASan runtime can know
where the shadow memory ends and real memory begins.

This is split from D63742.

Reviewers: tlively, aheejin, sbc100

Subscribers: sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 364467
2019-06-26 20:12:33 +00:00
Adrian Prantl 8ac899c600 Make nrvo-string test more robust.
The breakpoint locations were in places where clang doesn't actually
emit a source location for and depend on the debugger's ability to
move the breakpoint forward onto a line that is already in the
function epilogue. In my testing older versions of LLDB fail to do
that, so I'm modifying the test to force a break-able location by
calling a noinline function.

<rdar://problem/52079841>

llvm-svn: 364466
2019-06-26 20:04:09 +00:00
Davide Italiano 4201ed2ea3 [x86-64] Use `//` for integer division in the target definition.
This forces integer division and works with python 2 and python 3.

<rdar://problem/52073911>

llvm-svn: 364465
2019-06-26 19:51:57 +00:00
JF Bastien 0e82895826 BitStream reader: propagate errors
The bitstream reader handles errors poorly. This has two effects:

 * Bugs in file handling (especially modules) manifest as an "unexpected end of
   file" crash
 * Users of clang as a library end up aborting because the code unconditionally
   calls `report_fatal_error`

The bitstream reader should be more resilient and return Expected / Error as
soon as an error is encountered, not way late like it does now. This patch
starts doing so and adopting the error handling where I think it makes sense.
There's plenty more to do: this patch propagates errors to be minimally useful,
and follow-ups will propagate them further and improve diagnostics.

https://bugs.llvm.org/show_bug.cgi?id=42311
<rdar://problem/33159405>

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

llvm-svn: 364464
2019-06-26 19:50:12 +00:00
Craig Topper afa58b6ba1 [X86] Remove isTypePromotionOfi1ZeroUpBits and its helpers.
This was trying to optimize concat_vectors with zero of setcc or
kand instructions. But I think it produced the same code we
produce for a concat_vectors with 0 even it it doesn't come from
one of those operations.

llvm-svn: 364463
2019-06-26 19:45:48 +00:00
Xing Xue 600941e34f Print NULL as "(null)" in diagnostic message
Summary:
Passing a null pointer to the printf family for a %s format specifier leads to undefined behaviour. The tests currently expect (null). Explicitly test for a null pointer and provide the expected string.

Authored By: andusy

Reviewers: hubert.reinterpretcast, xingxue, jasonliu, daltenty, cebowleratibm

Reviewed By: hubert.reinterpretcast

Subscribers: arphaman, jsji, cfe-commits

Tags: #llvm

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

llvm-svn: 364462
2019-06-26 19:27:16 +00:00
David Blaikie 730a95c88a Fix some undefined behavior (excessive shift of signed value) in r364253 detected by ubsan
llvm-svn: 364461
2019-06-26 19:18:50 +00:00
Nicolai Haehnle 806600987d llvm-objcopy: silence warning introduced in r364296
Change-Id: I306e866d497e55945fb3b471eb0727b63ad9e4b9
llvm-svn: 364460
2019-06-26 19:16:35 +00:00
Simon Pilgrim 7ce858cc8c Fix Wdocumentation warnings. NFCI.
llvm-svn: 364459
2019-06-26 18:53:24 +00:00
Simon Pilgrim dfe079ffbf [X86][SSE] getFauxShuffleMask - handle OR(x,y) where x and y have no overlapping bits
Create a per-byte shuffle mask based on the computeKnownBits from each operand - if for each byte we have a known zero (or both) then it can be safely blended.

Fixes PR41545

llvm-svn: 364458
2019-06-26 18:21:26 +00:00
Jonas Devlieghere 27789ce049 [Reproducers] Copy over access/modification time in the FileCollector.
Copy over access and modification time for the files included in the
reproducer. This is needed to pass tests that check the integrity of
object files based on their time stamp.

llvm-svn: 364457
2019-06-26 18:14:31 +00:00
Andrey Churbanov b7e6c37efe Fixed memory use-after-free problem.
Bug reported in https://bugs.llvm.org/show_bug.cgi?id=42269.
Freeing of the contention group (CG) stucture by master thread looks wrong,
because workers can leave the CG later on. Intead the freeing
is now done by the last thread leaving the CG.

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

llvm-svn: 364456
2019-06-26 18:11:26 +00:00
Sanjay Patel 46a3dbf9a6 Revert [InstCombine] change 'tmp' variable names; NFC
This reverts r364452 (git commit 6083ae0b4a)

llvm-svn: 364455
2019-06-26 18:06:51 +00:00
Simon Pilgrim 16ba077a2d [X86][AVX] Add reduced test case for PR41545
llvm-svn: 364454
2019-06-26 17:56:53 +00:00
Nico Weber 908b697e78 Make AddLastArg() variadic and use it more. No behavior change.
llvm-svn: 364453
2019-06-26 17:51:47 +00:00
Sanjay Patel 6083ae0b4a [InstCombine] change 'tmp' variable names; NFC
I don't think there was anything going wrong here,
but the auto-generating CHECK line script is known
to have problems with 'TMP' because it uses that
to match nameless values.

llvm-svn: 364452
2019-06-26 17:43:30 +00:00
Ryan Taylor 9ab812d475 [AMDGPU] Fix for branch offset hardware workaround
Summary:
This fixes a hardware bug that makes a branch offset of 0x3f unsafe.
This replaces the 32 bit branch with offset 0x3f to a 64 bit
instruction that includes the same 32 bit branch and the encoding
for a s_nop 0 to follow. The relaxer than modifies the offsets
accordingly.

Change-Id: I10b7aed99d651f8159401b01bb421f105fa6288e

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

Tags: #llvm

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

llvm-svn: 364451
2019-06-26 17:34:57 +00:00
Ulrich Weigand 4c86dd9032 Allow matching extend-from-memory with strict FP nodes
This implements a small enhancement to https://reviews.llvm.org/D55506

Specifically, while we were able to match strict FP nodes for
floating-point extend operations with a register as source, this
did not work for operations with memory as source.

That is because from regular operations, this is represented as
a combined "extload" node (which is a variant of a load SD node);
but there is no equivalent using a strict FP operation.

However, it turns out that even in the absence of an extload
node, we can still just match the operations explicitly, e.g.
   (strict_fpextend (f32 (load node:$ptr))

This patch implements that method to match the LDEB/LXEB/LXDB
SystemZ instructions even when the extend uses a strict-FP node.

llvm-svn: 364450
2019-06-26 17:19:12 +00:00
Philip Reames 03b2e2d986 [IndVars] Kill a redundant bit of debug output
llvm-svn: 364449
2019-06-26 17:19:09 +00:00
Greg Clayton 208cce7500 Fix builbots after r364427.
I was using an iterator that was equal to the end of a collection.

llvm-svn: 364447
2019-06-26 16:22:58 +00:00
Thomas Lively 7663e0cd7d [WebAssembly] Omit wrap on i64x2.{shl,shr*} ISel when possible
Summary:
Since the WebAssembly SIMD shift instructions take i32 operands, we
truncate the i64 operand to <2 x i64> shifts during ISel. When the i64
operand is sign extended from i32, this CL makes it so the sign
extension is dropped instead of a wrap instruction added.

Reviewers: dschuff, aheejin

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 364446
2019-06-26 16:19:59 +00:00
Thomas Lively a1d97a960e [WebAssembly] Implement tail calls and unify tablegen call classes
Summary:
Implements direct and indirect tail calls enabled by the 'tail-call'
feature in both DAG ISel and FastISel. Updates existing call tests and
adds new tests including a binary encoding test.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 364445
2019-06-26 16:17:15 +00:00
Scott Linder c95046501d Fix leaks in LLVMCreateDisasmCPUFeatures
Differential Revision: https://reviews.llvm.org/D63795

llvm-svn: 364444
2019-06-26 16:13:17 +00:00
Jonas Devlieghere c8232e4310 [dotest] Add the ability to set environment variables for the inferior.
This patch adds a dotest flag for setting environment variables for the
inferior. This is different from the current --env flag, which sets
variables in the debugger's environment. This allows us to set things
like LD_LIBRARY_PATH for testing.

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

llvm-svn: 364443
2019-06-26 16:12:08 +00:00
Yitzhak Mandelbaum 039af0ea03 [clang-tidy] Generalize TransformerClangTidyCheck to take a rule generator.
Summary: Tidy check behavior often depends on language and/or clang-tidy options. This revision allows a user of TranformerClangTidyCheck to pass rule _generator_ in place of a rule, where the generator takes both the language and clang-tidy options. Additionally, the generator returns an `Optional` to allow for the case where the check is deemed irrelevant/disable based on those options.

Reviewers: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 364442
2019-06-26 16:04:38 +00:00
Sanjay Patel 71ad22707c [InstCombine] simplify code for inserts -> splat; NFC
llvm-svn: 364441
2019-06-26 15:52:59 +00:00
Michael Liao 68ea5fee21 Fix build in shared lib mode.
- The newly added GSYM misses LLVMBuild.txt. Add a barely one to pass
  the build.

llvm-svn: 364440
2019-06-26 15:46:48 +00:00
Alexandre Ganea d1a34f314d [xray] Remove usage of procid_t
Differential Revision: https://reviews.llvm.org/D61946

llvm-svn: 364439
2019-06-26 15:42:42 +00:00
Alexandre Ganea 90079977ac [LLD][COFF] Case insensitive compares for /nodefaultlib
Differential Revision: https://reviews.llvm.org/D63775

llvm-svn: 364438
2019-06-26 15:40:17 +00:00
Sanjay Patel dfdee7bc15 [InstCombine] regenerate test checks; NFC
llvm-svn: 364437
2019-06-26 15:24:08 +00:00
Evandro Menezes 42e13c8328 [CodeGen] Improve formatting of jump tables (NFC)
Split jump tables into individual lines and fix spacing.

llvm-svn: 364436
2019-06-26 15:11:31 +00:00
Yitzhak Mandelbaum 83b1580e1b [clang-tidy] Fix ClangTidyTest to initialize context before checks.
Summary:
Currently, `clang::tidy::test::runCheckOnCode()` constructs the check
instances *before* initializing the ClangTidyContext. This ordering causes
problems when the check's constructor accesses the context, for example, through
`getLangOpts()`.

This revision moves the construction to after the context initialization, which
follows the pattern used in the clang tidy tool itself.

Reviewers: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 364435
2019-06-26 15:04:33 +00:00