OSDN Git Service

android-x86/external-llvm.git
6 years ago[WebAssembly] MC: Resolve aliases when creating provisional table entries
Sam Clegg [Wed, 31 Jan 2018 19:28:47 +0000 (19:28 +0000)]
[WebAssembly] MC: Resolve aliases when creating provisional table entries

This change is useful for the upcoming addition of the symbol
table (D41954) since in that world aliases for given function
all share the same function index.

This change does not effect lld because it essentially ignores
the wasm "table".  The table exists only to the wasm objects
will validate and disassembly meaningfully.

Patch by Nicholas Wilson!

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

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

6 years ago[X86] Generate testl instruction through truncates.
Amaury Sechet [Wed, 31 Jan 2018 19:20:06 +0000 (19:20 +0000)]
[X86] Generate testl instruction through truncates.

Summary:
This was introduced in D42646 but ended up being reverted because the original implementation was buggy.

Depends on D42646

Reviewers: craig.topper, niravd, spatel, hfinkel

Subscribers: llvm-commits

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

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

6 years ago[Analysis] Disable calls to *_finite and other glibc-only functions on Android.
Chih-Hung Hsieh [Wed, 31 Jan 2018 19:12:50 +0000 (19:12 +0000)]
[Analysis] Disable calls to *_finite and other glibc-only functions on Android.

Since r322087, glibc's finite lib calls are generated when possible.
However, they are not supported on Android. This change also
disables other functions not available on Android.

Differential Revision: http://reviews.llvm.org/D42668

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

6 years ago[llvm-cov] Improvements for summary report generated in HTML format.
Max Moroz [Wed, 31 Jan 2018 17:37:21 +0000 (17:37 +0000)]
[llvm-cov] Improvements for summary report generated in HTML format.

Summary:
This commit adds the following changes:

1) coverage numbers are aligned to the left and padded with spaces in order to
provide better readability for percentage values, e.g.:

```
file1     |  89.13% (123 / 2323)    | 100.00% (55 / 55)    |   9.33% (14545 / 234234)
file_asda |   1.78% ( 23 / 4323)    |  32.31% (555 / 6555) |  67.89% (1545 / 2234)
fileXXX   | 100.00% (12323 / 12323) | 100.00% (555 / 555)  | 100.00% (12345 / 12345)
```

2) added "hover" attribute to CSS for highlighting table row under mouse cursor
see screenshot attached to the phabricator review page

{F5764813}

3) table title row and "totals" row now use bold text

Reviewers: vsk, morehouse

Reviewed By: vsk

Subscribers: kcc, llvm-commits

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

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

6 years ago[CodeGenPrepare] Improve source and dest alignments of memory intrinsics independently
Daniel Neilson [Wed, 31 Jan 2018 17:24:53 +0000 (17:24 +0000)]
[CodeGenPrepare] Improve source and dest alignments of memory intrinsics independently

Summary:
  This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
CodeGenPrepare pass to be more aggressive in improving the source and destination alignments
of memcpy/memmove/memset by exploiting our new ability to record independent alignments
for each argument.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

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

6 years ago[Hexagon] Handle BUILD_VECTOR from undef values in buildHvxVectorReg
Krzysztof Parzyszek [Wed, 31 Jan 2018 16:52:15 +0000 (16:52 +0000)]
[Hexagon] Handle BUILD_VECTOR from undef values in buildHvxVectorReg

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

6 years ago[X86] Avoid using high register trick for test instruction
Amaury Sechet [Wed, 31 Jan 2018 16:48:54 +0000 (16:48 +0000)]
[X86] Avoid using high register trick for test instruction

Summary:
It seems it's main effect is to create addition copies when values are inr register that do not support this trick, which increase register pressure and makes the code bigger.

Reviewers: craig.topper, niravd, spatel, hfinkel

Subscribers: llvm-commits

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

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

6 years ago[Hexagon] Only process bitcasts of vsplats when selecting const vectors
Krzysztof Parzyszek [Wed, 31 Jan 2018 16:48:20 +0000 (16:48 +0000)]
[Hexagon] Only process bitcasts of vsplats when selecting const vectors

Selecting of constant HVX vectors involves some "manual processing",
which mishandled an unrelated BITCAST operation causing a selection
error.

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

6 years ago[Lint] Upgrade uses of MemoryIntrinic::getAlignment() to new API. (NFCI)
Daniel Neilson [Wed, 31 Jan 2018 16:42:15 +0000 (16:42 +0000)]
[Lint] Upgrade uses of MemoryIntrinic::getAlignment() to new API. (NFCI)

Summary:
  This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the Lint
analysis to cease using the old getAlignment() API of MemoryIntrinsic in favour of getting
source & dest specific alignments through the new API.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

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

6 years ago[DWARF] Allow duplication of tails with CFI instructions
Petar Jovanovic [Wed, 31 Jan 2018 15:57:57 +0000 (15:57 +0000)]
[DWARF] Allow duplication of tails with CFI instructions

This commit came as a result for revert of patch r317579 (originally
committed as r317100). The patch made CFI instructions duplicable, because
their existence in the epilogue block was affecting the Tail duplication
pass. However, duplicating blocks with CFI instructions was an issue for
compact unwind info on Darwin, which is why the patch was reverted.

This patch allows duplicating tails with CFI instructions, though they are
not duplicable, by copying them 'manually'.

Patch by Djordje Kovacevic.

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

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

6 years ago[InstCombine] move related tests into the same file; NFC
Sanjay Patel [Wed, 31 Jan 2018 15:47:59 +0000 (15:47 +0000)]
[InstCombine] move related tests into the same file; NFC

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

6 years ago[InstCombine] add tests to show limit of canEvaluate* ; NFC
Sanjay Patel [Wed, 31 Jan 2018 15:28:39 +0000 (15:28 +0000)]
[InstCombine] add tests to show limit of canEvaluate* ; NFC

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

6 years ago[DAG] Prevent NodeId pruning of TokenFactors in Instruction Selection.
Nirav Dave [Wed, 31 Jan 2018 15:23:17 +0000 (15:23 +0000)]
[DAG] Prevent NodeId pruning of TokenFactors in Instruction Selection.

Summary:
Instruction Selection preserves relative orders of all nodes save
TokenFactors which we treat specially. As a result Node Ids for
TokenFactors may violate the topological ordering and should not be
considered as valid pruning candidates in predecessor search.

Fixes PR35316.

Reviewers: RKSimon, hfinkel

Subscribers: hiraditya, llvm-commits

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

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

6 years agoFix formatting for r323876. NFC
Diana Picus [Wed, 31 Jan 2018 15:16:17 +0000 (15:16 +0000)]
Fix formatting for r323876. NFC

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

6 years ago[InstCombine] reduce code duplication for canEvaluate* functions; NFCI
Sanjay Patel [Wed, 31 Jan 2018 14:55:53 +0000 (14:55 +0000)]
[InstCombine] reduce code duplication for canEvaluate* functions; NFCI

We'd have to make the change suggested in D42536 3x otherwise.

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

6 years ago[ARM GlobalISel] Modernize LegalizerInfo. NFCI
Diana Picus [Wed, 31 Jan 2018 14:55:07 +0000 (14:55 +0000)]
[ARM GlobalISel] Modernize LegalizerInfo. NFCI

Start using the new LegalizerInfo API introduced in r323681.

Keep the old API for opcodes that need Lowering in some circumstances
(G_FNEG and G_UREM/G_SREM).

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

6 years agoFix build error in r323870
Marina Yatsina [Wed, 31 Jan 2018 14:18:37 +0000 (14:18 +0000)]
Fix build error in r323870

Change-Id: I15a8b27764a4d817cfbe48836bf09dc6520934b7

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

6 years ago[MachineCombiner] Add check for optimal pattern order.
Florian Hahn [Wed, 31 Jan 2018 13:54:30 +0000 (13:54 +0000)]
[MachineCombiner] Add check for optimal pattern order.

In D41587, @mssimpso discovered that the order of some patterns for
AArch64 was sub-optimal. I thought a bit about how we could avoid that
case in the future. I do not think there is a need for evaluating all
patterns for now. But this patch adds an extra (expensive) check, that
evaluates the latencies of all patterns, and ensures that the latency
saved decreases for subsequent patterns.

This catches the sub-optimal order fixed in D41587, but I am not
entirely happy with the check, as it only applies to sub-optimal
patterns seen while building with EXPENSIVE_CHECKS on. It did not
discover any other sub-optimal pattern ordering.

Reviewers: Gerolf, spatel, mssimpso

Reviewed By: Gerolf, mssimpso

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

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

6 years agoTake into account the cost of local intervals when selecting split candidate.
Marina Yatsina [Wed, 31 Jan 2018 13:31:08 +0000 (13:31 +0000)]
Take into account the cost of local intervals when selecting split candidate.

When selecting a split candidate for region splitting, the register allocator tries to predict which candidate will have the cheapest spill cost.
Global splitting may cause the creation of local intervals, and they might spill.

This patch makes RA take into account the spill cost of local split intervals in use blocks (we already take into account the spill cost in through blocks).
A flag ("-condsider-local-interval-cost") controls weather we do this advanced cost calculation (it's on by default for X86 target, off for the rest).

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

Change-Id: Icccb8ad2dbf13124f5d97a18c67d95aa6be0d14d

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

6 years ago[ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operations
Pablo Barrio [Wed, 31 Jan 2018 13:20:10 +0000 (13:20 +0000)]
[ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operations

Summary:
Expressions of the form x < 0 ? 0 :  x; and x < -1 ? -1 : x can be lowered using bit-operations instead of branching or conditional moves

In thumb-mode this results in a two-instruction sequence, a shift followed by a bic or or while in ARM/thumb2 mode that has flexible second operand the shift can be folded into a single bic/or instructions. In most cases this results in smaller code and possibly less branches, and in no case larger than before.

Patch by Marten Svanfeldt.

Reviewers: fhahn, pbarrio

Reviewed By: pbarrio

Subscribers: efriedma, rogfer01, aemerson, javed.absar, kristof.beyls, llvm-commits

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

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

6 years agoAdd a regression test for problems caused by D42646 . NFC
Amaury Sechet [Wed, 31 Jan 2018 13:02:01 +0000 (13:02 +0000)]
Add a regression test for problems caused by D42646 . NFC

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

6 years ago[SystemZ] Check the bitwidth before calling isInt/isUInt.
Jonas Paulsson [Wed, 31 Jan 2018 12:41:25 +0000 (12:41 +0000)]
[SystemZ] Check the bitwidth before calling isInt/isUInt.

Since these methods will assert if the integer does not fit into 64 bits,
it is necessary to do this check before calling them in
supportedAddressingMode().

Review: Ulrich Weigand.

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

6 years ago[AggressiveInstCombine] Make TruncCombine class ignore unreachable basic blocks.
Amjad Aboud [Wed, 31 Jan 2018 10:41:31 +0000 (10:41 +0000)]
[AggressiveInstCombine] Make TruncCombine class ignore unreachable basic blocks.
Because dead code may contain non-standard IR that causes infinite looping or crashes in underlying analysis.
See PR36134 for more details.

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

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

6 years ago[ARM] Armv8.2-A FP16 code generation (part 2/3)
Sjoerd Meijer [Wed, 31 Jan 2018 10:18:29 +0000 (10:18 +0000)]
[ARM] Armv8.2-A FP16 code generation (part 2/3)

Half-precision arguments and return values are passed as if it were an int or
float for ARM. This results in truncates and bitcasts to/from i16 and f16
values, which are legalized very early to stack stores/loads. When FullFP16 is
enabled, we want to avoid codegen for these bitcasts as it is unnecessary and
inefficient.

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

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

6 years ago[PowerPC] Return true in enableMultipleCopyHints().
Jonas Paulsson [Wed, 31 Jan 2018 09:26:51 +0000 (09:26 +0000)]
[PowerPC]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Nemanja Ivanovic

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

6 years ago[ARM] Allow the scheduler to clone a node with glue to avoid a copy CPSR ↔ GPR.
Roger Ferrer Ibanez [Wed, 31 Jan 2018 09:23:43 +0000 (09:23 +0000)]
[ARM] Allow the scheduler to clone a node with glue to avoid a copy CPSR ↔ GPR.

In Thumb 1, with the new ADDCARRY / SUBCARRY the scheduler may need to do
copies CPSR ↔ GPR but not all Thumb1 targets implement them.

The schedule can attempt, before attempting a copy, to clone the instructions
but it does not currently do that for nodes with input glue. In this patch we
introduce a target-hook to let the hook decide if a glued machinenode is still
eligible for copying. In this case these are ARM::tADCS and ARM::tSBCS .

As a follow-up of this change we should actually implement the copies for the
Thumb1 targets that do implement them and restrict the hook to the targets that
can't really do such copy as these clones are not ideal.

This change fixes PR35836.

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

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

6 years agoMark two tests REQUIRES: x86-registered-backend
Justin Bogner [Wed, 31 Jan 2018 07:32:03 +0000 (07:32 +0000)]
Mark two tests REQUIRES: x86-registered-backend

These were introduced in r323783 and use an X86 triple. I'll follow up
on the list to check if it would make more sense to remove the triple
and mark them REQUIRES: default_triple instead.

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

6 years ago[WebAssembly] Remove some unused code and tidy logging. NFC.
Sam Clegg [Wed, 31 Jan 2018 04:21:44 +0000 (04:21 +0000)]
[WebAssembly] Remove some unused code and tidy logging. NFC.

Patch by Nicholas Wilson!

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

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

6 years agoLTO: Drop comdats when converting definitions to declarations.
Peter Collingbourne [Wed, 31 Jan 2018 02:51:03 +0000 (02:51 +0000)]
LTO: Drop comdats when converting definitions to declarations.

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

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

6 years agoRevert r323559 due to EXPENSIVE_CHECKS regression.
Eli Friedman [Wed, 31 Jan 2018 00:40:42 +0000 (00:40 +0000)]
Revert r323559 due to EXPENSIVE_CHECKS regression.

I have a fix for the issue (https://reviews.llvm.org/D42655) but
it's taking a while to get reviewed, so reverting in the meantime.

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

6 years ago[X86] Add more madd reduction tests with wider vectors.
Craig Topper [Wed, 31 Jan 2018 00:30:32 +0000 (00:30 +0000)]
[X86] Add more madd reduction tests with wider vectors.

We had no test case exercising 512-bit vpmaddwd usage.

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

6 years agodocs: wordsmith some of the linker option extension
Saleem Abdulrasool [Wed, 31 Jan 2018 00:16:23 +0000 (00:16 +0000)]
docs: wordsmith some of the linker option extension

Apply the grammatical improvements suggested by Rafael Avila de
Espindola in post-commit review.

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

6 years agollvm-nm should show a symbol type of T for symbols in the (__TEXT_EXEC,__text) section.
Kevin Enderby [Wed, 31 Jan 2018 00:00:41 +0000 (00:00 +0000)]
llvm-nm should show a symbol type of T for symbols in the (__TEXT_EXEC,__text) section.

When a the Apple link editor builds a kext bundle file type and the
value of the -miphoneos-version-min argument is significantly current
(like 11.0) then the (__TEXT,__text) section is changed to the
(__TEXT_EXEC,__text) section.  So it would be nice for llvm-nm to
show symbols in that section with a type of T instead of the generic
type of S for some section other than text, data, etc.

rdar://36262205

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

6 years ago[AMDGPU] Update relocation documentation and elf flag machine architecture numbers
Tony Tye [Tue, 30 Jan 2018 23:59:43 +0000 (23:59 +0000)]
[AMDGPU] Update relocation documentation and elf flag machine architecture numbers

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

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

6 years agoRename path libpath in .linker-options.
Rui Ueyama [Tue, 30 Jan 2018 23:49:27 +0000 (23:49 +0000)]
Rename path libpath in .linker-options.

"path" is too generic name for -L or --library-path because a lot of
linker options take paths as arguments. This change renames the option
to avoid confusion.

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

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

6 years ago[RDF] Clear the renamable flag when copy propagating reserved registers
Krzysztof Parzyszek [Tue, 30 Jan 2018 23:19:44 +0000 (23:19 +0000)]
[RDF] Clear the renamable flag when copy propagating reserved registers

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

6 years ago[AMDGPU] Clarify ReqdWorkGroupSize and MaxFlatWorkGroupSize metadata
Tony Tye [Tue, 30 Jan 2018 23:07:10 +0000 (23:07 +0000)]
[AMDGPU] Clarify ReqdWorkGroupSize and MaxFlatWorkGroupSize metadata

- If ReqdWorkGroupSize is present it must have all elements >=1.
- If MaxFlatWorkGroupSize must be consistent with ReqdWorkGroupSize.
- Remove FixedWorkGroupSize as now equivalent to ReqdWorkGroupSize.

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

6 years agoLLParser: add an argument for overriding data layout and do not check alloca addr...
Yaxun Liu [Tue, 30 Jan 2018 22:32:39 +0000 (22:32 +0000)]
LLParser: add an argument for overriding data layout and do not check alloca addr space

Sometimes users do not specify data layout in LLVM assembly and let llc set the
data layout by target triple after loading the LLVM assembly.

Currently the parser checks alloca address space no matter whether the LLVM
assembly contains data layout definition, which causes false alarm since the
default data layout does not contain the correct alloca address space.

The parser also calls verifier to check debug info and updating invalid debug
info. Currently there is no way to let the verifier to check debug info only.
If the verifier finds non-debug-info issues the parser will fail.

For llc, the fix is to remove the check of alloca addr space in the parser and
disable updating debug info, and defer the updating of debug info and
verification to be after setting data layout of the IR by target.

For other llvm tools, since they do not override data layout by target but
instead can override data layout by a command line option, an argument for
overriding data layout is added to the parser. In cases where data layout
overriding is necessary for the parser, the data layout can be provided by
command line.

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

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

6 years ago[Hexagon] Handle truncates in polynomial multiply idiom recognition
Krzysztof Parzyszek [Tue, 30 Jan 2018 22:03:59 +0000 (22:03 +0000)]
[Hexagon] Handle truncates in polynomial multiply idiom recognition

This is in anticipation of https://reviews.llvm.org/D42424, which would
otherwise break one of the pmpy testcases.

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

6 years ago[X86] Remove redundant check for hasAVX512 before calling hasBWI. NFC
Craig Topper [Tue, 30 Jan 2018 21:53:35 +0000 (21:53 +0000)]
[X86] Remove redundant check for hasAVX512 before calling hasBWI. NFC

hasBWI implies hasAVX512.

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

6 years agoTurn two static functions into methods, to simplify calling them.
Paul Robinson [Tue, 30 Jan 2018 21:39:28 +0000 (21:39 +0000)]
Turn two static functions into methods, to simplify calling them.

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

6 years ago[LLVM-C] Add Accessors For A Module's Source File Name
Robert Widmann [Tue, 30 Jan 2018 21:34:29 +0000 (21:34 +0000)]
[LLVM-C] Add Accessors For A Module's Source File Name

Summary: Also unblocks some cleanup in the echo-test.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: harlanhaskins, llvm-commits

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

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

6 years ago[ThinLTO/gold] Write empty imports even for modules with symbols
Vitaly Buka [Tue, 30 Jan 2018 21:19:26 +0000 (21:19 +0000)]
[ThinLTO/gold] Write empty imports even for modules with symbols

Summary: ThinLTO may skip object for other reasons, e.g. if there is no summary.

Reviewers: pcc, eugenis

Subscribers: mehdi_amini, inglorion, eraman, llvm-commits

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

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

6 years ago[AArch64] Expand testing of zero cycle zeroing
Evandro Menezes [Tue, 30 Jan 2018 21:14:11 +0000 (21:14 +0000)]
[AArch64] Expand testing of zero cycle zeroing

Make sure that r321824 doesn't change zeroing.

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

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

6 years ago[SLP] Add extra test for extractelement shuffle, NFC.
Alexey Bataev [Tue, 30 Jan 2018 21:06:06 +0000 (21:06 +0000)]
[SLP] Add extra test for extractelement shuffle, NFC.

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

6 years agoTeach ValueMapper to use ODR uniqued types when available
Teresa Johnson [Tue, 30 Jan 2018 20:16:32 +0000 (20:16 +0000)]
Teach ValueMapper to use ODR uniqued types when available

Summary:
This is exposed during ThinLTO compilation, when we import an alias by
creating a clone of the aliasee. Without this fix the debug type is
unnecessarily cloned and we get a duplicate, undoing the uniquing.

Fixes PR36089.

Reviewers: mehdi_amini, pcc

Subscribers: eraman, JDevlieghere, llvm-commits

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

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

6 years ago[dsymutil] Enable -minimize feature.
Jonas Devlieghere [Tue, 30 Jan 2018 19:54:16 +0000 (19:54 +0000)]
[dsymutil] Enable -minimize feature.

Passing -minimize to dsymutil prevents the emission of .debug_inlines,
.debug_pubnames, and .debug_pubtypes in favor of the Apple accelerator
tables.

The actual check in the DWARF linker was added in r323655. This patch
simply enables it.

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

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

6 years ago[GlobalISel] Bail out on calls to dllimported functions
Martin Storsjo [Tue, 30 Jan 2018 19:50:58 +0000 (19:50 +0000)]
[GlobalISel] Bail out on calls to dllimported functions

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

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

6 years ago[AArch64] Properly handle dllimport of variables when using fast-isel
Martin Storsjo [Tue, 30 Jan 2018 19:50:51 +0000 (19:50 +0000)]
[AArch64] Properly handle dllimport of variables when using fast-isel

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

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

6 years ago[TableGen] Make sure !if is evaluated throughout class inheritance.
Artem Belevich [Tue, 30 Jan 2018 19:29:21 +0000 (19:29 +0000)]
[TableGen] Make sure !if is evaluated throughout class inheritance.

Without the patch !if() is only evaluated if it's used directly.
If it's passed through more than one level of class inheritance,
we end up with a reference to an anonymous record with unresolved
references to the original arguments !if may have used.

The root cause of the problem is that TernOpInit::isComplete()
was always returning false and that prevented use of the folded
value of !if() as an initializer for the record at the next level
of inheritance.

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

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

6 years ago[LoopStrengthReduce] add test to show potential macro-fusion-based diff (PR35681...
Sanjay Patel [Tue, 30 Jan 2018 19:17:38 +0000 (19:17 +0000)]
[LoopStrengthReduce] add test to show potential macro-fusion-based diff (PR35681); NFC

This is the baseline output for the test proposed with D42607.

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

6 years ago[DWARF] Recommitting a test that was removed with r323564. Restricted to x86 linux...
Wolfgang Pieb [Tue, 30 Jan 2018 18:41:31 +0000 (18:41 +0000)]
[DWARF] Recommitting a test that was removed with r323564. Restricted to x86 linux target.

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

6 years ago[XRay] fix 99th percentile lookups by sorting the array correctly
Martin Pelikan [Tue, 30 Jan 2018 18:18:51 +0000 (18:18 +0000)]
[XRay] fix 99th percentile lookups by sorting the array correctly

Summary:
It was a copy-paste typo, sorting only to the 90th percentile twice.
Now, it only sorts the array prefix once, and extracts what we need.

Reviewers: dberris, kpw, eizan

Subscribers: llvm-commits

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

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

6 years ago[Hexagon] Handle non-aligned offsets in globals in extender optimization
Krzysztof Parzyszek [Tue, 30 Jan 2018 18:12:37 +0000 (18:12 +0000)]
[Hexagon] Handle non-aligned offsets in globals in extender optimization

Instructions like memd(r0+##global+1) are legal as long as the entire
address is properly aligned. Assuming that "global" is aligned at an
8-byte boundary, the expression "global+1" appears to be misaligned.
Handle such cases in HexagonConstExtenders, and make sure that any non-
extended offsets generated are still aligned accordingly.

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

6 years agoRevert: [Hexagon] Make sure that offset on globals matches alignment requirements
Krzysztof Parzyszek [Tue, 30 Jan 2018 18:10:27 +0000 (18:10 +0000)]
Revert: [Hexagon] Make sure that offset on globals matches alignment requirements

This reverts r323562, since it wasn't actually necessary. Constant-
extended offsets do not need to be aligned, as long as the effective
address is aligned.

Keep the testcase, with a modification which checks that such offsets
are not unnecessarily avoided.

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

6 years ago[X86][XOP] Update isVectorShiftByScalarCheap with cases covered by XOP
Simon Pilgrim [Tue, 30 Jan 2018 18:10:21 +0000 (18:10 +0000)]
[X86][XOP] Update isVectorShiftByScalarCheap with cases covered by XOP

Similar to D42437, XOP supports variable shift for v16i8/v8i16/v4i32/v2i64 types.

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

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

6 years ago[AMDGPU] isRenamable fixes to support copy forwarding
Geoff Berry [Tue, 30 Jan 2018 17:37:39 +0000 (17:37 +0000)]
[AMDGPU] isRenamable fixes to support copy forwarding

Mark more opcodes as hasExtraSrcRegAllocReq so that their operands will
be marked as not renamable, to avoid copy forwarding violating the
constraint that only one operand may use the constant bus.

These changes fix a few mis-compiles when copy forwarding is enabled in
MachineCopyPropagation by D41835 (and were reviewed as part of that change).

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

6 years ago[AMDGPU] Revert "[AMDGPU] Add options for waitcnt pass debugging; add instr count...
Mark Searles [Tue, 30 Jan 2018 17:17:06 +0000 (17:17 +0000)]
[AMDGPU] Revert "[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output."

Patch caused a buildbot failure; arg; http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/17373/s\
teps/build_Lld/logs/stdio :
        /Users/buildslave/as-bldslv9/lld-x86_64-darwin13/llvm.src/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1563:18: error: unused variable 'InstCnt' [-Werror,-Wunused-variable]
          static int32_t InstCnt = 0;
                                              "
This reverts commit 4f4a7d61e306b67044d9f16bc2016fee806bc2cc.

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

6 years ago[CodeView] Micro-optimizations to speed up type merging.
Zachary Turner [Tue, 30 Jan 2018 17:12:04 +0000 (17:12 +0000)]
[CodeView] Micro-optimizations to speed up type merging.

Based on a profile, a couple of hot spots were identified in the
main type merging loop.  The code was simplified, a few loops
were re-arranged, and some outlined functions were inlined.  This
speeds up type merging by a decent amount, shaving around 3-4 seconds
off of a 40 second link in my test case.

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

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

6 years ago[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
Mark Searles [Tue, 30 Jan 2018 16:49:38 +0000 (16:49 +0000)]
[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
-amdgpu-waitcnt-forcezero={1|0}  Force all waitcnt instrs to be emitted as s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-amdgpu-waitcnt-forceexp=<n>  Force emit a s_waitcnt expcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcelgkm=<n> Force emit a s_waitcnt lgkmcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcevm=<n>   Force emit a s_waitcnt vmcnt(0) before the first <n> instrs

This patch was pushed ( abb190fd51cd2f9a9eef08c024e109f7f7e909fc ), which caused a buildbot failure, reverted ( 6227480d74da507cf8e1b4bcaffbdb9fb875b4b8 ), and then updated to fix buildbot failures (this patch).

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

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

6 years agoAMDGPU/SI: Add decoding in the GFX80_UNPACKED decoding namespace.
Changpeng Fang [Tue, 30 Jan 2018 16:42:40 +0000 (16:42 +0000)]
AMDGPU/SI: Add decoding in the GFX80_UNPACKED decoding namespace.

Reviewer:
  Dmitry (dp).

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

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

6 years ago[DeadArgumentElimination] Preserve llvm.dbg.values's first argument
Petar Jovanovic [Tue, 30 Jan 2018 16:42:04 +0000 (16:42 +0000)]
[DeadArgumentElimination] Preserve llvm.dbg.values's first argument

When removing return value Dead Argument Elimination pass clobbers first
llvm.dbg.value’s argument for live arguments of that function by replacing
it with nullptr. In the next pass it will be deleted, so debug location
about those arguments are lost. This change fixes it.

Patch by Djordje Todorovic.

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

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

6 years agoCodeGen: support an extension to pass linker options on ELF
Saleem Abdulrasool [Tue, 30 Jan 2018 16:29:29 +0000 (16:29 +0000)]
CodeGen: support an extension to pass linker options on ELF

Introduce an extension to support passing linker options to the linker.
These would be ignored by older linkers, but newer linkers which support
this feature would be able to process the linker.

Emit a special discarded section `.linker-option`.  The content of this
section is a pair of strings (key, value).  The key is a type identifier for
the parameter.  This allows for an argument free parameter that will be
processed by the linker with the value being the parameter.  As an example,
`lib` identifies a library to be linked against, traditionally the `-l`
argument for Unix-based linkers with the parameter being the library name.

Thanks to James Henderson, Cary Coutant, Rafael Espinolda, Sean Silva
for the valuable discussion on the design of this feature.

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

6 years ago[AArch64] Add new target feature to fuse address generation with load or store
Evandro Menezes [Tue, 30 Jan 2018 16:28:01 +0000 (16:28 +0000)]
[AArch64] Add new target feature to fuse address generation with load or store

This feature enables the fusion of the address generation and a
corresponding load or store together.

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

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

6 years ago[mips] Fix incorrect sign extension for fpowi libcall
Simon Dardis [Tue, 30 Jan 2018 16:24:10 +0000 (16:24 +0000)]
[mips] Fix incorrect sign extension for fpowi libcall

PR36061 showed that during the expansion of ISD::FPOWI, that there
was an incorrect zero extension of the integer argument which for
MIPS64 would then give incorrect results. Address this with the
existing mechanism for correcting sign extensions.

This resolves PR36061.

Thanks to James Cowgill for reporting the issue!

Reviewers: atanasyan, hfinkel

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

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

6 years agoRe-commit : [PowerPC] Add handling for ColdCC calling convention and a pass to mark
Zaara Syeda [Tue, 30 Jan 2018 16:17:22 +0000 (16:17 +0000)]
Re-commit : [PowerPC] Add handling for ColdCC calling convention and a pass to mark
candidates with coldcc attribute.

This recommits r322721 reverted due to sanitizer memory leak build bot failures.

Original commit message:
This patch adds support for the coldcc calling convention for Power.
This changes the set of non-volatile registers. It includes a pass to stress
test the implementation by marking all static directly called functions with
the coldcc attribute through the option -enable-coldcc-stress-test. It also
includes an option, -ppc-enable-coldcc, to add the coldcc attribute to
functions which are cold at all call sites based on BlockFrequencyInfo when
the containing function does not call any non cold functions.

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

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

6 years agoAdd more initializers to quiet a clang warning
Daniel Sanders [Tue, 30 Jan 2018 16:02:32 +0000 (16:02 +0000)]
Add more initializers to quiet a clang warning

Summary:
`struct crashreporter_annotations_t` gained one more `uint64_t` field in
`CRASHREPORTER_ANNOTATIONS_VERSION` 5

causing an annoying clang warning:

```
llvm/lib/Support/PrettyStackTrace.cpp:92:65: warning: missing field 'abort_cause' initializer [-Wmissing-field-initializers]
        = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0 };
                                                                ^
1 warning generated
```

Let's fix it.

Patch by Roman Tereshin

Reviewers: qcolombet, echristo, beanz, dexonsmith

Reviewed By: echristo

Subscribers: dsanders, dexonsmith, beanz, echristo, qcolombet, llvm-commits

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

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

6 years ago[X86][AVX512] Add VBMI target shuffle-trunc tests
Simon Pilgrim [Tue, 30 Jan 2018 16:01:41 +0000 (16:01 +0000)]
[X86][AVX512] Add VBMI target shuffle-trunc tests

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

6 years ago[AArch64] Update test cases for Exynos M3
Evandro Menezes [Tue, 30 Jan 2018 15:40:27 +0000 (15:40 +0000)]
[AArch64] Update test cases for Exynos M3

Update any test case relevant for Exynos M3.

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

6 years ago[AArch64] Add new target feature to handle cheap as move for Exynos
Evandro Menezes [Tue, 30 Jan 2018 15:40:22 +0000 (15:40 +0000)]
[AArch64] Add new target feature to handle cheap as move for Exynos

This feature enables special handling of cheap as move in the existing
custom handling specifically for Exynos processors.

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

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

6 years ago[AArch64] Add pipeline model for Exynos M3
Evandro Menezes [Tue, 30 Jan 2018 15:40:16 +0000 (15:40 +0000)]
[AArch64] Add pipeline model for Exynos M3

Add the scheduling and cost model for Exynos M3.

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

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

6 years ago[RS4GC] Handle call/invoke instructions as base defining values of vectors
Daniel Neilson [Tue, 30 Jan 2018 14:43:41 +0000 (14:43 +0000)]
[RS4GC] Handle call/invoke instructions as base defining values of vectors

Summary:
 There's an asymmetry in the definitions of findBaseDefiningValueOfVector() and
findBaseDefiningValue() of RS4GC. The later handles call and invoke instructions,
and the former does not. This appears to be simple oversight. This patch remedies
the oversight by adding the call and invoke cases to findBaseDefiningValueOfVector().

Reviewers: DaniilSuchkov, anna

Reviewed By: anna

Subscribers: llvm-commits

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

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

6 years ago[X86FixupBWInsts] mir-simplify fixup-bw-inst.mir test. NFC.
Andrei Elovikov [Tue, 30 Jan 2018 14:25:12 +0000 (14:25 +0000)]
[X86FixupBWInsts] mir-simplify fixup-bw-inst.mir test. NFC.

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

6 years agoRevert "[X86] Avoid using high register trick for test instruction"
Eric Liu [Tue, 30 Jan 2018 14:18:33 +0000 (14:18 +0000)]
Revert "[X86] Avoid using high register trick for test instruction"

This reverts commit r323690. This causes crash in llc. See the original commit thread for details.

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

6 years ago[X86] Add test case for PR32690
Simon Pilgrim [Tue, 30 Jan 2018 14:15:51 +0000 (14:15 +0000)]
[X86] Add test case for PR32690

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

6 years ago[DSE] make sure memory is not modified before partial store merging (PR36129)
Sanjay Patel [Tue, 30 Jan 2018 13:53:59 +0000 (13:53 +0000)]
[DSE] make sure memory is not modified before partial store merging (PR36129)

We missed a critical check in D30703. We must make sure that no intermediate
store is sitting between the stores that we want to merge.

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=36129

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

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

6 years ago[XRay] clarify error messages when parsing broken traces
Martin Pelikan [Tue, 30 Jan 2018 13:41:34 +0000 (13:41 +0000)]
[XRay] clarify error messages when parsing broken traces

Summary:
When there's a mismatch of a function argument being right after the
wrong function, print an offset into the file where that happened, to
ease further debugging.

Reviewers: dberris, eizan, kpw

Subscribers: llvm-commits

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

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

6 years ago[AccelTable] Move print methods to implementation. NFC
Jonas Devlieghere [Tue, 30 Jan 2018 13:36:30 +0000 (13:36 +0000)]
[AccelTable] Move print methods to implementation. NFC

This patch moves the implementation of the print methods from the header
to the cpp file.

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

6 years agoTest commit.
Brock Wyma [Tue, 30 Jan 2018 13:16:50 +0000 (13:16 +0000)]
Test commit.
As per the LLVM Developer Policy under "Obtainiing Commit Access".

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

6 years agoSpelling mistake in comment. NFCI.
Simon Pilgrim [Tue, 30 Jan 2018 12:18:51 +0000 (12:18 +0000)]
Spelling mistake in comment. NFCI.

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

6 years agoChange simple-register-allocation-read-undef.mir so that it doesn't fail if the file...
Amaury Sechet [Tue, 30 Jan 2018 11:07:36 +0000 (11:07 +0000)]
Change simple-register-allocation-read-undef.mir so that it doesn't fail if the file path contains 'dead' . NFC

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

6 years ago[ARM GlobalISel] Add inst selector tests for G_SITOFP and G_UITOFP
Diana Picus [Tue, 30 Jan 2018 09:15:27 +0000 (09:15 +0000)]
[ARM GlobalISel] Add inst selector tests for G_SITOFP and G_UITOFP

These are handled by the TableGen'erated code.

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

6 years ago[ARM GlobalISel] Map G_SITOFP and G_UITOFP
Diana Picus [Tue, 30 Jan 2018 09:15:23 +0000 (09:15 +0000)]
[ARM GlobalISel] Map G_SITOFP and G_UITOFP

Straightforward mapping (integer operand to GPR, floating point operand
to FPR).

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

6 years ago[ARM GlobalISel] Legalize G_SITOFP and G_UITOFP
Diana Picus [Tue, 30 Jan 2018 09:15:17 +0000 (09:15 +0000)]
[ARM GlobalISel] Legalize G_SITOFP and G_UITOFP

Legal if we have hardware support, libcall otherwise.

Also add supporting code to the legalizer helper for libcalls.

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

6 years ago[ARM GlobalISel] Add inst selector tests for G_FPTOSI and G_FPTOUI
Diana Picus [Tue, 30 Jan 2018 07:55:02 +0000 (07:55 +0000)]
[ARM GlobalISel] Add inst selector tests for G_FPTOSI and G_FPTOUI

The work is done by the TableGen'erated code.

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

6 years ago[ARM GlobalISel] Map G_FPTOSI and G_FPTOUI
Diana Picus [Tue, 30 Jan 2018 07:54:58 +0000 (07:54 +0000)]
[ARM GlobalISel] Map G_FPTOSI and G_FPTOUI

Straightforward mapping (integer operand goes to GPR, floating point
operand goes to FPR).

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

6 years ago[ARM GlobalISel] Legalize G_FPTOSI and G_FPTOUI
Diana Picus [Tue, 30 Jan 2018 07:54:52 +0000 (07:54 +0000)]
[ARM GlobalISel] Legalize G_FPTOSI and G_FPTOUI

Legal if we have hardware support for floating point, libcalls
otherwise.

Also add the necessary support for libcalls in the legalizer helper.

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

6 years ago[X86] Auto-generate complete checks. NFC
Craig Topper [Tue, 30 Jan 2018 07:02:29 +0000 (07:02 +0000)]
[X86] Auto-generate complete checks. NFC

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

6 years ago[DWARF] Corrected test committed in r323670 to use llc instead of llc_dwarf to avoid...
Wolfgang Pieb [Tue, 30 Jan 2018 01:11:46 +0000 (01:11 +0000)]
[DWARF] Corrected test committed in r323670 to use llc instead of llc_dwarf to avoid multiple triples.

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

6 years ago[utils] De-duplicate utils/update_{llc_,}test_checks.py
Fangrui Song [Tue, 30 Jan 2018 00:40:05 +0000 (00:40 +0000)]
[utils] De-duplicate utils/update_{llc_,}test_checks.py

Subscribers: llvm-commits

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

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

6 years ago[InstSimplify] (X * Y) / Y --> X for relaxed floating-point ops
Sanjay Patel [Tue, 30 Jan 2018 00:18:37 +0000 (00:18 +0000)]
[InstSimplify] (X * Y) / Y --> X for relaxed floating-point ops

This is the FP counterpart that was mentioned in PR35709:
https://bugs.llvm.org/show_bug.cgi?id=35709

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

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

6 years ago[SelectionDAG]: Ignore "returned" in the presence of an implicit sret.
Dan Gohman [Tue, 30 Jan 2018 00:14:40 +0000 (00:14 +0000)]
[SelectionDAG]: Ignore "returned" in the presence of an implicit sret.

When a function return value can't be directly lowered, such as
returning an i128 on WebAssembly, as indicated by the CanLowerReturn
target hook, SelectionDAGBuilder can translate it to return the
value through a hidden sret-like argument.

If such a function has an argument with the "returned" attribute,
the attribute can't be automatically lowered, because the function
no longer has a normal return value. For now, just discard the
"returned" attribute.

This fixes PR36128.

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

6 years ago[globalisel][legalizer] Fix a fallthrough case in the unittests debug printing
Daniel Sanders [Mon, 29 Jan 2018 23:47:41 +0000 (23:47 +0000)]
[globalisel][legalizer] Fix a fallthrough case in the unittests debug printing

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

6 years ago[RAFast] Don't dereference MBB::end
Quentin Colombet [Mon, 29 Jan 2018 23:42:37 +0000 (23:42 +0000)]
[RAFast] Don't dereference MBB::end

When RAFast sees liveins in on a basic block, it uses that information
to initialize the availability of the registers. The called
method uses an instruction as one of its argument and in the liveins
case, RAFast was dereferencing MBB::begin which can be MBB::end for
empty basic block.

Change the API of definePhysReg to use MachineBasicBlock::iterator
instead of MachineInstr so that we don't dereference an
invalid iterator while making the call.

rdar://problem/36952401

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

6 years agoAMDGPU: Move ADDRIndirect complex pattern into R600Instructions.td
Tom Stellard [Mon, 29 Jan 2018 23:29:26 +0000 (23:29 +0000)]
AMDGPU: Move ADDRIndirect complex pattern into R600Instructions.td

Summary: This is only used by R600.

Reviewers: arsenm

Reviewed By: arsenm

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

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

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

6 years ago[X86] Use VMOVDQA64 for aligned vXi32 stores.
Craig Topper [Mon, 29 Jan 2018 23:27:23 +0000 (23:27 +0000)]
[X86] Use VMOVDQA64 for aligned vXi32 stores.

I meant to do this with the unaligned stores in r322820, but looks like I missed it.

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

6 years agoAMDGPU: Allow a SGPR for the conditional KILL operand
Marek Olsak [Mon, 29 Jan 2018 23:19:10 +0000 (23:19 +0000)]
AMDGPU: Allow a SGPR for the conditional KILL operand

Patch by: Bas Nieuwenhuizen

Just use the _e64 variant if needed. This should be possible as per

def : Pat <
  (int_amdgcn_kill (i1 (setcc f32:$src, InlineFPImm<f32>:$imm, cond:$cond))),
  (SI_KILL_F32_COND_IMM_PSEUDO $src, (bitcast_fpimm_to_i32 $imm), (cond_as_i32imm $cond))
> ;

I don't think we can get an immediate for the other operand for which we
need the second 32-bit word.

https://reviews.llvm.org/D42302

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

6 years agoFix some regular expressions in llvm-mode.el.
Rafael Espindola [Mon, 29 Jan 2018 22:56:41 +0000 (22:56 +0000)]
Fix some regular expressions in llvm-mode.el.

In some cases it was using "\" unnecessarily.  In another case it
needed an additional "\" to properly indicate a numbered sub-match.

Make comment-start buffer-local in llvm-mode.el

llvm-mode was setting comment-start globally.  However, it is better
to only set it locally in the current buffer.

Don't use purecopy in llvm-mode.el

There's no reason to use purecopy in llvm-mode.el.
purecopy is only needed for files that are dumped in emacs.

Add a version header to llvm-mode.el

Adding a version header to llvm-mode.el allows it to be installed by
the Emacs package manager.  There are not many requirements on the
version number; however it is useful to users to bump it when
something significant changes.  Here I've chosen just to start at 1.0.

Patch by Tom Tromey!

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

6 years ago[DSE] add test for PR36129; NFC
Sanjay Patel [Mon, 29 Jan 2018 22:50:08 +0000 (22:50 +0000)]
[DSE] add test for PR36129; NFC

We can miscompile because we're not checking is the memory might
me modified between the seemingly redundant store ops.

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

6 years agoLiveInterval: Print weight in print() function.
Matthias Braun [Mon, 29 Jan 2018 22:03:00 +0000 (22:03 +0000)]
LiveInterval: Print weight in print() function.

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