Commit Graph

141939 Commits

Author SHA1 Message Date
Bob Haarman
db18d34db4 revert inadvertedly introduced build break
Summary:
r288722 introduced a build break due some code that should
not have been part of the commit. This change removes the offending
code.

Reviewers: davide, ruiu

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 00:55:55 +00:00
Weiming Zhao
943496ffc4 Summary: Currently there is no way to disable deprecated warning from asm like this
clang  -target arm deprecated-asm.s -c
  deprecated-asm.s:30:9: warning: use of SP or PC in the list is deprecated
       stmia   r4!, {r12-r14}

We have to have an option what can disable it.

Patched by Yin Ma!

Reviewers: joey, echristo, weimingz

Subscribers: llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:55:13 +00:00
Kostya Serebryany
fe3cc4d2c5 [libFuzzer] refactor the code to allow collecting features in different ways. Also initialize a couple of Fuzzer:: members that might have been used uninitialized :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:35:22 +00:00
Tim Northover
416ccca7e0 GlobalISel: avoid looking too closely at PHIs when we bail.
The function used to finish off PHIs by adding the relevant basic blocks can
fail if we're aborting and still don't actually have the needed
MachineBasicBlocks. So avoid trying in that case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:10:19 +00:00
Davide Italiano
8ea5797013 [SCCP] Remove manual folding of terminator instructions.
There are two cases handled here:
1) a branch on undef
2) a switch with an undef condition.

Both cases are currently handled by ResolvedUndefsIn. If we have
a branch on undef, we force its value to false (which is trivially
foldable). If we have a switch on undef, we force to the first
constant (which is also foldable).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:04:21 +00:00
Davide Italiano
fb77f46543 [TableGen] Centralize/Unify error handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 22:58:01 +00:00
Bob Haarman
9398e86991 [pdb] handle missing pdb streams more gracefully
Summary: The code we use to read PDBs assumed that streams we ask it to read exist, and would read memory outside a vector and crash if this wasn't the case. This would, for example, cause llvm-pdbdump to crash on PDBs generated by lld. This patch handles such cases more gracefully: the PDB reading code in LLVM now reports errors when asked to get a stream that is not present, and llvm-pdbdump will report missing streams and continue processing streams that are present.

Reviewers: ruiu, zturner

Subscribers: thakis, amccarth

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 22:44:00 +00:00
Tim Northover
9fef274c6a GlobalISel: place constants correctly in the entry block.
When the entry block was empty after arg lowering, we were always placing
constants at the end. This is probably hamrless while translating the same
block, but horribly wrong once its terminator has been translated. So switch to
inserting at the beginning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 22:40:13 +00:00
Matt Arsenault
792cdf8f92 AMDGPU: Consolidate inline immediate predicate functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 22:26:17 +00:00
Tim Northover
75dfa0e7c6 GlobalISel: handle pointer arguments that get assigned to the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 22:20:32 +00:00
Matt Arsenault
b51e031eff AMDGPU: Minor assembler refactoring
Fix return before else, check types for selecting
fltSemantics, refactor immediate checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 22:07:21 +00:00
Eugene Zelenko
cfa44507a2 [IR] Fix some Clang-tidy modernize-use-equals-delete and Include What You Use warnings; other minor fixes (NFC).
Also remove obsolete comment from CommandLine.h spotted by Malcolm Parsons.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:55:02 +00:00
Tim Northover
e1db4f7b15 GlobalISel: translate constants larger than 64 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:54:17 +00:00
Tim Northover
ad46a07d21 GlobalISel: make G_CONSTANT take a ConstantInt rather than int64_t.
This makes it more similar to the floating-point constant, and also allows for
larger constants to be translated later. There's no real functional change in
this patch though, just syntax updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:47:07 +00:00
Tim Northover
bcadc2717e GlobalISel: improve translation fallback for constants.
Returning 0 (NoReg) from getOrCreateVReg leads to unexpected situations later
in the translation. It's better to return a valid (if undefined) register and
let the rest of the instruction carry on as planned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:40:33 +00:00
Tim Northover
14a3520a09 GlobalISel: handle 1-element aggregates during ABI lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:25:33 +00:00
Keno Fischer
99ca52276f [LAA] Prevent invalid IR for loop-invariant bound in loop body
Summary:
If LAA expands a bound that is loop invariant, but not hoisted out
of the loop body, it used to use that value anyway, causing a
non-domination error, because the memcheck block is of course not
dominated by the scalar loop body. Detect this situation and expand
the SCEV expression instead.

Fixes PR31251

Reviewers: anemet
Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:25:03 +00:00
Michael Kuperstein
8bb9ea4ceb [X86] Fix non-intrinsic roundss/roundsd to not read the destination register
This changes the scalar non-intrinsic non-avx roundss/sd instruction
definitions not to read their destination register - allowing partial dependency
breaking.

This fixes PR31143.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:57:37 +00:00
Matt Arsenault
923a40060f AMDGPU: Assembler support for exp
compr is not currently parsed (or printed) correctly,
but that should probably be fixed along with
intrinsic changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:42:41 +00:00
Matt Arsenault
3acbc32a69 AMDGPU: Change how exp is printed
This is an improvement over a long list of unreadable numbers.
A follow up patch will try to match how sc formats these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:31:49 +00:00
Matt Arsenault
350d0dab1e AMDGPU: Refactor exp instructions
Structure the definitions a bit more like the other classes.

The main change here is to split EXP with the done bit set
to a separate opcode, so we can set mayLoad = 1 so that it won't
be reordered before the other exp stores, since this has the special
constraint that if the done bit is set then this should be the last
exp in she shader.

Previously all exp instructions were inferred to have unmodeled
side effects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:23:10 +00:00
Eric Fiselier
5b9f351e17 [lit] Support custom parsers in parseIntegratedTestScript
Summary:
Libc++ frequently has the need to parse more than just the builtin *test keywords* (`RUN`, `REQUIRES`, `XFAIL`, ect). For example libc++ currently needs a new keyword `MODULES-DEFINES: macro list...`. Instead of re-implementing the script parsing in libc++ this patch allows `parseIntegratedTestScript` to take custom parsers.

This patch introduces a new class `IntegratedTestKeywordParser` which implements the logic to parse/process a test keyword. Parsing of various keyword "kinds" are supported out of the box, including 'TAG', 'COMMAND', and 'LIST', which parse keywords such as `END.`, `RUN:` and `XFAIL:` respectively.

As an example after this change libc++ can implement the `MODULES-DEFINES` simply using: 
```
mparser = IntegratedTestKeywordParser('MODULES-DEFINES:', ParserKind.LIST)
parseIntegratedTestScript(test, additional_parsers=[mparser])
macro_list = mparser.getValue()
```


Reviewers: ddunbar, modocache, rnk, danalbert, jroelofs

Subscribers: mgrang, llvm-commits, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:21:21 +00:00
Matthias Braun
9478556f8f TableGen/AsmMatcherEmitter: Bring sorting check back under EXPENSIVE_CHECKS
Bring the sorting check back that I removed in r288655 but put it under
EXPENSIVE_CHECKS this time. Also document that this the check isn't
purely about having a sorted list but also about operator < having the
correct transitive behavior.

Apply the same to the other check in the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 19:44:31 +00:00
Quentin Colombet
0689e744d2 [AArch64][RegisterBankInfo] Fix typo in the logic used in assert.
Thanks to David Binderman <dcb314@hotmail.com> for bringing it to my
attention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 19:02:37 +00:00
Adrian Prantl
460dd60c1a [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation
so we can stop using DW_OP_bit_piece with the wrong semantics.

The entire back story can be found here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161114/405934.html

The gist is that in LLVM we've been misinterpreting DW_OP_bit_piece's
offset field to mean the offset into the source variable rather than
the offset into the location at the top the DWARF expression stack. In
order to be able to fix this in a subsequent patch, this patch
introduces a dedicated DW_OP_LLVM_fragment operation with the
semantics that we used to apply to DW_OP_bit_piece, which is what we
actually need while inside of LLVM. This patch is complete with a
bitcode upgrade for expressions using the old format. It does not yet
fix the DWARF backend to use DW_OP_bit_piece correctly.

Implementation note: We discussed several options for implementing
this, including reserving a dedicated field in DIExpression for the
fragment size and offset, but using an custom operator at the end of
the expression works just fine and is more efficient because we then
only pay for it when we need it.

Differential Revision: https://reviews.llvm.org/D27361
rdar://problem/29335809

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 18:04:47 +00:00
Chris Bieneman
79adb742d1 [CMake] Fix symlink refactor for multi-configuration generators
This fix, while a bit complicated, preserves the reusability while fixing the issues reported on llvm-commits with visual studio generators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288679 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 17:02:11 +00:00
Sanjay Patel
bb03f57f04 [TargetLowering] add special-case for demanded bits analysis of 'not'
We treat bitwise 'not' as a special operation and try not to reduce its all-ones mask. 
Presumably, this is because a 'not' may be cheaper than a generic 'xor' or it may get
folded into another logic op if the target has those. However, if we can remove a logic
instruction by changing the xor's constant mask value, that should always be a win.

Note that the IR version of SimplifyDemandedBits() does not treat 'not' as a special-case
currently (although that's marked with a FIXME). So if you run this IR through -instcombine,
you should get the same end result. I'm hoping to add a different backend transform that 
will expose this problem though, so I need to solve this first.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 15:58:21 +00:00
Sanjay Patel
da70d5a32a [x86] fold fand (fxor X, -1) Y --> fandn X, Y
I noticed this gap in the scalar FP-logic matching with:
D26712
and:
rL287171

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 15:45:27 +00:00
Simon Pilgrim
4b0a367e90 Use range based for loop. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 14:25:04 +00:00
Nirav Dave
447a2882e2 [PPC] Slightly Improve Assembly Parsing errors and add EOL comment
parsing tests.

NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 14:11:03 +00:00
Simon Dardis
4a2a5dfb97 [mips][ias] N32/N64 must not sort the relocation table.
Doing so changes the evaluation order for relocation composition.

Patch By: Daniel Sanders

Reviewers: vkalintiris, atanasyan

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 12:55:19 +00:00
Simon Pilgrim
26d70f7d77 [X86][SSE] Add support for combining target shuffles to UNPCKL/UNPCKH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 11:25:13 +00:00
Simon Pilgrim
55f84f128f [X86][SSE] Add helper function to create UNPCKL/UNPCKH shuffle masks. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 11:00:25 +00:00
Diana Picus
0eeb88bc21 [GlobalISel] Extract handleAssignments out of AArch64CallLowering
This function seems target-independent so far: all the target-specific behaviour
is isolated in the CCAssignFn and the ValueHandler (which we're also extracting
into the generic CallLowering).

The intention is to use this in the ARM backend.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 10:40:33 +00:00
Sam Kolton
45274ac25b [AMDGPU] Disassembler: fix s_buffer_store_dword instructions
Summary: s_buffer_store_dword instructions sdata operand was called sdst in encoding. This caused disassembler to fail.

Reviewers: tstellarAMD, vpykhtin, artem.tamazov

Subscribers: arsenm, nhaehnle, rampitec

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 09:58:51 +00:00
Michal Gorny
02114e6a31 [cmake] Include component in Sphinx install rules
Include component in install rules for Sphinx targets. Based on
a similar suggestion for other doc targets in D24935.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 09:15:05 +00:00
Matthias Braun
25801f0f22 TableGen/AsmMatcherEmitter: Trust that stable_sort works
A debug build of AsmMatcherEmitter would use a quadratic algorithm to
check whether std::stable_sort() actually sorted. Let's hope the authors
of our C++ standard library did that testing for us. Removing the check
gives a 3x speedup in the X86 case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 08:15:57 +00:00
Matthias Braun
2b86a875bf TableGen: Some more std::string->StringInit* replacements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 07:35:13 +00:00
Matthias Braun
53cf984ca8 TableGen/Record: Shortcut member access in hottest function
This may seem unusual, but makes most debug tblgen builds ~10% faster.
Usually we wouldn't care about speed that much in debug builds, but for
tblgen that also translates into build time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 07:35:09 +00:00
Matthias Braun
f3a991b8e3 TableGen: TableGenStringKey is no longer necessary as of r288642
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288651 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 07:04:19 +00:00
Matthias Braun
c2e7826e2b TableGen: Use range based for; reserve vectors where possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 07:00:44 +00:00
Matthias Braun
a3f0e48f72 TableGen/TGParser: Prefer SmallVector/ArrayRef over std::vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288649 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:41:54 +00:00
Matthias Braun
5a87cb27d9 TableGen/Record: Replace std::vector with SmallVector/ArrayRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:41:51 +00:00
Matthias Braun
2ba1a51cf5 ListInit::convertInitializerTo: avoid foldingset lookup if nothing changed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288647 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:41:47 +00:00
Craig Topper
1fcb0c5274 [X86] Remove unnecessary explicit uses of .SimpleTy just to do an equality comparison. MVT's operator== already takes care of this. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:09:55 +00:00
Matthias Braun
ddbd6db517 TableGen: Use StringInit instead of std::string for DagInit arg names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:00:46 +00:00
Matthias Braun
205e9501a0 TableGen: Use StringInit instead of std::string for DagInit name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:00:41 +00:00
Matthias Braun
1ecbef9056 TableGen: Use more StringInit instead of StringRef
This forces the code to call StringInit::get on the string early and
avoids storing duplicates in std::string and sometimes allows pointer
comparisons instead of string comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288642 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:00:36 +00:00
Craig Topper
a3d4859091 [AVX-512] Teach fast isel to handle 512-bit vector bitcasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288641 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 05:50:51 +00:00
Kuba Mracek
9a1eeb2083 Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning
Building compiler-rt on Darwin produces dozens of meaningless warnings about object files having no symbols during static archive creation. This is very intentional as compiler-rt uses #ifdefs to conditionally compile platform-specific code, and we even have a .cpp source file that only contains static asserts to make sure the environment is configured right. On Linux, this situation is fine and no warning is produced. This patch adds a libtool version detection and if it's new enough, we'll use the -no_warning_for_no_symbols flag that suppresses this warning. Build logs should be much cleaner now!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 05:21:44 +00:00