]> granicus.if.org Git - llvm/log
llvm
5 years ago[Attributor] FIX: Try to make bots happy
Johannes Doerfert [Wed, 21 Aug 2019 22:21:13 +0000 (22:21 +0000)]
[Attributor] FIX: Try to make bots happy

Locally the tight iterations bounds work fine but the bots seem unhappy.
Try to get green bots and some time to determine the underlying problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369592 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Remove fix introduced by r369573, superseded by r369580
Luis Marques [Wed, 21 Aug 2019 22:02:56 +0000 (22:02 +0000)]
[RISCV] Remove fix introduced by r369573, superseded by r369580

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369590 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Fix: Gracefully handle non-instruction users
Johannes Doerfert [Wed, 21 Aug 2019 21:48:56 +0000 (21:48 +0000)]
[Attributor] Fix: Gracefully handle non-instruction users

Function can have users that are not instructions, e.g., bitcasts. For
now, we simply give up when we see them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369588 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges
Greg Clayton [Wed, 21 Aug 2019 21:48:11 +0000 (21:48 +0000)]
Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges

The full GSYM patch started with: https://reviews.llvm.org/D53379

This patch add the ability to encode data using the new llvm::gsym::FileWriter class.

FileWriter is a simplified binary data writer class that doesn't require targets, target definitions, architectures, or require any other optional compile time libraries to be enabled via the build process. This class needs the ability to seek to different spots in the binary data that it produces to fix up offsets and sizes in GSYM data. It currently uses std::ostream over llvm::raw_ostream because llvm::raw_ostream doesn't support seeking which is required when encoding and decoding GSYM data.

AddressRange objects are encoded and decoded to be relative to a base address. This will be the FunctionInfo's start address if the AddressRange is directly contained in a FunctionInfo, or a base address of the containing parent AddressRange or AddressRanges. This allows address ranges to be efficiently encoded using ULEB128 encodings as we encode the offset and size of each range instead of full addresses. This also makes encoded addresses easy to relocate as we just need to relocate one base address.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369587 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFCI] Introduce tight iteration bounds in the tests
Johannes Doerfert [Wed, 21 Aug 2019 21:42:46 +0000 (21:42 +0000)]
[Attributor][NFCI] Introduce tight iteration bounds in the tests

Summary:
To be able to track how many iterations we need to manifest all
information we check for we now make the maximum iteration count
explicit. The count is set tightly now and should be kept that way.

Reviewers: uenoku, sstefan1

Subscribers: bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369586 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse C++14 heteregenous lookup for a couple of std::map<std::string, ...>
Benjamin Kramer [Wed, 21 Aug 2019 21:17:34 +0000 (21:17 +0000)]
Use C++14 heteregenous lookup for a couple of std::map<std::string, ...>

These call find with a StringRef, heterogenous lookup saves a temporary
std::string there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369581 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Fix use of side-effects in asserts in decoder functions
Luis Marques [Wed, 21 Aug 2019 21:11:37 +0000 (21:11 +0000)]
[RISCV] Fix use of side-effects in asserts in decoder functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369580 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BinaryFormat] Teach identify_magic about Tapi files.
Cyndy Ishida [Wed, 21 Aug 2019 21:00:16 +0000 (21:00 +0000)]
[BinaryFormat] Teach identify_magic about Tapi files.

Summary:
Tapi files are YAML files that start with the !tapi tag. The only execption are
TBD v1 files, which don't have a tag. In that case we have to scan a little
further and check if the first key "archs" exists.

This is the first patch in a series of patches to add libObject support for
text-based dynamic library (.tbd) files.

This patch is practically exactly the same as D37820, that was never pushed to master,
and is needed for future commits related to reading tbd files for llvm-nm

Reviewers: ributzka, steven_wu, bollu, espindola, jfb, shafik, jdoerfert

Reviewed By: steven_wu

Subscribers: dexonsmith, llvm-commits

Tags: #llvm, #clang, #sanitizers, #lldb, #libc, #openmp

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369579 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Fix copy & paste error
Johannes Doerfert [Wed, 21 Aug 2019 20:57:20 +0000 (20:57 +0000)]
[Attributor][NFC] Fix copy & paste error

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369577 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Remove leftover semicolon
Johannes Doerfert [Wed, 21 Aug 2019 20:56:56 +0000 (20:56 +0000)]
[Attributor][NFC] Remove leftover semicolon

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369576 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Use existing unreachable instead of introducing new ones
Johannes Doerfert [Wed, 21 Aug 2019 20:56:41 +0000 (20:56 +0000)]
[Attributor] Use existing unreachable instead of introducing new ones

So far we split the unreachable off and placed a new one, this is not
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369575 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix -Werror=unused-variable error after r369528.
Richard Smith [Wed, 21 Aug 2019 20:42:37 +0000 (20:42 +0000)]
Fix -Werror=unused-variable error after r369528.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369573 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369568
Nico Weber [Wed, 21 Aug 2019 20:20:36 +0000 (20:20 +0000)]
gn build: Merge r369568

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369572 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Make sync script not exit 1 if it writes changes
Nico Weber [Wed, 21 Aug 2019 20:13:00 +0000 (20:13 +0000)]
gn build: Make sync script not exit 1 if it writes changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369571 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GVN] Do PHI translations across all edges between the load and the unavailable pred.
Florian Hahn [Wed, 21 Aug 2019 20:06:50 +0000 (20:06 +0000)]
[GVN] Do PHI translations across all edges between the load and the unavailable pred.

Currently we do not properly translate addresses with PHIs if LoadBB !=
LI->getParent(), because PHITranslateAddr expects a direct predecessor as argument,
because it considers all instructions outside of the current block to
not requiring translation.

The amount of cases that trigger this should be very low, as most single
predecessor blocks should be folded into their predecessor by GVN before
we actually start with value numbering. It is still not guaranteed to
happen, so we should do PHI translation along all edges between the
loads' block and the predecessor where we have to place a load.

There are a few test cases showing current limits of the PHI translation, which
could be improved later.

Reviewers: spatel, reames, efriedma, john.brawn

Reviewed By: efriedma

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369570 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r369549 as it broke the bots.
Aaron Ballman [Wed, 21 Aug 2019 20:00:41 +0000 (20:00 +0000)]
Revert r369549 as it broke the bots.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/13605/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369569 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r367389 (and follow-up r368404); it caused PR43073.
Nico Weber [Wed, 21 Aug 2019 19:53:42 +0000 (19:53 +0000)]
Revert r367389 (and follow-up r368404); it caused PR43073.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369567 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Handle aliases in WebAssemblyFixFunctionBitcasts
Sam Clegg [Wed, 21 Aug 2019 19:52:33 +0000 (19:52 +0000)]
[WebAssembly] Handle aliases in WebAssemblyFixFunctionBitcasts

Fixes: https://github.com/emscripten-core/emscripten/issues/8770
Differential Revision: https://reviews.llvm.org/D66508

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369566 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MVT] Add v16f16 and v32f16 vectors.
Craig Topper [Wed, 21 Aug 2019 19:14:48 +0000 (19:14 +0000)]
[MVT] Add v16f16 and v32f16 vectors.

I might look at improving PR43065 which will require being
able to mark a 256 and 512 bit vector of f16 as Legal.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369565 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Include ValueTypes.td directly into the intrinsic-varargs.td test.
Craig Topper [Wed, 21 Aug 2019 19:14:38 +0000 (19:14 +0000)]
[TableGen] Include ValueTypes.td directly into the intrinsic-varargs.td test.

This prevents needing to keep the test in sync with ValueTypes.td

This is not the only test that includes ValueTypes.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369564 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Replace call `expandLoadAddress` by `loadAndAddSymbolAddress`. NFC
Simon Atanasyan [Wed, 21 Aug 2019 18:54:51 +0000 (18:54 +0000)]
[mips] Replace call `expandLoadAddress` by `loadAndAddSymbolAddress`. NFC

In case of expanding `lw/sw $reg, symbol($reg)` instruction for PIC it's
enough to call the `loadAndAddSymbolAddress` method. Additional work
performed by the `expandLoadAddress` is not required here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369563 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Remove duplicated case from the `StringSwitch`. NFC
Simon Atanasyan [Wed, 21 Aug 2019 18:54:41 +0000 (18:54 +0000)]
[mips] Remove duplicated case from the `StringSwitch`. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369562 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Remove mostly redundant calls to AddToWorklist
Amaury Sechet [Wed, 21 Aug 2019 18:51:08 +0000 (18:51 +0000)]
[DAGCombiner] Remove mostly redundant calls to AddToWorklist

Summary:
These calls change the order in which some nodes are processed and so have an effect on codegen.

The change in fixup-bw-copy.ll is due to (and (load anyext)) gets transformed into (load zext) while previously the and was removed by SimplifyDemandedBits, so the (load anyext) remained.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369561 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Add GwpAsan to toctree.
Mitch Phillips [Wed, 21 Aug 2019 18:31:03 +0000 (18:31 +0000)]
[docs] Add GwpAsan to toctree.

Reverts rL369556 in the process, as it's no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369560 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BitcodeReader] Check if we can create a null constant for type.
Florian Hahn [Wed, 21 Aug 2019 18:20:11 +0000 (18:20 +0000)]
[BitcodeReader] Check if we can create a null constant for type.

We cannot create null constants for certain types, e.g. VoidTy,
FunctionTy or LabelTy. getNullValue asserts if we pass in an
unsupported type. We should also check for opaque types, but I'm not
sure how.

This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14795.

Reviewers: t.p.northover, jfb, vsk

Reviewed By: vsk

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369557 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Fix GwpAsan.rst
Jordan Rupprecht [Wed, 21 Aug 2019 18:09:31 +0000 (18:09 +0000)]
[docs] Fix GwpAsan.rst

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369556 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd newline to GWP-ASan sphinx document.
Mitch Phillips [Wed, 21 Aug 2019 18:03:11 +0000 (18:03 +0000)]
Add newline to GWP-ASan sphinx document.
Should fix the document builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369554 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Convert remaining command guide entries from md to rst.
Jordan Rupprecht [Wed, 21 Aug 2019 18:00:17 +0000 (18:00 +0000)]
[docs] Convert remaining command guide entries from md to rst.

Summary:
Linking between markdown and rst files is currently not supported very well, e.g. the current llvm-addr2line docs [1] link to "llvm-symbolizer" instead of "llvm-symbolizer.html". This is weirdly broken in different ways depending on which versions of sphinx and recommonmark are being used, so workaround the bug by using rst everywhere.

[1] http://llvm.org/docs/CommandGuide/llvm-addr2line.html

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369553 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GWP-ASan] Add public-facing documentation [6].
Mitch Phillips [Wed, 21 Aug 2019 17:53:51 +0000 (17:53 +0000)]
[GWP-ASan] Add public-facing documentation [6].

Summary:
Note: Do not submit this documentation until Scudo support is reviewed and submitted (should be #[5]).

See D60593 for further information.

This patch introduces the public-facing documentation for GWP-ASan, as well as updating the definition of one of the options, which wasn't properly merged. The document describes the design and features of GWP-ASan, as well as how to use GWP-ASan from both a user's standpoint, and development documentation for supporting allocators.

Reviewers: jfb, morehouse, vlad.tsyrklevich

Reviewed By: morehouse, vlad.tsyrklevich

Subscribers: kcc, dexonsmith, kubamracek, cryptoad, jfb, #sanitizers, llvm-commits, vlad.tsyrklevich, morehouse

Tags: #sanitizers, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369552 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix -Wimplicit-fallthrough warnings in regcomp.c
Nathan Huckleberry [Wed, 21 Aug 2019 17:07:43 +0000 (17:07 +0000)]
Fix -Wimplicit-fallthrough warnings in regcomp.c

Summary:
Since clang does not support comment style fallthrough annotations
these should be switched.

Reviewers: aaron.ballman, nickdesaulniers, xbolva00

Reviewed By: aaron.ballman, nickdesaulniers, xbolva00

Subscribers: xbolva00, nickdesaulniers, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369549 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.
Alina Sbirlea [Wed, 21 Aug 2019 17:00:57 +0000 (17:00 +0000)]
[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.

Summary:
Add a flag to the FunctionToLoopAdaptor that allows enabling MemorySSA only for the loop pass managers that are known to preserve it.

If an LPM is known to have only loop transforms that *all* preserve MemorySSA, then use MemorySSA if `EnableMSSALoopDependency` is set.
If an LPM has loop passes that do not preserve MemorySSA, then the flag passed is `false`, regardless of the value of `EnableMSSALoopDependency`.

When using a custom loop pass pipeline via `passes=...`, use keyword `loop` vs `loop-mssa` to use MemorySSA in that LPM. If a loop that does not preserve MemorySSA is added while using the `loop-mssa` keyword, that's an error.

Add the new `loop-mssa` keyword to a few tests where a difference occurs when enabling MemorySSA.

Reviewers: chandlerc

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369548 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Implement moreElementsVector for G_UNMERGE_VALUES sources
Matt Arsenault [Wed, 21 Aug 2019 16:59:10 +0000 (16:59 +0000)]
GlobalISel: Implement moreElementsVector for G_UNMERGE_VALUES sources

This is necessary for handling <3 x s16> on AMDGPU, assuming this
should be handled as 2 separate legalization actions. The alternative
would be for fewerElementsVector to handle 3->2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369547 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd a couple of extra test noticed in post-commit discussion of rL369541
Philip Reames [Wed, 21 Aug 2019 16:57:53 +0000 (16:57 +0000)]
Add a couple of extra test noticed in post-commit discussion of rL369541

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369546 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Formatting for ARMInstrMVE.td. NFC
David Green [Wed, 21 Aug 2019 16:20:35 +0000 (16:20 +0000)]
[ARM] Formatting for ARMInstrMVE.td. NFC

This is just some formatting cleanup, prior to the masked load and store patch
in D66534.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369545 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogit-llvm: Make push --force suppress error on nothing to commit as well
Nico Weber [Wed, 21 Aug 2019 16:03:34 +0000 (16:03 +0000)]
git-llvm: Make push --force suppress error on nothing to commit as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369544 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[instcombine] icmp eq/ne (sub C, Y), C -> icmp eq/ne Y, 0
Philip Reames [Wed, 21 Aug 2019 15:51:57 +0000 (15:51 +0000)]
[instcombine] icmp eq/ne (sub C, Y), C -> icmp eq/ne Y, 0

Noticed while looking at pr43028.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369541 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogit-llvm: Give "push" a --force flag to disable confirm prompt on multiple commits
Nico Weber [Wed, 21 Aug 2019 15:41:20 +0000 (15:41 +0000)]
git-llvm: Give "push" a --force flag to disable confirm prompt on multiple commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369538 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoImproving CodeView debug info type record's inline comments
Nilanjana Basu [Wed, 21 Aug 2019 15:19:58 +0000 (15:19 +0000)]
Improving CodeView debug info type record's inline comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369533 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Prevent VGPR copies from moving across the EXEC mask definitions
Alexander Timofeev [Wed, 21 Aug 2019 15:15:04 +0000 (15:15 +0000)]
[AMDGPU] Prevent VGPR copies from moving across the EXEC mask definitions
Differential Revision: https://reviews.llvm.org/D63731
Reviewers: qcolombet, rampitec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369532 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LLVM][Alignment] Introduce Alignment In MachineFrameInfo
Guillaume Chatelet [Wed, 21 Aug 2019 14:29:30 +0000 (14:29 +0000)]
[LLVM][Alignment] Introduce Alignment In MachineFrameInfo

Summary:
This is patch is part of a serie to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: jfb

Subscribers: hiraditya, dexonsmith, llvm-commits, courbet

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369531 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Adjust return type of DWARFUnit::getLength().
Igor Kudrin [Wed, 21 Aug 2019 14:10:57 +0000 (14:10 +0000)]
[DWARF] Adjust return type of DWARFUnit::getLength().

DWARFUnitHeader::getLength() returns uint64_t.
DWARFUnit::getLength() should do the same.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369529 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Add support for RVC HINT instructions
Luis Marques [Wed, 21 Aug 2019 14:00:58 +0000 (14:00 +0000)]
[RISCV] Add support for RVC HINT instructions

The hint instructions are enabled by default (if the standard C extension is
enabled). To disable them pass -mattr=-rvc-hints.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369528 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoreland [gtest] Fix printing of StringRef and SmallString in assert messages.
Sam McCall [Wed, 21 Aug 2019 13:56:29 +0000 (13:56 +0000)]
reland [gtest] Fix printing of StringRef and SmallString in assert messages.

Renames GTEST_NO_LLVM_RAW_OSTREAM -> GTEST_NO_LLVM_SUPPORT and guards
the new features behind it.

This reverts commit a063bcf3ef5a879adbe9639a3c187d876eee0e66.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369527 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd 9.0 release bug to merge request script
Simon Atanasyan [Wed, 21 Aug 2019 13:42:10 +0000 (13:42 +0000)]
Add 9.0 release bug to merge request script

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369526 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[gtest] Fix printing of StringRef and SmallString in assert messages."
Sam McCall [Wed, 21 Aug 2019 13:31:44 +0000 (13:31 +0000)]
Revert "[gtest] Fix printing of StringRef and SmallString in assert messages."

This reverts commit 4becb2ab4e9f52ce98272d1f5930d6942af5172b.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369525 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Various nits. NFC
Amaury Sechet [Wed, 21 Aug 2019 12:01:37 +0000 (12:01 +0000)]
[DAGCombiner] Various nits. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369520 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] narrow icmp with extended operands of different widths
Sanjay Patel [Wed, 21 Aug 2019 11:56:08 +0000 (11:56 +0000)]
[InstCombine] narrow icmp with extended operands of different widths

An intermediate extend is used to widen the narrow operand to the width of
the other (wider) operand. At that point, we have the same logic as the
existing transform that was restricted to folds of equal width zext/sext.

This mostly solves PR42700:
https://bugs.llvm.org/show_bug.cgi?id=42700

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369519 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[gtest] Fix printing of StringRef and SmallString in assert messages.
Sam McCall [Wed, 21 Aug 2019 11:37:06 +0000 (11:37 +0000)]
[gtest] Fix printing of StringRef and SmallString in assert messages.

Summary:
These are detected by gtest as containers, and so previously printed as e.g.
  { '.' (46, 0x2E), 's' (115, 0x73), 'e' (101, 0x65), 'c' (99, 0x63), '0' (48, 0x30) },

gtest itself overloads PrintTo for std::string and friends, we use the same mechanism.

Reviewers: labath

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369518 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMinidumpYAML: move serialization code to MinidumpEmitter.cpp
Pavel Labath [Wed, 21 Aug 2019 11:30:48 +0000 (11:30 +0000)]
MinidumpYAML: move serialization code to MinidumpEmitter.cpp

Summary:
The code for serializing minidumps was living in MinidumpYAML.cpp
so that it would be accessible from unit tests. While this had its
advantages, it was also unfortunate because it broke symmetry with all
other yaml2obj serializers.

Fortunately, nowadays all of yaml2obj is a library, so we don't need to
do anything special. This patch improves the code consistency by moving
the serialization code to MinidumpEmitter.cpp to match the style used in
other backends. It also removes the writeAsBinary entry point in favor
of the more general convertYAML interface.

This patch is just massaging the code a bit. There shouldn't be any
functional change here.

Reviewers: jhenderson, abrachet

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369517 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] - Cleanup the error reporting.
George Rimar [Wed, 21 Aug 2019 11:07:31 +0000 (11:07 +0000)]
[llvm-objdump] - Cleanup the error reporting.

The error reporting function are not consistent.

Before this change:

* They had inconsistent naming (e.g. 'error' vs 'report_error').
* Some of them reported the object name, others - dont.
* Some of them accepted the case when there was no error. (i.e. error code or Error had a success value).

This patch tries to cleanup it a bit.

It also renames report_error -> reportError, report_warning -> reportWarning
and removes a full stop from messages.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369515 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] NarrowScalar G_ZEXTLOAD and G_SEXTLOAD
Petar Avramovic [Wed, 21 Aug 2019 09:43:20 +0000 (09:43 +0000)]
[MIPS GlobalISel] NarrowScalar G_ZEXTLOAD and G_SEXTLOAD

NarrowScalar G_ZEXTLOAD and G_SEXTLOAD to s32 for MIPS32.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369512 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] NarrowScalar G_ZEXT and G_SEXT
Petar Avramovic [Wed, 21 Aug 2019 09:35:02 +0000 (09:35 +0000)]
[MIPS GlobalISel] NarrowScalar G_ZEXT and G_SEXT

NarrowScalar G_ZEXT and G_SEXT to s32 for MIPS32.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369511 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] Consider type1 when legalizing shifts after r351882
Petar Avramovic [Wed, 21 Aug 2019 09:31:29 +0000 (09:31 +0000)]
[MIPS GlobalISel] Consider type1 when legalizing shifts after r351882

r351882 allows different type for shift amount then result and value
being shifted. Fix MIPS Legalizer rules to take r351882 into account.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369510 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] NarrowScalar G_TRUNC
Petar Avramovic [Wed, 21 Aug 2019 09:26:39 +0000 (09:26 +0000)]
[MIPS GlobalISel] NarrowScalar G_TRUNC

Add NarrowScalar for G_TRUNC when NarrowTy is half the size of source.
NarrowScalar G_TRUNC to s32 for MIPS32.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369509 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Avoid dropping location info across block boundaries
Jeremy Morse [Wed, 21 Aug 2019 09:22:31 +0000 (09:22 +0000)]
[DebugInfo] Avoid dropping location info across block boundaries

LiveDebugValues propagates variable locations between blocks by creating
new DBG_VALUE insts in the successors, then interpreting them when it
passes back through the block at a later time. However, this flushes out
any extra information about the location that LiveDebugValues holds: for
example, connections between variable locations such as discussed in
D65368. And as reported in PR42772 this causes us to lose track of the
fact that a spill-location is actually a spill, not a register location.

This patch fixes that by deferring the creation of propagated DBG_VALUEs
until after propagation has completed: instead location propagation occurs
only by sharing location ID numbers between blocks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369508 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Update MTE system register encodings
Luke Cheeseman [Wed, 21 Aug 2019 09:09:56 +0000 (09:09 +0000)]
[AArch64] Update MTE system register encodings

The encodings for the system registers TFSRE0_EL1, TFSR_EL1 TFSR_EL2, TFSR_EL3
and TFSR_EL12 have been changed so that they consistently have CRn=5 and CRm=6
as per https://developer.arm.com/docs/ddi0487/latest.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369505 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoBe explicit about Windows coff name trailing character policy
Serge Guelton [Wed, 21 Aug 2019 07:54:42 +0000 (07:54 +0000)]
Be explicit about Windows coff name trailing character policy

It's okay to *not* copy the trailing zero of a windows section/symbol name.
This is compatible with strncpy behavior but gcc doesn't know that and
throws an invalid warning. Encode this behavior in a proper function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369501 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Mark CallTargetComparator() as const to fix libc++ warnings
Raphael Isemann [Wed, 21 Aug 2019 07:39:17 +0000 (07:39 +0000)]
[NFC] Mark CallTargetComparator() as const to fix libc++ warnings

We currently get this warning when compiling with libc++:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:454:26: warning: the specified comparator type does not provide a const call operator [-Wuser-defined-warnings]
    static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
                         ^
llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:193:29: note: in instantiation of template class 'std::__1::set<std::__1::pair<llvm::StringRef, unsigned long long>, llvm::sampleprof::SampleRecord::CallTargetComparator, std::__1::allocator<std::__1::pair<llvm::StringRef, unsigned long long> > >' requested here
  const SortedCallTargetSet getSortedCallTargets() const {
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:967:5: note: from 'diagnose_if' attribute on '__diagnose_non_const_comparator<std::__1::pair<llvm::StringRef, unsigned long long>, llvm::sampleprof::SampleRecord::CallTargetComparator>':
    _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
    ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1320:21: note: expanded from macro '_LIBCPP_DIAGNOSE_WARNING'
     __attribute__((diagnose_if(__VA_ARGS__, "warning")))
                    ^           ~~~~~~~~~~~
1 warning generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369500 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix 'fall through' annotation
Vitaly Buka [Wed, 21 Aug 2019 04:05:34 +0000 (04:05 +0000)]
Fix 'fall through' annotation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369490 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAutogenerate the shebang lines for tools/opt-viewer
Chris Bieneman [Wed, 21 Aug 2019 01:48:28 +0000 (01:48 +0000)]
Autogenerate the shebang lines for tools/opt-viewer

Summary:
Since these files depend on the built python modules, they need to use
the right python binary to run them. So use configure_file
to set the right shebang line.

Patch By: cbiesinger (Christian Biesinger)

Reviewers: chandlerc, beanz, anemet

Reviewed By: anemet

Subscribers: compnerd, JDevlieghere, mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369486 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] Add support for narrowScalar of G_ZEXT
Amara Emerson [Wed, 21 Aug 2019 00:12:37 +0000 (00:12 +0000)]
[AArch64][GlobalISel] Add support for narrowScalar of G_ZEXT

We do this by merging the source with the high bits set to 0.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369480 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove llvm/utils/git/find-rev
Nico Weber [Tue, 20 Aug 2019 23:59:07 +0000 (23:59 +0000)]
Remove llvm/utils/git/find-rev

It assumes git-svn, hasn't been touched in ages, and it's replaced
by llvm-git in llvm/utils/git-svn.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369478 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369467
Nico Weber [Tue, 20 Aug 2019 23:49:12 +0000 (23:49 +0000)]
gn build: Merge r369467

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369476 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Automatically generate shift tests. NFC
Amaury Sechet [Tue, 20 Aug 2019 23:47:19 +0000 (23:47 +0000)]
[X86] Automatically generate shift tests. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369475 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd TinyPtrVector support for general pointer-like things.
Andrew Trick [Tue, 20 Aug 2019 23:29:28 +0000 (23:29 +0000)]
Add TinyPtrVector support for general pointer-like things.

In particular, make TinyPtrVector<PtrIntPair<T *, 1>> work. Remove all
unnecessary assumptions that the element type has a formal "null"
representation. The important property to maintain is that
default-constructed element type has the same internal representation
as the default-constructed PointerUnion (all zero bits).

Remove the incorrect recursive behavior from
PointerUnion::isNull. This was never generally correct because it only
recursed over the first type parameter. With variadic templates it's
completely unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369473 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix assert in XCOFFObjectWriter related to program code csects.
Sean Fertile [Tue, 20 Aug 2019 23:24:47 +0000 (23:24 +0000)]
Fix assert in XCOFFObjectWriter related to program code csects.

Removed code that added program code csects to a collection as part
of addressing review comments, but I failed to update an assert affected
by the change before commiting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369471 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Liveness for internal functions.
Stefan Stipanovic [Tue, 20 Aug 2019 23:16:57 +0000 (23:16 +0000)]
[Attributor] Liveness for internal functions.

For an internal function, if all its call sites are dead, the body of the function is considered dead.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369470 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Autogenerate vec_* tests. NFC
Amaury Sechet [Tue, 20 Aug 2019 23:11:29 +0000 (23:11 +0000)]
[X86] Autogenerate vec_* tests. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369469 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sanitizer] Remove unused functions
Alexandre Ganea [Tue, 20 Aug 2019 22:56:40 +0000 (22:56 +0000)]
[Sanitizer] Remove unused functions

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369468 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV GlobalISel] Adding initial GlobalISel infrastructure
Daniel Sanders [Tue, 20 Aug 2019 22:53:24 +0000 (22:53 +0000)]
[RISCV GlobalISel] Adding initial GlobalISel infrastructure

Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.

Patch by Andrew Wei

Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders

Reviewed By: dsanders

Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369467 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Make Phi cleanups consistent.
Alina Sbirlea [Tue, 20 Aug 2019 22:47:58 +0000 (22:47 +0000)]
[MemorySSA] Make Phi cleanups consistent.

Summary:
Make Phi cleanups consistent: remove self as a trivial Phi and
recurse to potentially remove other trivial phis.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369466 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] Select logical_imm32 and logical_imm64 patterns
Jessica Paquette [Tue, 20 Aug 2019 22:31:25 +0000 (22:31 +0000)]
[AArch64][GlobalISel] Select logical_imm32 and logical_imm64 patterns

Add a GlobalISel equivalent for the logical_imm32_XFORM and logical_imm64_XFORM
SDNodeXForms in AArch64InstrFormats.td.

- Add select-logical-imm.mir, which contains tests for each imported pattern.

- Update select-pr32733.mir and select-scalar-shift-imm.mir, since they now
select instructions of this form.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369465 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Fix existing phis when inserting defs.
Alina Sbirlea [Tue, 20 Aug 2019 22:29:06 +0000 (22:29 +0000)]
[MemorySSA] Fix existing phis when inserting defs.

Summary:
When inserting a new Def, and inserting Phis in the IDF when needed,
also mark the already existing Phis in the IDF as non-optimized, since
these may need fixing as well.
In the test attached, there is a Phi in the IDF that happens to be
trivial, and is wrongfully removed by the call to getLastDef that
follows. This is a valid situation and the existing IDF Phis need to
marked as "may need fixing" as well.
Resolves PR43044.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369464 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove assert with tautological compare from XCOFFObjectWriter.
Sean Fertile [Tue, 20 Aug 2019 22:23:34 +0000 (22:23 +0000)]
Remove assert with tautological compare from XCOFFObjectWriter.

Remove assert of 'Sec->getCSectType() <= 0x07u' added in r369454, since its
always true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369462 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] Select patterns which use shifted register operands
Jessica Paquette [Tue, 20 Aug 2019 22:18:06 +0000 (22:18 +0000)]
[AArch64][GlobalISel] Select patterns which use shifted register operands

This adds GlobalISel equivalents for the following from AArch64InstrFormats:

- arith_shifted_reg32
- arith_shifted_reg64

And partial support for

- logical_shifted_reg32
- logical_shifted_reg32

The only thing missing for the logical cases is support for rotates. Other than
the missing support, the transformation is identical for the arithmetic shifted
register and the logical shifted register.

Lots of tests here:

- Add select-arith-shifted-reg.mir to show that we correctly select add and
sub instructions which use this pattern.

- Add select-logical-shifted-reg.mir to cover patterns which are not shared
between the arithmetic and logical cases.

- Update addsub-shifted.ll to show that we correctly fold shifts into
adds/subs.

- Update eon.ll to show that we can select the eon instruction by folding xors.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369460 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner][X86] Teach visitCONCAT_VECTORS to combine (concat_vectors (concat_vecto...
Craig Topper [Tue, 20 Aug 2019 22:12:50 +0000 (22:12 +0000)]
[DAGCombiner][X86] Teach visitCONCAT_VECTORS to combine (concat_vectors (concat_vectors X, Y), undef)) -> (concat_vectors X, Y, undef, undef)

I also had to add a new combine to X86's combineExtractSubvector to prevent a regression.

This helps our vXi1 code see the full concat operation and allow it optimize undef to a zero if there is already a zero in the concat. This helped us use a movzx instead of an AND in some of the tests. In those tests, one concat comes from SelectionDAGBuilder and the second comes from type legalization of v4i1->i4 bitcasts which uses an additional concat. Though these changes weren't my original motivation.

I'm looking at making X86ISelLowering's narrowShuffle emit a concat_vectors instead of an insert_subvector since concat_vectors is more canonical during early DAG combine. This patch helps prevent a regression from my experiments with that.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369459 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [WinEH] Allocate space in funclets stack to save XMM CSRs
Reid Kleckner [Tue, 20 Aug 2019 22:08:57 +0000 (22:08 +0000)]
Revert [WinEH] Allocate space in funclets stack to save XMM CSRs

This reverts r367088 (git commit 9ad565f70ec5fd3531056d7c939302d4ea970c83)

And the follow up fix r368631 / e9865b9b31bb2e6bc742dc6fca8f9f9517c3c43e

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369457 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTeach GlobalISelEmitter to treat used iPTRAny operands as pointer operands
Jessica Paquette [Tue, 20 Aug 2019 22:04:10 +0000 (22:04 +0000)]
Teach GlobalISelEmitter to treat used iPTRAny operands as pointer operands

Overloaded intrinsics can use iPTRAny in used/input operands.

The GlobalISelEmitter doesn't know that these are pointers, so it treats them
as scalars. As a result, these intrinsics can't be imported.

This teaches the GlobalISelEmitter to recognize these as pointers rather than
scalars.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369455 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdds support for writing the .bss section for XCOFF object files.
Sean Fertile [Tue, 20 Aug 2019 22:03:18 +0000 (22:03 +0000)]
Adds support for writing the .bss section for XCOFF object files.

Adds Wrapper classes for MCSymbol and MCSection into the XCOFF target
object writer. Also adds a class to represent the top-level sections, which we
materialize in the ObjectWriter.

executePostLayoutBinding will map all csects into the appropriate
container depending on its storage mapping class, and map all symbols
into their containing csect. Once all symbols have been processed we
- Assign addresses and symbol table indices.
- Calaculte section sizes.
- Build the section header table.
- Assign the sections raw-pointer value for non-virtual sections.

Since the .bss section is virtual, writing the header table is enough to
add support. Writing of a sections raw data, or of any relocations is
not included in this patch.

Testing is done by dumping the section header table, but it needs to be
extended to include dumping the symbol table once readobj support for
dumping auxiallary entries lands.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369454 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add more extra use tests for icmp with extends; NFC
Sanjay Patel [Tue, 20 Aug 2019 21:23:28 +0000 (21:23 +0000)]
[InstCombine] add more extra use tests for icmp with extends; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369447 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Remove unused variable. NFC.
Michael Liao [Tue, 20 Aug 2019 21:02:31 +0000 (21:02 +0000)]
[Attributor] Remove unused variable. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369444 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[test] Fix tests when run on windows after SVN r369426. NFC.
Martin Storsjo [Tue, 20 Aug 2019 20:58:02 +0000 (20:58 +0000)]
[test] Fix tests when run on windows after SVN r369426. NFC.

When running tests on windows, invoking "llc -march=<arch>" will
implicitly use windows as the target os, making these tests misbehave
after this change.

Fix the issue by using more specific -mtriple values instead of plain
-march in these tests.

This should hopefully fix buildbot failures like
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9816.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369443 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AutoFDO] Make call targets order deterministic for sample profile
Wenlei He [Tue, 20 Aug 2019 20:52:00 +0000 (20:52 +0000)]
[AutoFDO] Make call targets order deterministic for sample profile

Summary:
StringMap is used for storing call target to frequency map for AutoFDO. However the iterating order of StringMap is non-deterministic, which leads to non-determinism in AutoFDO profile output. Now new API getSortedCallTargets and SortCallTargets are added for deterministic ordering and output.

Roundtrip test for text profile and binary profile is added.

Reviewers: wmi, davidxl, danielcdh

Subscribers: hiraditya, mgrang, llvm-commits, twoh

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369440 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add tests for mismatched cast ops for icmp; NFC
Sanjay Patel [Tue, 20 Aug 2019 20:51:50 +0000 (20:51 +0000)]
[InstCombine] add tests for mismatched cast ops for icmp; NFC

Motivating case is shown in PR42700:
https://bugs.llvm.org/show_bug.cgi?id=42700

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369439 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-extract] Update the help message for group extraction feature
Jinsong Ji [Tue, 20 Aug 2019 20:45:16 +0000 (20:45 +0000)]
[llvm-extract] Update the help message for group extraction feature

Summary:
https://reviews.llvm.org/D60973 exposed the group extraction feature of
the BlockExtractor to llvm-extract.
However, the help message was not updated, so users might not be able to
know how to use this feature without looking into history/commits.

This patch just update the help message to show how to use this group
extraction feature.

Reviewers: qcolombet, volkan

Reviewed By: qcolombet

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369438 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add a DAG combine to transform (i8 (bitcast (v8i1 (extract_subvector (v16i1...
Craig Topper [Tue, 20 Aug 2019 20:20:04 +0000 (20:20 +0000)]
[X86] Add a DAG combine to transform (i8 (bitcast (v8i1 (extract_subvector (v16i1 X), 0)))) -> (i8 (trunc (i16 (bitcast (v16i1 X))))) on KNL target

Without AVX512DQ we don't have KMOVB so we can't really copy 8-bits of a k-register to a GPR. We have to copy 16 bits instead. We do this even if the DAG copy is from v8i1->v16i1. If we detect the (i8 (bitcast (v8i1 (extract_subvector (v16i1 X), 0)))) we should rewrite the types to match the copy we do support. By doing this, we can help known bits to propagate without losing the upper 8 bits of the input to the extract_subvector. This allows some zero extends to be removed since we have an isel pattern to use kmovw for (zero_extend (i16 (bitcast (v16i1 X))).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369434 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add isel patterns for (i64 (zext (i8 (bitcast (v16i1 X))))) to use a KMOVW...
Craig Topper [Tue, 20 Aug 2019 19:43:48 +0000 (19:43 +0000)]
[X86] Add isel patterns for (i64 (zext (i8 (bitcast (v16i1 X))))) to use a KMOVW and a SUBREG_TO_REG. Similar for i8 and anyextend.

We already had patterns for extending to i32 to take advantage of
the impliciting zeroing of the upper bits of a 32-bit GPR that is
done by KMOVW/KMOVB. But the extend might be all the way to i64,
in which case the existing patterns would fail and we'd get a
KMOVW/B followed by a MOVZX. By adding patterns for i64 we can
use the fact that KMOVW/B zero the upper bits of the 32-bit GPR
and the normal property that 32-bit GPR writes implicitly zero the
upper 32-bits of the full 64-bit GPR.

The anyextend patterns are slightly different since we don't care
about the upper zeros. For the i8->i64 I think this avoids selecting
the anyextend as a MOVZX to prevent a partial register issue that
doesn't exist. For i16->i64 I think we would have just emitted an
insert_subreg on top of the extract_subreg that the vXi16->i16
bitcast pattern emits. The register coalescer or peephole pass
should combine those, but this saves that work and makes i8/16
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369431 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TargetMachine] Don't try to create COFFSTUB references on windows on non-COFF
Martin Storsjo [Tue, 20 Aug 2019 18:58:05 +0000 (18:58 +0000)]
[TargetMachine] Don't try to create COFFSTUB references on windows on non-COFF

This avoids spurious relocation types for windows/elf targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369426 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly][lld] Fix crash when applying relocations to debug sections
Sam Clegg [Tue, 20 Aug 2019 18:39:24 +0000 (18:39 +0000)]
[WebAssembly][lld] Fix crash when applying relocations to debug sections

Debug sections are special in that they can contain relocations against
symbols that are not present in the final output (i.e. not live).
However it is also possible to have R_WASM_TABLE_INDEX relocations
against symbols that don't have a table index assigned (since they are
not address taken by actual code.

Fixes: https://github.com/emscripten-core/emscripten/issues/9023
Differential Revision: https://reviews.llvm.org/D66435

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369423 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add helper function for icmp+zext/sext; NFC
Sanjay Patel [Tue, 20 Aug 2019 18:15:17 +0000 (18:15 +0000)]
[InstCombine] add helper function for icmp+zext/sext; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369421 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix typo in comment. NFCI.
Simon Pilgrim [Tue, 20 Aug 2019 17:54:37 +0000 (17:54 +0000)]
Fix typo in comment. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369419 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "AMDGPU: Fix iterator error when lowering SI_END_CF"
Matt Arsenault [Tue, 20 Aug 2019 17:45:25 +0000 (17:45 +0000)]
Revert "AMDGPU: Fix iterator error when lowering SI_END_CF"

This reverts r367500 and r369203. This is causing various test
failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369417 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][BtVer2] Use ReadAfterLd entries for the register operands of CMPXCHG.
Andrea Di Biagio [Tue, 20 Aug 2019 17:05:56 +0000 (17:05 +0000)]
[X86][BtVer2] Use ReadAfterLd entries for the register operands of CMPXCHG.

This is a follow-up of r369365.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369412 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] make fold for icmp with sext more efficient; NFC
Sanjay Patel [Tue, 20 Aug 2019 17:03:22 +0000 (17:03 +0000)]
[InstCombine] make fold for icmp with sext more efficient; NFC

We were creating 2 instructions and relying on a subsequent fold
to invert a not(icmp). Create the final icmp directly instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369411 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use isNullConstant instead of getConstantOperandVal == 0. NFC
Craig Topper [Tue, 20 Aug 2019 16:55:12 +0000 (16:55 +0000)]
[X86] Use isNullConstant instead of getConstantOperandVal == 0. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369410 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Add EarlyIfConvert test missed in previous commit
Thomas Raoux [Tue, 20 Aug 2019 16:34:47 +0000 (16:34 +0000)]
[CodeGen] Add EarlyIfConvert test missed in previous commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369405 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Select vaddva
Sam Tebbs [Tue, 20 Aug 2019 16:33:34 +0000 (16:33 +0000)]
[ARM] Select vaddva

This patch adds vaddva selection.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369404 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel] Handle multiple registers in dbg.value intrinsic
Aditya Nandakumar [Tue, 20 Aug 2019 16:28:37 +0000 (16:28 +0000)]
[GlobalISel] Handle multiple registers in dbg.value intrinsic

https://reviews.llvm.org/D66077

The value passed into dbg.value may relate to multiple registers,
each of which need a DBG_VALUE.

This fix calls MIRBuilder.buildDirectDbgValue for each register.

Without this, IR passed in from flang-compiler/flang may fail an
assertion in getOrCreateVReg.

Patch by : peterwaller-arm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369403 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369298
Nico Weber [Tue, 20 Aug 2019 16:19:50 +0000 (16:19 +0000)]
gn build: Merge r369298

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369401 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRegex: Add isValid() with no parameter
Jan Kratochvil [Tue, 20 Aug 2019 16:05:23 +0000 (16:05 +0000)]
Regex: Add isValid() with no parameter

There will be some performance (only a little) improvement for LLDB's
RegularExpression::Execute.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369396 91177308-0d34-0410-b5e6-96231b3b80d8