Commit Graph

146223 Commits

Author SHA1 Message Date
Simon Pilgrim
943d3e07f8 [APInt] Add APInt::insertBits() method to insert an APInt into a larger APInt
We currently have to insert bits via a temporary variable of the same size as the target with various shift/mask stages, resulting in further temporary variables, all of which require the allocation of memory for large APInts (MaskSizeInBits > 64).

This is another of the compile time issues identified in PR32037 (see also D30265).

This patch adds the APInt::insertBits() helper method which avoids the temporary memory allocation and masks/inserts the raw bits directly into the target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 13:44:32 +00:00
Simon Dardis
56582e5d88 [mips][msa] Accept more values for constant splats
This patches teaches the MIPS backend to accept more values for constant
splats. Previously, only 10 bit signed immediates or values that could be
loaded using an ldi.[bhwd] instruction would be acceptted. This patch relaxes
that constraint so that any constant value that be splatted is accepted.

As a result, the constant pool is used less for vector operations, and the
suite of bit manipulation instructions b(clr|set|neg)i can now be used with
the full range of their immediate operand.

Reviewers: slthakur

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 13:27:14 +00:00
Artyom Skrobov
a4a753ce0b imm_comp_XFORM (defined in ARMInstrThumb.td) duplicates imm_not_XFORM (defined in ARMInstrInfo.td)
Reviewers: grosbach, rengolin, jmolloy

Reviewed By: jmolloy

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 13:21:12 +00:00
Sanne Wouda
9f316a5fb6 [Assembler] Add location info to unary expressions.
Summary:
This is a continuation of D28861.  Add an SMLoc to MCUnaryExpr such that
a better diagnostic can be given in case of an error in later stages of
assembling.

Reviewers: rengolin, grosbach, javed.absar, olista01

Reviewed By: olista01

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297454 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 13:08:20 +00:00
Artyom Skrobov
180a200844 Refactor the multiply-accumulate combines to act on
ARMISD::ADD[CE] nodes, instead of the generic ISD::ADD[CE].

Summary:
This allows for some simplification because the combines
are no longer limited to just one go at the node before
it gets legalized into an ARM target-specific one.

Reviewers: jmolloy, rogfer01

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 12:41:33 +00:00
George Rimar
a312eded5f WholeProgramDevirt: Fixed compilation error under MSVS2015.
It was introduced in:

r296945
WholeProgramDevirt: Implement exporting for single-impl devirtualization.
---------------------
r296939
WholeProgramDevirt: Add any unsuccessful llvm.type.checked.load devirtualizations to the list of llvm.type.test users.
---------------------

Microsoft Visual Studio Community 2015
Version 14.0.23107.0 D14REL
Does not compile that code without additional brackets, showing multiple error like below:

WholeProgramDevirt.cpp(1216): error C2958: the left bracket '[' found at 'c:\access_softek\llvm\lib\transforms\ipo\wholeprogramdevirt.cpp(1216)' was not matched correctly
WholeProgramDevirt.cpp(1216): error C2143: syntax error: missing ']' before '}'
WholeProgramDevirt.cpp(1216): error C2143: syntax error: missing ';' before '}'
WholeProgramDevirt.cpp(1216): error C2059: syntax error: ']'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 10:31:56 +00:00
Simon Atanasyan
6f2078159d [llvm-readobj] Support SHT_MIPS_DWARF section type flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 08:22:25 +00:00
Simon Atanasyan
b479d37bbc [MC] Set SHT_MIPS_DWARF section type for all .debug_* sections on MIPS
All MIPS .debug_* sections should be marked with ELF type SHT_MIPS_DWARF
accordingly the specification [1]. Also the same section type is assigned
to these sections by GNU tools.

[1] ftp.software.ibm.com/software/os390/czos/dwarf/mips_extensions.pdf

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 08:22:20 +00:00
Simon Atanasyan
d1a4b1d64a [MC] Accept a numeric value as an ELF section header's type
GAS supports specification of section header's type using a numeric
value [1]. This patch brings the same functionality to LLVM. That allows
to setup some target-specific section types belong to the SHT_LOPROC -
SHT_HIPROC range. If we attempt to print unknown section type, MCSectionELF
class shows an error message. It's better than print sole '@' sign
without any section type name.

In case of MIPS, example of such section's type is SHT_MIPS_DWARF.
Without the patch we will have to implement some workarounds
in probably not-MIPS-specific part of code base to convert SHT_MIPS_DWARF
to the @progbits while printing assembly and to assign SHT_MIPS_DWARF for
@progbits sections named .debug_* if we encounter such section in
an input assembly.

[1] https://sourceware.org/binutils/docs/as/Section.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 08:22:13 +00:00
Artyom Skrobov
c2bf545fa9 For Thumb1, lower ADDC/ADDE/SUBC/SUBE via the glueless ARMISD nodes,
same as already done for ARM and Thumb2.

Reviewers: jmolloy, rogfer01, efriedma

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 07:40:27 +00:00
Yaron Keren
ea56368f3d Implement getPassName() for IR printing passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297442 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 07:09:20 +00:00
Matt Arsenault
931794f288 AMDGPU: Fix insertion point when reducing load intrinsics
The insertion point may be later than the next instruction,
so it is necessary to set it when replacing the call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 05:25:49 +00:00
Daniel Berlin
7ff9661670 Move memory coercion functions from GVN.cpp to VNCoercion.cpp so they can be shared between GVN and NewGVN.
Summary:
These are the functions used to determine when values of loads can be
extracted from stores, etc, and to perform the necessary insertions to
do this.  There are no changes to the functions themselves except
reformatting, and one case where memdep was informed of a removed load
(which was pushed into the caller).

Reviewers: davide

Subscribers: mgorny, llvm-commits, Prazek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 04:54:10 +00:00
Dehao Chen
e7c1260471 Do not use branch metadata to check if a basic block is hot.
Summary: We should not use that to check basic block hotness as optimization may mess it up.

Reviewers: eraman

Reviewed By: eraman

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297437 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 01:44:37 +00:00
Sanjay Patel
46756ef2bd [x86] add tests for vec div/rem with 0 element in divisor; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:55:29 +00:00
Matt Arsenault
fb63a28590 PatternMatch; Add m_ZExtOrSExt matcher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:47:35 +00:00
Daniel Berlin
d7d7be8b3c NewGVN: Rewrite DCE during elimination so we do it as well as old GVN did.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:32:33 +00:00
Daniel Berlin
43009168c6 NewGVN: Rename a few things for clarity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297427 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:32:26 +00:00
Ahmed Bougacha
a3782b7e75 [GlobalISel] Use ImmutableCallSite instead of templates. NFC.
ImmutableCallSite abstracts away CallInst and InvokeInst. Use it!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:25:44 +00:00
Ahmed Bougacha
60bc0e7103 [GlobalISel] Fallback when failing to translate invoke.
We unintentionally stopped falling back in r293670.

While there, change an unusual construct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:25:35 +00:00
Daniel Berlin
5e2cfa2e2d Add support for DenseMap/DenseSet count and find using const pointers
Summary:
Similar to SmallPtrSet, this makes find and count work with both const
referneces and const pointers.

Reviewers: dblaikie

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 00:25:26 +00:00
Davide Italiano
96acf92927 [Unittests] Fix a build failure with clang 3.8. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 23:48:58 +00:00
Tim Northover
06c6e46521 GlobalISel: support trivial inlineasm calls.
They're used for nefarious purposes by ObjC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 23:36:26 +00:00
Eli Friedman
bfa11453a9 Refactor alias check from MISched into common helper. NFC.
Differential Revision: https://reviews.llvm.org/D30598



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 23:33:36 +00:00
Dan Gohman
c9f889fcc0 [WebAssembly] Fix the opcode numbers for floating-point le and gt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 23:08:21 +00:00
Amaury Sechet
2cab1ec06e [DAGCombiner] Do various combine on uaddo.
Summary: This essentially does the same transform as for ADC.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 22:47:00 +00:00
Krzysztof Parzyszek
ea69bf92bb [Hexagon] Fixes to the bitsplit generation
- Fix the insertion point, which occasionally could have been incorrect.
- Avoid creating multiple bitsplits with the same operands, if an old one
  could be reused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 22:02:14 +00:00
Tim Northover
cc002baec3 GlobalISel: inform FrameLowering when we emit a function call.
Amongst other things (I expect) this is necessary to ensure decent backtraces
when an "unreachable" is involved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 22:00:39 +00:00
Sanjay Patel
2e1f925ba9 [InstSimplify] allow folds for bool vector div/rem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 21:56:03 +00:00
Tim Northover
dd48fdc1f1 GlobalISel: put debug info for static allocas in the MachineFunction.
The good reason to do this is that static allocas are pretty simple to handle
(especially at -O0) and avoiding tracking DBG_VALUEs throughout the pipeline
should give some kind of performance benefit.

The bad reason is that the debug pipeline is an unholy mess of implicit
contracts, where determining whether "DBG_VALUE %reg, imm" actually implies a
load or not involves the services of at least 3 soothsayers and the sacrifice
of at least one chicken.  And it still gets it wrong if the variable is at SP
directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 21:12:06 +00:00
Sanjay Patel
5cf1d925cc [ConstantFold] vector div/rem with any zero element in divisor is undef
Follow-up for:
https://reviews.llvm.org/D30665
https://reviews.llvm.org/rL297390


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 20:42:30 +00:00
Matt Arsenault
f90265a1b0 AMDGPU: Support for SimplifyDemandedVectorElts for load intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297408 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 20:34:27 +00:00
Sanjay Patel
ddb500fb8d [InstSimplify] add tests for vector constant folding div/rem-by-0; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 20:31:20 +00:00
Yaxun Liu
bae9bd4df6 AMDGPU: Add GCCBuiltin for ds_permute ds_bpermute
Differential Revision: https://reviews.llvm.org/D30580


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 20:04:50 +00:00
Amaury Sechet
f15775bffb [DAGCombiner] Do various combine on usubo.
Summary: This essentially does the same transform as for SUBC.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 19:28:00 +00:00
Tom Stellard
f5d1d88cc2 CMake: Don't install llvm-tblgen twice
Summary:
The add_tablegen macros defines its own install target, and it was also calling
add_llvm_utility which adds another install target.

Configuring with -DLLVM_TOOLS_INSTALL_DIR set to something other than
'bin' along with -DLLVM_INSTALL_UTILS=ON was causing llvm-tablgen
to be installed to two separate directories.

Reviewers: beanz, hans

Reviewed By: beanz

Subscribers: llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 19:24:07 +00:00
Krzysztof Parzyszek
6779169075 [Hexagon] Refactor the DAG preprocessing code, NFC
Extract individual transformations into their own functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297401 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 19:14:23 +00:00
Rong Xu
1bf6ca1df1 Minor format change. nfc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297400 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 19:08:55 +00:00
Rong Xu
fbfbf06203 [PGO] Refactor profile dumping function for ease of adding other profile kind
Refactor the dumping function so that we can add other value profile kind easily.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 19:03:57 +00:00
Jan Sjodin
3640f26b7e Add front() method to SetVector.
Differential Revision: https://reviews.llvm.org/D27262



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297398 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 18:25:07 +00:00
Artem Belevich
bb9779aa2e [FileCheck] Added --enable-var-scope option to enable scope for regex variables.
If `--enable-var-scope` is in effect, variables with names that
start with `$` are considered to be global. All other variables are
local. All local variables get undefined at the beginning of each
CHECK-LABEL block. Global variables are not affected by CHECK-LABEL.
This makes it easier to ensure that individual tests are not affected
by variables set in preceding tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297396 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 17:59:04 +00:00
Krzysztof Parzyszek
ef87bd9051 [Hexagon] Add -mhvx option to the Hexagon backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 17:05:11 +00:00
Krzysztof Parzyszek
e5673c3859 [Hexagon] Propagate zext of i1 into arithmetic code in selection DAG
(op ... (zext i1 c) ...) -> (select c (op ... 1 ...),
                                      (op ... 0 ...))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 16:29:30 +00:00
Sanjay Patel
dccf5a1320 [InstSimplify] vector div/rem with any zero element in divisor is undef
This was suggested as a DAG simplification in the review for rL297026 :
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435253.html
...but let's start with IR since we have actual docs for IR (LangRef).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 16:20:52 +00:00
Sam Parker
f04eaba5c7 [ARM] Remove t2xtpk feature from tests
I previously removed the T2XtPk feature from the ARM backend, but it
looks like I missed some of the tests that were using the feature.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 15:14:32 +00:00
Sanjay Patel
4f7ea50478 [DAG] recognize div/rem by 0 as undef before trying constant folding
As discussed in the review thread for rL297026, this is actually 2 changes that 
would independently fix all of the test cases in the patch:

1. Return undef in FoldConstantArithmetic for div/rem by 0.
2. Move basic undef simplifications for div/rem (simplifyDivRem()) before 
   foldBinopIntoSelect() as a matter of efficiency.

I will handle the case of vectors with any zero element as a follow-up. That change
is the DAG sibling for D30665 + adding a check of vector elements to FoldConstantVectorArithmetic().

I'm deleting the test for PR30693 because it does not test for the actual bug any more
(dangers of using bugpoint).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 15:02:25 +00:00
Simon Pilgrim
29ec93c7b6 [X86][SSE] Speed up constant pool shuffle mask decoding with direct copy (PR32037).
If the constants are already the correct size, we can copy them directly into the shuffle mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297381 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 14:06:39 +00:00
Simon Dardis
11f7fe92f7 [mips] Revert fixes for PR32020.
The fix introduces segfaults and clobbers the value to be stored when
the atomic sequence loops.

Revert "[Target/MIPS] Kill dead code, no functional change intended."

This reverts commit r296153.

Revert "Recommit "[mips] Fix atomic compare and swap at O0.""

This reverts commit r296134.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 14:03:26 +00:00
Simon Pilgrim
102b6b2771 Fixed typos in comments. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297379 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 13:57:04 +00:00
Nuno Lopes
844a69f35e fix build on Cygwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 13:43:31 +00:00