]> granicus.if.org Git - llvm/log
llvm
5 years ago[Loop Peeling] Introduce an option for profile based peeling disabling.
Serguei Katkov [Fri, 2 Aug 2019 09:32:52 +0000 (09:32 +0000)]
[Loop Peeling] Introduce an option for profile based peeling disabling.

This patch adds an ability to disable profile based peeling
causing the peeling of all iterations and as a result prohibits
further unroll/peeling attempts on that loop.

The motivation to get an ability to separate peeling usage in
pipeline where in the first part we peel only separate iterations if needed
and later in pipeline we apply the full peeling which will prohibit further peeling.

Reviewers: reames, fhahn
Reviewed By: reames
Subscribers: hiraditya, zzheng, dmgreen, llvm-commits
Differential Revision: https://reviews.llvm.org/D64983

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

5 years ago[LV] Fix test failure in a Release build.
Jay Foad [Fri, 2 Aug 2019 08:33:41 +0000 (08:33 +0000)]
[LV] Fix test failure in a Release build.

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

5 years ago[NFC][ARM[ParallelDSP] Rename/remove/change types
Sam Parker [Fri, 2 Aug 2019 08:21:17 +0000 (08:21 +0000)]
[NFC][ARM[ParallelDSP] Rename/remove/change types

Remove forward declaration, fold a couple of typedefs and change one
to be more useful.

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

5 years ago[AliasAnalysis] Initialize a member variable that may be used by unit test.
Peter Smith [Fri, 2 Aug 2019 08:05:14 +0000 (08:05 +0000)]
[AliasAnalysis] Initialize a member variable that may be used by unit test.

The unit tests in BasicAliasAnalysisTest use the alias analysis API
directly and do not call setAAResults to initalize AAR. This gives a
valgrind error "Conditional Jump depends on unitialized variable".

On most buildbots the variable is nullptr, but in some cases it can be
non nullptr leading to seemingly random failures.

These tests were disabled in r366986. With the initialization they can be
enabled again.

Fixes PR42719

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

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

5 years ago[NFC][ARM][ParallelDSP] Remove ValueList
Sam Parker [Fri, 2 Aug 2019 07:32:28 +0000 (07:32 +0000)]
[NFC][ARM][ParallelDSP] Remove ValueList

We only care about the first element in the list.

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

5 years agoMoves the newly added test interleaved-accesses-waw-dependency.ll to X86 subdirectory.
Hideki Saito [Fri, 2 Aug 2019 07:25:09 +0000 (07:25 +0000)]
Moves the newly added test interleaved-accesses-waw-dependency.ll to X86 subdirectory.

ps4-buildslave1 reported a failure. The test has x86 triple.

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

5 years agoRevert r367649: Improve raw_ostream so that you can "write" colors using operator<<
Rui Ueyama [Fri, 2 Aug 2019 07:22:34 +0000 (07:22 +0000)]
Revert r367649: Improve raw_ostream so that you can "write" colors using operator<<

This reverts commit r367649 in an attempt to unbreak Windows bots.

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

5 years ago[LLVM][Alignment] Update documentation
Guillaume Chatelet [Fri, 2 Aug 2019 07:14:20 +0000 (07:14 +0000)]
[LLVM][Alignment] Update documentation

Reviewers: aprantl

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[LV] Avoid building interleaved group in presence of WAW dependency
Hideki Saito [Fri, 2 Aug 2019 06:31:50 +0000 (06:31 +0000)]
[LV] Avoid building interleaved group in presence of WAW dependency

Reviewers: hsaito, Ayal, fhahn, anna, mkazantsev

Reviewed By: hsaito

Patch by evrevnov, thanks!

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

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

5 years agoImprove raw_ostream so that you can "write" colors using operator<<
Rui Ueyama [Fri, 2 Aug 2019 04:48:30 +0000 (04:48 +0000)]
Improve raw_ostream so that you can "write" colors using operator<<

1. raw_ostream supports ANSI colors so that you can write messages to
the termina with colors. Previously, in order to change and reset
color, you had to call `changeColor` and `resetColor` functions,
respectively.

So, if you print out "error: " in red, for example, you had to do
something like this:

  OS.changeColor(raw_ostream::RED);
  OS << "error: ";
  OS.resetColor();

With this patch, you can write the same code as follows:

  OS << raw_ostream::RED << "error: " << raw_ostream::RESET;

2. Add a boolean flag to raw_ostream so that you can disable colored
output. If you disable colors, changeColor, operator<<(Color),
resetColor and other color-related functions have no effect.

Most LLVM tools automatically prints out messages using colors, and
you can disable it by passing a flag such as `--disable-colors`.
This new flag makes it easy to write code that works that way.

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

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

5 years ago[Loop Peeling] Do not close further unroll/peel if profile based peeling was not...
Serguei Katkov [Fri, 2 Aug 2019 04:29:23 +0000 (04:29 +0000)]
[Loop Peeling] Do not close further unroll/peel if profile based peeling was not used.

Current peeling cost model can decide to peel off not all iterations
but only some of them to eliminate conditions on phi. At the same time
if any peeling happens the door for further unroll/peel optimizations on that
loop closes because the part of the code thinks that if peeling happened
it is profile based peeling and all iterations are peeled off.

To resolve this inconsistency the patch provides the flag which states whether
the full peeling basing on profile is enabled or not and peeling cost model
is able to modify this field like it does not PeelCount.

In a separate patch I will introduce an option to allow/disallow peeling basing
on profile.

To avoid infinite loop peeling the patch tracks the total number of peeled iteration
through llvm.loop.peeled.count loop metadata.

Reviewers: reames, fhahn
Reviewed By: reames
Subscribers: hiraditya, zzheng, dmgreen, llvm-commits
Differential Revision: https://reviews.llvm.org/D64972

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

5 years agoHandle casts changing pointer size in the vectorizer
Stanislav Mekhanoshin [Fri, 2 Aug 2019 04:03:37 +0000 (04:03 +0000)]
Handle casts changing pointer size in the vectorizer

Added code to truncate or shrink offsets so that we can continue
base pointer search if size has changed along the way.

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

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

5 years ago[PowerPC][Peephole] Check if `extsw`'s second operand is a virtual register
Kai Luo [Fri, 2 Aug 2019 03:14:17 +0000 (03:14 +0000)]
[PowerPC][Peephole] Check if `extsw`'s second operand is a virtual register

Summary:
When combining `extsw` and `sldi` in `PPCMIPeephole`, we have to check
if `extsw`'s second operand is a virtual register, otherwise we might
get miscompile.

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

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

5 years ago[NFC][CodeGen] Modify the type element of TailCalls to simplify the dupRetToEnableTai...
Kang Zhang [Fri, 2 Aug 2019 03:09:07 +0000 (03:09 +0000)]
[NFC][CodeGen] Modify the type element of TailCalls to simplify the dupRetToEnableTailCallOpts()

Summary:
The old code can be simplified to define the element type of TailCalls as `BasicBlock` not `CallInst`. Also I use the for-range loop instead the for loop.

Reviewed By: jsji

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

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

5 years agoTemporarily revert "Changes to improve CodeView debug info type record inline comments"
Eric Christopher [Fri, 2 Aug 2019 01:05:47 +0000 (01:05 +0000)]
Temporarily revert "Changes to improve CodeView debug info type record inline comments"
due to a sanitizer failure.

This reverts commit 367623.

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

5 years agoUpdate Compiler.h check for MSVC
JF Bastien [Fri, 2 Aug 2019 00:50:12 +0000 (00:50 +0000)]
Update Compiler.h check for MSVC
We require at least MSVC 2017, but I forgot to update Compiler.h when I updated the MSVC requirement.

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

5 years agoFix up an unused variable warning caused by TRI->isVirtualRegister() -> Register...
Daniel Sanders [Fri, 2 Aug 2019 00:17:48 +0000 (00:17 +0000)]
Fix up an unused variable warning caused by TRI->isVirtualRegister() -> Register::isVirtualRegister()

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

5 years agoPrevent vregs leaking into the MC layer via TargetRegisterClass::contains()
Daniel Sanders [Thu, 1 Aug 2019 23:44:42 +0000 (23:44 +0000)]
Prevent vregs leaking into the MC layer via TargetRegisterClass::contains()

Summary:
The MC layer doesn't expect to deal with vregs but
TargetRegisterClass::contains() forwards into MCRegisterClass::contains()
and this can cause vregs to turn up in the MC layer APIs. Add guards
against this to prevent this becoming a problem as we replace unsigned
with a new MCRegister object for improved type safety.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

Tags: #llvm

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

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

5 years ago[dsymutil] Fix heap-use-after-free related to the LinkOptions.
Jonas Devlieghere [Thu, 1 Aug 2019 23:37:33 +0000 (23:37 +0000)]
[dsymutil] Fix heap-use-after-free related to the LinkOptions.

In r367348, I changed dsymutil to pass the LinkOptions by value isntead
of by const reference. However, the options were still captured by
reference in the LinkLambda. This patch fixes that by passing them in by
value.

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

5 years ago[Tests] Autogen a bunch of Reassociate tests for ease of update
Philip Reames [Thu, 1 Aug 2019 23:30:32 +0000 (23:30 +0000)]
[Tests] Autogen a bunch of Reassociate tests for ease of update

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

5 years agoFinish moving TargetRegisterInfo::isVirtualRegister() and friends to llvm::Register...
Daniel Sanders [Thu, 1 Aug 2019 23:27:28 +0000 (23:27 +0000)]
Finish moving TargetRegisterInfo::isVirtualRegister() and friends to llvm::Register as started by r367614. NFC

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

5 years ago[PGO] Add PGO support at -O0 in the experimental new pass manager
Rong Xu [Thu, 1 Aug 2019 22:36:34 +0000 (22:36 +0000)]
[PGO] Add PGO support at -O0 in the experimental new pass manager

Add PGO support at -O0 in the experimental new pass manager to sync the
behavior of the legacy pass manager.

Also change the test of gcc-flag-compatibility.c for more complete test:
(1) change the match string to "profc" and "profd" to ensure the
    instrumentation is happening.
(2) add IR format proftext so that PGO use compilation is tested.

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

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

5 years agoRevert r366980: "[lit] Protect full test suite from FILECHECK_OPTS"
Joel E. Denny [Thu, 1 Aug 2019 22:26:51 +0000 (22:26 +0000)]
Revert r366980: "[lit] Protect full test suite from FILECHECK_OPTS"

Windows bots are broken.  See recent D65335 and D65156 comments.

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

5 years agoRevert r367123: "[llvm] [lit/tests] Replace 'env -u' with more portable construct"
Joel E. Denny [Thu, 1 Aug 2019 22:26:37 +0000 (22:26 +0000)]
Revert r367123: "[llvm] [lit/tests] Replace 'env -u' with more portable construct"

Must be reverted in order to revert r366980, which breaks windows
bots.  See recent D65335 and D65156 comments.

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

5 years ago[NFC] Remove extra __has_feature
JF Bastien [Thu, 1 Aug 2019 22:19:53 +0000 (22:19 +0000)]
[NFC] Remove extra __has_feature

It's already in Compiler.h

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

5 years agoRelax load store vectorizer pointer strip checks
Stanislav Mekhanoshin [Thu, 1 Aug 2019 22:18:56 +0000 (22:18 +0000)]
Relax load store vectorizer pointer strip checks

The previous change to fix crash in the vectorizer introduced
performance regressions. The condition to preserve pointer
address space during the search is too tight, we only need to
match the size.

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

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

5 years agoChanges to improve CodeView debug info type record inline comments
Nilanjana Basu [Thu, 1 Aug 2019 22:05:14 +0000 (22:05 +0000)]
Changes to improve CodeView debug info type record inline comments

Signed-off-by: Nilanjana Basu <nilanjana.basu87@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367623 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Fixed relocation errors having no location.
Wouter van Oortmerssen [Thu, 1 Aug 2019 21:34:54 +0000 (21:34 +0000)]
[WebAssembly] Fixed relocation errors having no location.

Summary:
Fixes: https://bugs.llvm.org/show_bug.cgi?id=42441
Used to print:

<unknown>:0: error: Cannot represent a difference across sections

(the location was null).

Now prints:

err.s:20:3: error: Cannot represent a difference across sections
  i32.const foo-bar
  ^

Note: I looked at adding a test for this, but I don't think it is
worth it. We're not testing error formatting in the Wasm backend :)

Reviewers: sbc100, jgravelle-google

Subscribers: dschuff, aheejin, sunfish, llvm-commits

Tags: #llvm

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

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

5 years agoMove register namespacing definitions from TargetRegisterInfo to Register
Daniel Sanders [Thu, 1 Aug 2019 21:18:34 +0000 (21:18 +0000)]
Move register namespacing definitions from TargetRegisterInfo to Register

Summary:
The namespacing in Register is currently slightly wrong as there is a
(rarely used) stack slot namespace too. The namespacing doesn't use
anything from the Target so we can move the definition from
TargetRegisterInfo to Register to keep it in one place

Note: To keep the patch reasonably sized for review I've left stub
functions in the original TargetRegisterInfo. We should update all the uses
instead

Reviewers: arsenm, bogner, aditya_nandakumar, volkan

Subscribers: wdng, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64][x86] adjust tests with shift-add-shift; NFC
Sanjay Patel [Thu, 1 Aug 2019 21:08:08 +0000 (21:08 +0000)]
[AArch64][x86] adjust tests with shift-add-shift; NFC

Prevent folding away the math completely.

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

5 years ago[AArch64][x86] add tests for shift-add-shift; NFC (PR42644)
Sanjay Patel [Thu, 1 Aug 2019 20:32:27 +0000 (20:32 +0000)]
[AArch64][x86] add tests for shift-add-shift; NFC (PR42644)

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

5 years agoGlobalISel: Lower scalarizing unmerge of a vector to shifts
Matt Arsenault [Thu, 1 Aug 2019 19:10:05 +0000 (19:10 +0000)]
GlobalISel: Lower scalarizing unmerge of a vector to shifts

AMDGPU sometimes has legal s16 and <2 x s16> operations, but all
registers are really 32-bit. An unmerge destination really should ben
widened to a 32-bit register. If widening a scalarizing vector with a
target size that matches the vector size, bitcast to integer and
extract the relevant bits with shifts.

I'm not sure if this is the right place for this. This could arguably
be part of widenScalar for the result. I also have a growing feeling
that we're missing a bitcast legalize action.

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

5 years agoFollow up of rL367592, fix the build
Sjoerd Meijer [Thu, 1 Aug 2019 18:54:29 +0000 (18:54 +0000)]
Follow up of rL367592, fix the build

Some buildbots complained about:
error: default label in switch which covers all enumeration values

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

5 years ago[X86] In decomposeMulByConstant, legalize the VT before querying whether the multiply...
Craig Topper [Thu, 1 Aug 2019 18:49:07 +0000 (18:49 +0000)]
[X86] In decomposeMulByConstant, legalize the VT before querying whether the multiply is legal

If a type is larger than a legal type and needs to be split, we would previously allow the multiply to be decomposed even if the split multiply is legal. Since the shift + add/sub code would also need to be split, its not any better to decompose it.

This patch figures out what type the mul will eventually be legalized to and then uses that type for the query. I tried just returning false illegal types and letting them get handled after type legalization, but then we can't recognize and i64 constant splat on 32-bit targets since will be destroyed by type legalization. We could special case vectors of i64 to avoid that...

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

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

5 years ago[X86] Add some test cases for 512-bit truncate to 128-bits with min-legal-vector...
Craig Topper [Thu, 1 Aug 2019 18:48:57 +0000 (18:48 +0000)]
[X86] Add some test cases for 512-bit truncate to 128-bits with min-legal-vector-width=0 and prefer-vector-width=256.

We currently split the 512 type, truncate each half to 128 bits,
concatenate them, and then truncate again. Probably better to
truncate each half to 64-bits and then concat the results
using vpunpcklqdq.

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

5 years agoAMDGPU: Remove v0 workaround for DS_GWS_* instructions
Matt Arsenault [Thu, 1 Aug 2019 18:41:32 +0000 (18:41 +0000)]
AMDGPU: Remove v0 workaround for DS_GWS_* instructions

Any register should work for the src field since r366067, since the
used value is not pulled from the expected encoding field.

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

5 years agoCodeGen: Allow virtual registers in bundles
Matt Arsenault [Thu, 1 Aug 2019 18:41:28 +0000 (18:41 +0000)]
CodeGen: Allow virtual registers in bundles

The note in the documentation suggests this restriction is a compile
time optimization for architectures that make heavy use of
bundling. Allowing virtual registers in a bundle is useful for some
(non-R600) AMDGPU use cases and are infrequent enough to matter.

A more common AMDGPU use case has already been using virtual registers
in bundles since r333691, although never calling finalizeBundle on
them and manually creating the use/def list on the BUNDLE
instruction. This is also relatively infrequent, and only happens for
consecutive sequences of some load/store types.

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

5 years ago[SimplifyCFG] Mark missed Changed to true.
Alina Sbirlea [Thu, 1 Aug 2019 18:37:34 +0000 (18:37 +0000)]
[SimplifyCFG] Mark missed Changed to true.

Summary:
DominatorTree is invalid after SimplifyCFG because of a missed `Changed = true` when simplifying a branch condition and removing an edge.
Resolves PR42272.

Reviewers: zhizhouy, manojgupta

Subscribers: jlebar, sanjoy.google, llvm-commits

Tags: #llvm

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

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

5 years ago[MemorySSA] Set LoopSimplify to preserve MemorySSA in the NPM, if analysis exists.
Alina Sbirlea [Thu, 1 Aug 2019 18:28:28 +0000 (18:28 +0000)]
[MemorySSA] Set LoopSimplify to preserve MemorySSA in the NPM, if analysis exists.

Summary:
LoopSimplify is preserved in the legacy pass manager, but not in the new pass manager.
Update LoopSimplify to preserve MemorySSA conditionally when the analysis is available (same behavior as the legacy pass manager).

Reviewers: chandlerc

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

Tags: #llvm

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

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

5 years agoAMDGPU: Use tablegen pattern for sendmsg intrinsics
Matt Arsenault [Thu, 1 Aug 2019 18:27:11 +0000 (18:27 +0000)]
AMDGPU: Use tablegen pattern for sendmsg intrinsics

Since this now emits a direct copy to m0, SIFixSGPRCopies has to
handle a physical register.

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

5 years ago[LV] Tail-Loop Folding
Sjoerd Meijer [Thu, 1 Aug 2019 18:21:44 +0000 (18:21 +0000)]
[LV] Tail-Loop Folding

This allows folding of the scalar epilogue loop (the tail) into the main
vectorised loop body when the loop is annotated with a "vector predicate"
metadata hint. To fold the tail, instructions need to be predicated (masked),
enabling/disabling lanes for the remainder iterations.

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

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

5 years agoGlobalISel: Fix widenScalar for G_MERGE_VALUES to pointer
Matt Arsenault [Thu, 1 Aug 2019 18:13:16 +0000 (18:13 +0000)]
GlobalISel: Fix widenScalar for G_MERGE_VALUES to pointer

AMDGPU testcase isn't broken now, but will be in a future patch
without this.

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

5 years ago[WebAssembly] Assembler/InstPrinter: support call_indirect type index.
Wouter van Oortmerssen [Thu, 1 Aug 2019 18:08:26 +0000 (18:08 +0000)]
[WebAssembly] Assembler/InstPrinter: support call_indirect type index.

A TYPE_INDEX operand (as used by call_indirect) used to be represented
by the InstPrinter as a symbol (e.g. .Ltype_index0@TYPE_INDEX) which
was a bit of a mismatch with the WasmObjectWriter which expects an
unnamed symbol, to receive the signature from and then turn into a
reloc.

There was really no good way to round-trip this information. An earlier
version of this patch tried to attach the signature information using
a .functype, but that ran into trouble when the symbol was re-emitted
without a name. Removing the name was a giant hack also.

The current version changes the assembly syntax to have an inline
signature spec for TYPEINDEX operands that is always unnamed, which
is much more elegant both in syntax and in implementation (as now the
assembler is able to follow the same path as the regular backend)

Reviewers: sbc100, dschuff, aheejin, jgravelle-google, sunfish, tlively

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

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

5 years ago[TargetLowering] SimplifyMultipleUseDemandedBits - Add ISD::INSERT_VECTOR_ELT handling
Simon Pilgrim [Thu, 1 Aug 2019 17:46:44 +0000 (17:46 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - Add ISD::INSERT_VECTOR_ELT handling

Allow us to peek through vector insertions to avoid dependencies on entire insertion chains.

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

5 years agoFix spacing of LLVM_USE_PERF in CMake.rst that caused it to be tabbed in funny
Erich Keane [Thu, 1 Aug 2019 17:30:25 +0000 (17:30 +0000)]
Fix spacing of LLVM_USE_PERF in CMake.rst that caused it to be tabbed in funny

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

5 years agoDocument LLVM_ENABLE_LIBCXX in CMake.rst
Erich Keane [Thu, 1 Aug 2019 17:30:21 +0000 (17:30 +0000)]
Document LLVM_ENABLE_LIBCXX in CMake.rst

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

5 years agoMove macho-data-in-code.ll to X86/macho-data-in-code.ll (to only run when x86 is...
Kuba Mracek [Thu, 1 Aug 2019 16:52:45 +0000 (16:52 +0000)]
Move macho-data-in-code.ll to X86/macho-data-in-code.ll (to only run when x86 is a valid target).

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

5 years ago[X86][SSE] Add PEXTR*(PINSR*(v, s, c), c) -> s combine.
Simon Pilgrim [Thu, 1 Aug 2019 16:38:39 +0000 (16:38 +0000)]
[X86][SSE] Add PEXTR*(PINSR*(v, s, c), c) -> s combine.

We should probably extend this to cover bitcasts as well to help other cases in promote-vec3.ll.

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

5 years ago[Attributor][FIX] Indicate a missing update change
Johannes Doerfert [Thu, 1 Aug 2019 16:21:54 +0000 (16:21 +0000)]
[Attributor][FIX] Indicate a missing update change

User of AAReturnedValues need to know if HasOverdefinedReturnedCalls
changed from false to true as it will impact the result of the return
value traversal (calls are not ignored anymore).

This will be tested with the tests in D59978.

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

5 years ago[mips] Fix lowering load/store instruction in PIC case
Simon Atanasyan [Thu, 1 Aug 2019 16:04:29 +0000 (16:04 +0000)]
[mips] Fix lowering load/store instruction in PIC case

If an operand of the `lw/sw` instructions is a symbol, these instructions
incorrectly lowered using not-position-independent chain of commands.
For PIC code we should use `lw/addiu` instructions with the `R_MIPS_GOT16`
and `R_MIPS_LO16` relocations respectively. Instead of that LLVM generates
position dependent code with the `R_MIPS_HI16` and `R_MIPS_LO16`
relocations.

This patch provides a fix for the bug by handling PIC case separately in
the `MipsAsmParser::expandMemInst`. The main idea is to generate a chain
of PIC instructions to load a symbol address into a register and then
load the address content.

The fix is not optimal and does not fix all PIC-related problems. This
is a task for subsequent patches.

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

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

5 years ago[InstCombine] add tests with 'ne' predicates; NFC
Sanjay Patel [Thu, 1 Aug 2019 16:04:12 +0000 (16:04 +0000)]
[InstCombine] add tests with 'ne' predicates; NFC

More coverage for the proposal in D65576.

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

5 years ago[llvm-objdump] Fix jumptable detection when disassembling Mach-O binaries
Kuba Mracek [Thu, 1 Aug 2019 15:51:14 +0000 (15:51 +0000)]
[llvm-objdump] Fix jumptable detection when disassembling Mach-O binaries

- Add LC_SEGMENT_64 handling in getSectionsAndSymbols to be able to find the base segment address from 64-bit Mach-O binaries.
- Add "data in code" detection into the !symbolTableWorked case, extract it into a separate function.
- Fix uninitialized variable usage on BaseSegmentAddress (initialize to 0).
- Add test.

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

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

5 years ago[InstCombine] add test with swapped select operands; NFC
Sanjay Patel [Thu, 1 Aug 2019 15:32:10 +0000 (15:32 +0000)]
[InstCombine] add test with swapped select operands; NFC

More coverage for the proposal in D65576.

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

5 years ago[IR] Add getArg() method to Function class
Teresa Johnson [Thu, 1 Aug 2019 15:31:40 +0000 (15:31 +0000)]
[IR] Add getArg() method to Function class

Adds a method which, when called with function.getArg(i), returns an
Argument* to the i'th argument.

Patch by Henry Wildermuth

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

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

5 years ago[X86][SSE] SimplifyMultipleUseDemandedBits - Add PEXTR/PINSR B+W handling
Simon Pilgrim [Thu, 1 Aug 2019 14:46:03 +0000 (14:46 +0000)]
[X86][SSE] SimplifyMultipleUseDemandedBits - Add PEXTR/PINSR B+W handling

This adds SimplifyMultipleUseDemandedBitsForTargetNode X86 support and uses it to allow us to peek through vector insertions to avoid dependencies on entire insertion chains.

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

5 years agoAdd support for openSUSE RISC-V triple
Sam Elliott [Thu, 1 Aug 2019 14:23:56 +0000 (14:23 +0000)]
Add support for openSUSE RISC-V triple

Reviewers: asb

Reviewed By: asb

Subscribers: lenary, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lebedev.ri, kito-cheng, shiva0217, rogfer01, dexonsmith, rkruppe, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

Patch by Andreas Schwab (schwab)

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

5 years ago[X86] EltsFromConsecutiveLoads - don't attempt to merge volatile loads (PR42846)
Simon Pilgrim [Thu, 1 Aug 2019 13:13:18 +0000 (13:13 +0000)]
[X86] EltsFromConsecutiveLoads - don't attempt to merge volatile loads (PR42846)

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

5 years ago[RISCV] Add Custom Parser for Atomic Memory Operands
Sam Elliott [Thu, 1 Aug 2019 12:42:31 +0000 (12:42 +0000)]
[RISCV] Add Custom Parser for Atomic Memory Operands

Summary:
GCC Accepts both (reg) and 0(reg) for atomic instruction memory
operands. These instructions do not allow for an offset in their
encoding, so in the latter case, the 0 is silently dropped.

Due to how we have structured the RISCVAsmParser, the easiest way to add
support for parsing this offset is to add a custom AsmOperand and
parser. This parser drops all the parens, and just keeps the register.

This commit also adds a custom printer for these operands, which matches
the GCC canonical printer, printing both `(a0)` and `0(a0)` as `(a0)`.

Reviewers: asb, lewis-revill

Reviewed By: asb

Subscribers: s.egerton, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, jfb, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

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

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

5 years ago[IR] Value: add replaceUsesWithIf() utility
Roman Lebedev [Thu, 1 Aug 2019 12:32:08 +0000 (12:32 +0000)]
[IR] Value: add replaceUsesWithIf() utility

Summary:
While there is always a `Value::replaceAllUsesWith()`,
sometimes the replacement needs to be conditional.

I have only cleaned a few cases where `replaceUsesWithIf()`
could be used, to both add test coverage,
and show that it is actually useful.

Reviewers: jdoerfert, spatel, RKSimon, craig.topper

Reviewed By: jdoerfert

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, aheejin, george.burgess.iv, asbirlea, llvm-commits

Tags: #llvm

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

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

5 years ago[IR] SelectInst: add swapValues() utility
Roman Lebedev [Thu, 1 Aug 2019 12:31:35 +0000 (12:31 +0000)]
[IR] SelectInst: add swapValues() utility

Summary:
Sometimes we need to swap true-val and false-val of a `SelectInst`.
Having a function for that is nicer than hand-writing it each time.

Reviewers: spatel, RKSimon, craig.topper, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[ARM] Fix for MVE VREV64
David Green [Thu, 1 Aug 2019 11:22:03 +0000 (11:22 +0000)]
[ARM] Fix for MVE VREV64

The VREV64 instruction is apparently unpredictable if Qd == Qm, due to the
cross-beat nature of the instruction. This adds an earlyclobber to Qd, which
seems to be the same way we deal with this on other instructions like the
write-back on loads and stores.

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

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

5 years ago[ARM] Regenerate BSWAP16 tests
Simon Pilgrim [Thu, 1 Aug 2019 11:12:10 +0000 (11:12 +0000)]
[ARM] Regenerate BSWAP16 tests

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

5 years ago[AArch64] Do not allocate unnecessary emergency slot.
Sander de Smalen [Thu, 1 Aug 2019 10:53:45 +0000 (10:53 +0000)]
[AArch64] Do not allocate unnecessary emergency slot.

Fix an issue where the compiler still allocates an emergency spill slot even
though it already decided to spill an extra callee-save register to use
as a scratch register.

Reviewers: gberry, thegameg, mstorsjo, t.p.northover

Reviewed By: thegameg

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

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

5 years ago[MIPS GlobalISel] Fold load/store + G_GEP + G_CONSTANT
Petar Avramovic [Thu, 1 Aug 2019 09:40:13 +0000 (09:40 +0000)]
[MIPS GlobalISel] Fold load/store + G_GEP + G_CONSTANT

Fold load/store + G_GEP + G_CONSTANT when
immediate in G_CONSTANT fits into 16 bit signed integer.

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

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

5 years ago[LLVM][Alignment] Fix AlignmentTest on platform where size_t != uint64_t
Guillaume Chatelet [Thu, 1 Aug 2019 09:20:00 +0000 (09:20 +0000)]
[LLVM][Alignment] Fix AlignmentTest on platform where size_t != uint64_t

Reviewers: yroux

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][ARM][ParallelDSP] Getters and renaming
Sam Parker [Thu, 1 Aug 2019 08:17:51 +0000 (08:17 +0000)]
[NFC][ARM][ParallelDSP] Getters and renaming

Add a couple of getters for Reduction and do some renaming of
variables around CreateSMLAD for clarity.

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

5 years ago[Testing] Fix tests that break with read-only checkouts
David Zarzycki [Thu, 1 Aug 2019 06:41:40 +0000 (06:41 +0000)]
[Testing] Fix tests that break with read-only checkouts

Found with `mount --bind -o ro ...` on Linux.

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

5 years ago[SelectionDAG] Use APInt::isSubsetOf/intersects to simplify some code.
Craig Topper [Thu, 1 Aug 2019 06:06:21 +0000 (06:06 +0000)]
[SelectionDAG] Use APInt::isSubsetOf/intersects to simplify some code.

Also use KnownBits::isNegative/isNonNegative to further simplify.

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

5 years agoAMDGPU/SILoadStoreOptimizer: Make some functions const
Tom Stellard [Thu, 1 Aug 2019 05:39:17 +0000 (05:39 +0000)]
AMDGPU/SILoadStoreOptimizer: Make some functions const

Reviewers: arsenm, pendingchaos, rampitec

Reviewed By: rampitec

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

Tags: #llvm

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

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

5 years agorecommit:[PowerPC] Eliminate loads/swap feeding swap/store for vector type by using...
Zi Xuan Wu [Thu, 1 Aug 2019 05:26:02 +0000 (05:26 +0000)]
recommit:[PowerPC] Eliminate loads/swap feeding swap/store for vector type by using big-endian load/store

In PowerPC, there is instruction to load vector in big endian element order when it's in little endian target.
So we can combine vector load + reverse into big endian load to eliminate the swap instruction.
Also combine vector reverse + store into big endian store.

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

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

5 years agoAMDGPU/GlobalISel: fix inst-select-load-local.mir in -DLLVM_ENABLE_ASSERTIONS=off...
Fangrui Song [Thu, 1 Aug 2019 04:03:06 +0000 (04:03 +0000)]
AMDGPU/GlobalISel: fix inst-select-load-local.mir in -DLLVM_ENABLE_ASSERTIONS=off builds after r367498

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

5 years agoAMDGPU/GlobalISel: Fix flat load/store of pointer types
Matt Arsenault [Thu, 1 Aug 2019 03:57:42 +0000 (03:57 +0000)]
AMDGPU/GlobalISel: Fix flat load/store of pointer types

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

5 years agoAMDGPU/GlobalISel: Remove manual store select code
Matt Arsenault [Thu, 1 Aug 2019 03:52:40 +0000 (03:52 +0000)]
AMDGPU/GlobalISel: Remove manual store select code

This regresses the weird types that are newly treated as legal load
types, but fixes incorrectly using flat instrucions on SI.

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

5 years agoAMDGPU/GlobalISel: Select local atomic cmpxchg
Matt Arsenault [Thu, 1 Aug 2019 03:41:41 +0000 (03:41 +0000)]
AMDGPU/GlobalISel: Select local atomic cmpxchg

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

5 years agoRevert "[NFC] Remove obsolete LLVM_GNUC_PREREQ"
JF Bastien [Thu, 1 Aug 2019 03:40:59 +0000 (03:40 +0000)]
Revert "[NFC] Remove obsolete LLVM_GNUC_PREREQ"

The bots are sad, looks like GCC doesn't always have __has_builtin. I'll need to
modify the logic a bit.

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

5 years agoAMDGPU/GlobalISel: Handle G_ATOMICRMW_FADD
Matt Arsenault [Thu, 1 Aug 2019 03:33:15 +0000 (03:33 +0000)]
AMDGPU/GlobalISel: Handle G_ATOMICRMW_FADD

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

5 years ago[NFC] Remove obsolete LLVM_GNUC_PREREQ
JF Bastien [Thu, 1 Aug 2019 03:30:45 +0000 (03:30 +0000)]
[NFC] Remove obsolete LLVM_GNUC_PREREQ

The current minimum GCC version is 4.8 (soon to be 5.1), we there don't need to check for older versions. While I'm around Compiler.h, also update some of the doxygen comment.

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

5 years agoAMDGPU/GlobalISel: Allow selection of DS atomicrmw
Matt Arsenault [Thu, 1 Aug 2019 03:29:01 +0000 (03:29 +0000)]
AMDGPU/GlobalISel: Allow selection of DS atomicrmw

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

5 years agoAMDGPU: Start redefining atomic PatFrags
Matt Arsenault [Thu, 1 Aug 2019 03:25:52 +0000 (03:25 +0000)]
AMDGPU: Start redefining atomic PatFrags

Start migrating to a form that will be compatible with the global isel
emitter. Also should fix some overly lax checks on the memory type,
which allowed mis-selecting some illegal atomics.

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

5 years agoAMDGPU: Correct FP atomic patterns
Matt Arsenault [Thu, 1 Aug 2019 03:22:40 +0000 (03:22 +0000)]
AMDGPU: Correct FP atomic patterns

These need to use an fadd, not an add. Also make the noret part clear
in the name.

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

5 years agoAMDGPU/GlobalISel: Select simple local stores
Matt Arsenault [Thu, 1 Aug 2019 03:09:15 +0000 (03:09 +0000)]
AMDGPU/GlobalISel: Select simple local stores

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

5 years agoGlobalISel: moreElementsVector for G_LOAD/G_STORE
Matt Arsenault [Thu, 1 Aug 2019 01:44:22 +0000 (01:44 +0000)]
GlobalISel: moreElementsVector for G_LOAD/G_STORE

AMDGPU change and test is a placeholder until a future patch with
complete handling.

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

5 years agoCreate unique, but identically-named ELF sections for explicitly-sectioned functions...
Peter Collingbourne [Thu, 1 Aug 2019 01:38:53 +0000 (01:38 +0000)]
Create unique, but identically-named ELF sections for explicitly-sectioned functions and globals when using -function-sections and -data-sections.

This allows functions and globals to to be reordered later in the linking phase
(using the -symbol-ordering-file) even though reordering will be limited to
the scope of the explicit section.

Patch by Rahman Lavaee!

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

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

5 years agoReapply "AMDGPU: Split block for si_end_cf"
Matt Arsenault [Thu, 1 Aug 2019 01:25:27 +0000 (01:25 +0000)]
Reapply "AMDGPU: Split block for si_end_cf"

This reverts commit r359363, reapplying r357634

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

5 years agoFix a release-only build warning triggered by rL367485
Philip Reames [Thu, 1 Aug 2019 01:16:08 +0000 (01:16 +0000)]
Fix a release-only build warning triggered by rL367485

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

5 years agoAMDGPU/GlobalISel: Select local loads
Matt Arsenault [Thu, 1 Aug 2019 00:53:38 +0000 (00:53 +0000)]
AMDGPU/GlobalISel: Select local loads

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

5 years agoRevert "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG" and
Amy Huang [Wed, 31 Jul 2019 23:59:31 +0000 (23:59 +0000)]
Revert "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG" and
and partial fix.
Causes windows buildbot errors.

This reverts commit 6e65c34523963094acd0d6c94a5f5c64b32fe6aa and
53da7ca94343166ac68aef81db0398932fc258bb.

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

5 years agoFix build when both gtest death tests and LLVM_NODISCARD are available.
Richard Smith [Wed, 31 Jul 2019 23:37:24 +0000 (23:37 +0000)]
Fix build when both gtest death tests and LLVM_NODISCARD are available.

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

5 years ago[ARM] Lower "(x<<c) > 0x80000000U" to "lsls" on Thumb1.
Eli Friedman [Wed, 31 Jul 2019 23:19:21 +0000 (23:19 +0000)]
[ARM] Lower "(x<<c) > 0x80000000U" to "lsls" on Thumb1.

This is extremely specific, but saves three instructions when it's
legal.  I don't think the code can be usefully generalized.

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

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

5 years ago[ARM] Transform compare of masked value to shift on Thumb1.
Eli Friedman [Wed, 31 Jul 2019 23:17:34 +0000 (23:17 +0000)]
[ARM] Transform compare of masked value to shift on Thumb1.

Thumb1 has very limited immediate modes, so turning an "and" into a
shift can save multiple instructions.

It's possible to simplify the generated code for test2 and test3 in
cmp-and-fold.ll a little more, but I'll implement that as a followup.

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

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

5 years ago[ConstExprPreter] Overflow-detecting methods use GCC or clang builtins
JF Bastien [Wed, 31 Jul 2019 23:09:18 +0000 (23:09 +0000)]
[ConstExprPreter] Overflow-detecting methods use GCC or clang builtins

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

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

5 years ago[ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit...
Craig Topper [Wed, 31 Jul 2019 22:58:15 +0000 (22:58 +0000)]
[ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit tests for the branches.

X86 at least is able to use movmsk or kmov to move the mask to the scalar
domain. Then we can just use test instructions to test individual bits.

This is more efficient than extracting each mask element
individually.

I special cased v1i1 to use the previous behavior. This avoids
poor type legalization of bitcast of v1i1 to i1.

I've skipped expandload/compressstore as I think we need to
handle constant masks for those better first.

Many tests end up with duplicate test instructions due to tail
duplication in the branch folding pass. But the same thing
happens when constructing similar code in C. So its not unique
to the scalarization.

Not sure if this lowering code will also be good for other targets,
but we're only testing X86 today.

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

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

5 years ago[X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement...
Craig Topper [Wed, 31 Jul 2019 22:43:08 +0000 (22:43 +0000)]
[X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement+store

We have custom code that ignores the normal promoting type legalization on less than 128-bit vector types like v4i8 to emit pavgb, paddusb, psubusb since we don't have the equivalent instruction on a larger element type like v4i32. If this operation appears before a store, we can be left with an any_extend_vector_inreg followed by a truncstore after type legalization. When truncstore isn't legal, this will normally be decomposed into shuffles and a non-truncating store. This will then combine away the any_extend_vector_inreg and shuffle leaving just the store. On avx512, truncstore is legal so we don't decompose it and we had no combines to fix it.

This patch adds a new DAG combine to detect this case and emit either an extract_store for 64-bit stoers or a extractelement+store for 32 and 16 bit stores. This makes the avx512 codegen match the avx2 codegen for these situations. I'm restricting to only when -x86-experimental-vector-widening-legalization is false. When we're widening we're not likely to create this any_extend_inreg+truncstore combination. This means we should be able to remove this code when we flip the default. I would like to flip the default soon, but I need to investigate some performance regressions its causing in our branch that I wasn't seeing on trunk.

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

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

5 years agoAttempt to unbreak sphinx build bot by inserting a link.
Philip Reames [Wed, 31 Jul 2019 22:14:26 +0000 (22:14 +0000)]
Attempt to unbreak sphinx build bot by inserting a link.

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

5 years agoMigrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSig...
Michael Berg [Wed, 31 Jul 2019 21:57:28 +0000 (21:57 +0000)]
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control

Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.

Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper

Reviewed By: spatel

Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji

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

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

5 years ago[IndVars, RLEV] Support rewriting exit values in loops without known exits (prep...
Philip Reames [Wed, 31 Jul 2019 21:15:21 +0000 (21:15 +0000)]
[IndVars, RLEV] Support rewriting exit values in loops without known exits (prep work)

This is a prepatory patch for future work on support exit value rewriting in loops with a mixture of computable and non-computable exit counts.  The intention is to be "mostly NFC" - i.e. not enable any interesting new transforms - but in practice, there are some small output changes.

The test differences are caused by cases wherewhere getSCEVAtScope can simplify a single entry phi without needing any knowledge of the loop.

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

5 years ago[NFC] allow creating error strings from a Twine
JF Bastien [Wed, 31 Jul 2019 21:09:53 +0000 (21:09 +0000)]
[NFC] allow creating error strings from a Twine

It's useful when no format needs to happen, only the Twine needs to be put together.

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

5 years agoFix to r367374 "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
Amy Huang [Wed, 31 Jul 2019 21:03:38 +0000 (21:03 +0000)]
Fix to r367374 "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
after windows buildbot failure.

Added a check that the MachineInstr exists and is a call before trying
to add symbols around it.

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

5 years agoFix unused variable warning for non-assert builds.
Eric Christopher [Wed, 31 Jul 2019 21:02:03 +0000 (21:02 +0000)]
Fix unused variable warning for non-assert builds.

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

5 years ago[GISel] Address review feedback on passing MD_callees to lowerCall.
Mark Lacey [Wed, 31 Jul 2019 20:34:05 +0000 (20:34 +0000)]
[GISel] Address review feedback on passing MD_callees to lowerCall.

Preserve the nullptr default for KnownCallees that appears in
the base class.

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