135823 Commits

Author SHA1 Message Date
Sebastian Pop
906c5ef31e add a verbose mode to Loop->print() to print all the basic blocks of a loop
Differential Revision: https://reviews.llvm.org/D22817

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 05:02:17 +00:00
Sebastian Pop
fde7c9daa6 add function isLoopLatch
Differential Revision: https://reviews.llvm.org/D22817

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 05:02:15 +00:00
Sebastian Pop
5960086d84 refactor code in verifyLoop: NFC.
Use std::any_of as requested in https://reviews.llvm.org/D22816

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 04:36:06 +00:00
Vedant Kumar
c380ddf1dc [llvm-cov] Escape '\' in strings when emitting JSON
Test that Windows path separators are escaped properly. Add a round-trip
test to verify the JSON produced by the exporter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 04:08:32 +00:00
Sebastian Pop
a49a3e1c5e Move assert as early as possible
Patch written by Aditya Kumar.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 03:30:11 +00:00
Andrew Wilkins
064517fef6 [llvm-go] parameterize $GOPATH construction
Summary:
To build llgo, you must currently ensure that llgo
is in the tools/llgo directory, due to a hard-coded
path in llvm-go.

To support the use of LLVM_EXTERNAL_LLGO_SOURCE_DIR,
we introduce a flag to llvm-go that enables the
caller to specify the paths to symlink in the
temporary $GOPATH.

Reviewers: pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 03:21:51 +00:00
David Majnemer
00429d5fa9 [ConstantFolding] Correctly handle failures in ConstantFoldConstantExpressionImpl
Failures in ConstantFoldConstantExpressionImpl were ignored causing
crashes down the line.

This fixes PR28725.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 02:39:16 +00:00
Andrew Kaylor
e60e6f6702 Reverting r276771 due to MSan failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 01:19:24 +00:00
Matt Arsenault
f799c706db AMDGPU: Use rcp for fdiv 1, x with fpmath metadata
Using rcp should be OK for safe math usually, so this
should not be replacing the original fdiv.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 23:25:44 +00:00
Hans Wennborg
df483ab5a3 Revert r276136 "Use ValueOffsetPair to enhance value reuse during SCEV expansion."
It causes Clang tests to fail after Windows self-host (PR28705).

(Also reverts follow-up r276139.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 23:25:13 +00:00
Matt Arsenault
c43677a11d AMDGPU: Add more tests for LDS size with occupancy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 23:15:59 +00:00
Vedant Kumar
c1cc7ba99a [docs] Fix a sphinx error in llvm-cov.rst
Failing bot:

  http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/12025

Fix tested with `ninja docs-llvm-html`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 23:09:57 +00:00
Matt Arsenault
8cbfb0914d AMDGPU: Use implicit_def for selecting anyext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 23:06:33 +00:00
Vedant Kumar
53397d1544 Retry: [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Changes since the initial commit (r276813):

  - Fixed the regexes in the tests to handle Windows filepaths.

Patch by Eddie Hurtig!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 22:50:58 +00:00
Peter Collingbourne
aaba6ed8cd docs: Add reference to type metadata to langref.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 22:31:30 +00:00
Vedant Kumar
63d80be936 Revert "[llvm-cov] Add support for exporting coverage data to JSON"
This reverts commit r276813. The Windows bots are complaining about some
of the filename regexes in the tests:

  http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/5299

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:55:39 +00:00
Matthias Braun
ad0f5f6b52 MIRParser: Use dot instead of colon to mark subregisters
Change the syntax to use `%0.sub8` to denote a subregister.

This seems like a more natural fit to denote subregisters; I also plan
to introduce a new ":classname" syntax in upcoming patches to denote the
register class of a vreg.

Note that this commit disallows plain identifiers to start with a '.'
character.  This shouldn't affect anything as external names/IR
references are all prefixed with '$'/'%', plain identifiers are only
used for instruction names, register mask names and subreg indexes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:49:34 +00:00
Vedant Kumar
f57cf2f2c7 [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Patch by Eddie Hurtig!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:35:43 +00:00
Sanjoy Das
315f732fa1 Fix docs/Coroutines.rst syntax highlighting on Linux
Summary:
s/code-block:: C++/code-block:: c++ in docs/Coroutines.rst .

Patch by Gor Nishanov!  Edited by Sanjoy to fix a missing s/C/c/.

Reviewers: sanjoy, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:03:41 +00:00
Matt Arsenault
252b5ebfdd AMDGPU/R600: Remove dead custom inserters
The intrinsics for these were removed, so this is dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:03:38 +00:00
Matt Arsenault
7aeb3e40c1 AMDGPU: Minor AsmPrinter cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:03:36 +00:00
Krzysztof Parzyszek
43492b2a7a [Hexagon] Post-increment loads/stores enhancements
- Generate vector post-increment stores more aggressively.
- Predicate post-increment and vector stores in early if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 20:30:30 +00:00
Tim Northover
2deff156d0 GlobalISel: add generic load and store instructions.
Pretty straightforward, the only oddity is the MachineMemOperand (which it's
surprisingly difficult to share code for).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 20:23:26 +00:00
Michael Kuperstein
50e5cbcfcf [X86] Split out absdiff detection from SAD combine. NFC.
Preparation for supporting PSADBW emission for straight-line code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 20:01:29 +00:00
Krzysztof Parzyszek
a628d047d1 [Hexagon] Gracefully handle reg class mismatch in HexagonLoopReschedule
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 19:17:13 +00:00
Krzysztof Parzyszek
aa3e2e6820 [Hexagon] Rerun bit tracker on new instructions in RIE
Consider this case:
  vreg1 = A2_zxth vreg0   (1)
  ...
  vreg2 = A2_zxth vreg1   (2)

Redundant instruction elimination could delete the instruction (1)
because the user (2) only cares about the low 16 bits. Then it could
delete (2) because the input is already zero-extended. The problem
is that the properties allowing each individual instruction to be
deleted depend on the existence of the other instruction, so either
one can be deleted, but not both.
The existing check for this situation in RIE was insufficient. The
fix is to update all dependent cells when an instruction is removed
(replaced via COPY) in RIE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 19:08:45 +00:00
Krzysztof Parzyszek
f39cea0a71 Add link to the Hexagon documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:40:25 +00:00
Krzysztof Parzyszek
17a42256ee [Hexagon] Bitwise operations for insert/extract word not simplified
Change the bit simplifier to generate REG_SEQUENCE instructions in
addition to COPY, which will handle cases of word insert/extract.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:30:11 +00:00
Justin Lebar
2b8ecef8b7 Fix NVPTX/call-with-alloca-buffer.ll after r276777.
r276777 makes InstSimplify stronger, letting it see through some
unnecessary addrspace casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:28:33 +00:00
Matthias Braun
7fdf5b1885 MIRParser: Use shorter cfi identifiers
In an instruction like:
	CFI_INSTRUCTION .cfi_def_cfa ...
we can drop the '.cfi_' prefix since that should be obvious by the
context:
	CFI_INSTRUCTION def_cfa ...

While being a terser and cleaner syntax this also prepares to dropping
support for identifiers starting with a dot character so we can use it
for expressions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:20:00 +00:00
Davide Italiano
e20e4c151f [MC] Don't crash when trying to emit a relocation against .bss.
Turn that into an error instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:16:33 +00:00
Bruno Cardoso Lopes
98a069fe1a [CMAKE] Find ld64 using xcrun
Given similar reasons from r276710, ld64 scrubs DYLD_* environment if
called from the shim executable /usr/bin/ld.

Add support for finding ld64 via xcrun.

This is needed in order to get LIT to have the full path to the ld4
executable.

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

rdar://problem/24300926

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:09:23 +00:00
David Majnemer
5d321c1c3e [InstSimplify] Cast folding can be made more generic
Use isEliminableCastPair to determine if a pair of casts are foldable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 17:58:05 +00:00
Adam Nemet
0f30994ef7 [LoopUtils] Sort headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 17:52:02 +00:00
Tim Northover
c48a054848 GlobalISel: add correct operand type to G_FRAME_INDEX instrs.
Frame indices should use "addFrameIndex", not "addImm".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 17:42:40 +00:00
Krzysztof Parzyszek
b450d54a80 [Hexagon] Add support for proper handling of H and L constraints
H -> High part of reg pair.
L -> Low part of reg pair.

Patch by Sundeep Kushwaha.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 17:31:02 +00:00
Tim Northover
d96170e773 GlobalISel: omit braces on MachineInstr types when there's only one.
Tidies up the representation a bit in the common case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 17:28:01 +00:00
Andrew Kaylor
04defbca9e Re-committing r275284: add support to inline __builtin_mempcpy
Patch by Sunita Marathe

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 17:23:13 +00:00
Matt Arsenault
d506595769 AMDGPU: Make AMDGPUMachineFunction fields private
ABIArgOffset is a problem because properly fsetting the
KernArgSize requires that the reserved area before the
real kernel arguments be correctly aligned, which requires
fixing clover.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 16:45:58 +00:00
Matt Arsenault
cc67a0a36a AMDGPU: Add missing tests for xnack option for HSA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 16:45:50 +00:00
Matt Arsenault
ee4cdb7b75 AMDGPU: Add fp legacy instruction intrinsics
This could use some additional optimization work
to use mad/mac legacy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 16:45:45 +00:00
Tim Northover
27d9a7f410 GlobalISel: add specialized buildCopy function to MachineInstrBuilder.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 16:45:30 +00:00
Tim Northover
1123323be2 GlobalISel: give MachineInstrBuilder a uniform interface. NFC.
Instead of an ad-hoc collection of "buildInstr" functions with varying numbers
of registers, this uses variadic templates to provide for as many regs as
needed!

Also make IRtranslator use new "buildBr" function instead of some weird generic
one that no-one else would really use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 16:45:26 +00:00
Daniel Sanders
4768f3dd31 [mips] Fix typos in spelling of lowerRETURNADDR.
The first letter was mistakenly capitalized.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 14:46:11 +00:00
Krzysztof Parzyszek
c4320ab2d8 [Hexagon] Update store offset when not packetizing it with allocframe
When the packetizer wants to put a store to a stack slot in the same
packet with an allocframe, it updates the store offset to reflect the
value of SP before it is updated by allocframe. If the store cannot
be packetized with the allocframe after all, the offset needs to be
updated back to the previous value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 14:24:46 +00:00
Oliver Stannard
7263e3e5ca [ARM] Improve error messages for .arch_extension directive
- More informative message when extension name is not an identifier token.
- Stop parsing directive if extension is unknown (avoid duplicate error
  messages).
- Report unsupported extensions with a source location, rather than
  report_fatal_error.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276748 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 14:24:43 +00:00
Oliver Stannard
b8014e14f6 [ARM] Implement -mimplicit-it assembler option
This option, compatible with gas's -mimplicit-it, controls the
generation/checking of implicit IT blocks in ARM/Thumb assembly.

This option allows two behaviours that were not possible before:
- When in ARM mode, emit a warning when assembling a conditional
  instruction that is not in an IT block. This is enabled with
  -mimplicit-it=never and -mimplicit-it=thumb.
- When in Thumb mode, automatically generate IT instructions when an
  instruction with a condition code appears outside of an IT block. This
  is enabled with -mimplicit-it=thumb and -mimplicit-it=always.

The default option is -mimplicit-it=arm, which matches the existing
behaviour (allow conditional ARM instructions outside IT blocks without
warning, and error if a conditional Thumb instruction is outside an IT
block).

The general strategy for generating IT blocks in Thumb mode is to keep a
small list of instructions which should be in the IT block, and only
emit them when we encounter something in the input which means we cannot
continue the block.  This could be caused by:
- A non-predicable instruction
- An instruction with a condition not compatible with the IT block
- The IT block already contains 4 instructions
- A branch-like instruction (including ALU instructions with the PC as
  the destination), which cannot appear in the middle of an IT block
- A label (branching into an IT block is not legal)
- A change of section, architecture, ISA, etc
- The end of the assembly file.

Some of these, such as change of section and end of file, are parsed
outside of the ARM asm parser, so I've added a new virtual function to
AsmParser to ensure any previously-parsed instructions have been
emitted. The ARM implementation of this flushes the currently pending IT
block.

We now have to try instruction matching up to 3 times, because we cannot
know if the current IT block is valid before matching, and instruction
matching changes depending on the IT block state (due to the 16-bit ALU
instructions, which set the flags iff not in an IT block). In the common
case of not having an open implicit IT block and the instruction being
matched not needing one, we still only have to run the matcher once.

I've removed the ITState.FirstCond variable, because it does not store
any information that isn't already represented by CurPosition. I've also
updated the comment on CurPosition to accurately describe it's meaning
(which this patch doesn't change).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 14:19:47 +00:00
Daniel Sanders
26a5022ce8 [lit] Document the 'available_features' member of the config object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 13:23:27 +00:00
Simon Pilgrim
23967709ee [X86][SSE] Added extra memory folding tests for cvtsd2ss intrinsic
SSE only fold partial reg update instructions when optsize is enabled

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 12:44:50 +00:00
Simon Pilgrim
9c00fcc1ab [X86][SSE] Fixed issue with memory folding of (v)cvtsd2ss intrinsics
Fixed typo in the intrinsic definitions of (v)cvtsd2ss with memory folding.

This was only unearthed when rL276102 started using the intrinsic again.....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 10:41:28 +00:00