146387 Commits

Author SHA1 Message Date
Daniel Berlin
a9c06e75f1 Fix some indenting and line-wrapping issues identified in ProgrammersManual. Make description of debugCounters a little clearer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 19:09:23 +00:00
Jessica Paquette
af024ba867 [Outliner] Add tail call support
This commit adds tail call support to the MachineOutliner pass. This allows
the outliner to insert jumps rather than calls in areas where tail calling is
possible. Outlined tail calls include the return or terminator of the basic
block being outlined from.

Tail call support allows the outliner to take returns and terminators into
consideration while finding candidates to outline. It also allows the outliner
to save more instructions. For example, in the X86-64 outliner, a tail called
outlined function saves one instruction since no return has to be inserted.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297653 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 18:39:33 +00:00
Craig Topper
57255ff3b4 [X86] Lower AVX2 gather intrinsics similar to AVX-512. Apply the same input source optimizations to break execution dependencies.
For AVX-512 we force the input to zero if the input is undef or the mask is all ones to break an execution dependency. This patch brings the same behavior to AVX2.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297652 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 18:34:46 +00:00
Craig Topper
131341ea2e [AVX-512] If gather mask is all ones, force the input to a zero vector.
We were already forcing undef inputs to become a zero vector, this now catches an all ones mask too.

Ideally we'd use undef and let execution dep fix handle picking the best register/clearance for the undef, but I don't think it can handle the early clobber today.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 18:17:46 +00:00
Matt Arsenault
8187a9b9ca AMDGPU: Fold icmp/fcmp into icmp intrinsic
The typical use is a library vote function which
compares to 0. Fold the user condition into the intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297650 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 18:14:02 +00:00
Jonas Devlieghere
2ebca363ad [Linker] Provide callback for internalization
Differential Revision: https://reviews.llvm.org/D30738

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297649 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 18:08:11 +00:00
Craig Topper
27a7060a36 [SelectionDAG] Enhance SDTCisSameNumEltsAs to work with scalar types and use it on extend/trunc/round operations.
Currently we don't enforce that ISD::ANY_EXTEND, ZERO_EXTEND, SIGN_EXTEND, TRUNC, FP_ROUND, FP_EXTEND have the same number of elements(including scalar) between their input and output. Though we have them documented as such. Up until a few months ago x86 created nodes that violated this rule. That's all been fixed now, and we should enforce the rule going forward.

In order to do this we need to allow SDTCisSameNumEltsAs to support scalar types and not enforce being a vector. If one type is scalar we will force the other type to also be scalar.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 17:37:14 +00:00
Zachary Turner
8d6966f700 Add missing include on <limits>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 17:25:47 +00:00
Adrian Prantl
5a7c5f7c89 API gardening: Rename FindAllocaDbgValue to findDbgValue (NFC)
and use have it use SmallVectorImpl.

There is nothing specific about allocas in this function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 17:20:47 +00:00
Zachary Turner
8b1d5b7371 Use numeric_limits<size_t>::max() instead of size_t(-1).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297641 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 17:12:37 +00:00
Zachary Turner
7fc3de5321 Fix a warning due to signed/unsigned comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 16:41:49 +00:00
Zachary Turner
7880ee0a1c Use the new member accessors of llvm::enumerate.
The value_type is no longer a struct, it's a class whose
members you have to access via a method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297635 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 16:32:08 +00:00
Zachary Turner
39e53ee48c [ADT] Improve the genericity of llvm::enumerate().
There were some issues in the implementation of enumerate()
preventing it from being used in various contexts.  These were
all related to the fact that it did not supporter llvm's
iterator_facade_base class.  So this patch adds support for that
and additionally exposes a new helper method to_vector() that
will evaluate an entire range and store the results in a
vector.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297633 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 16:24:10 +00:00
Zachary Turner
111ee794a0 Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 16:18:08 +00:00
Sanjay Patel
498a13fdd1 [CGP] add tests for PR31028; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297629 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 15:45:37 +00:00
Zachary Turner
00ea544948 [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB.
Previously we could round-trip type records from PDB -> Yaml ->
PDB, but for symbols we could only go from PDB -> Yaml.  This
completes the round-tripping for symbols as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 14:57:45 +00:00
Rafael Espindola
b8ff3dcbf6 Fix crash when multiple raw_fd_ostreams to stdout are created.
If raw_fd_ostream is constructed with the path of "-", it claims
ownership of the stdout file descriptor. This means that it closes
stdout when it is destroyed. If there are multiple users of
raw_fd_ostream wrapped around stdout, then a crash can occur because
of operations on a closed stream.

An example of this would be running something like "clang -S -o - -MD
-MF - test.cpp". Alternatively, using outs() (which creates a local
version of raw_fd_stream to stdout) anywhere combined with such a
stream usage would cause the crash.

The fix duplicates the stdout file descriptor when used within
raw_fd_ostream, so that only that particular descriptor is closed when
the stream is destroyed.

Patch by James Henderson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 14:45:06 +00:00
Diana Picus
9ce81e13ed [ARM] GlobalISel: Support SP in regbankselect
We used to hit an unreachable in getRegBankFromRegClass when dealing with the
stack pointer. This commit adds support for the GPRsp reg class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 14:28:34 +00:00
Aaron Ballman
61d9d49df6 Reverting r297617 because it broke some bots:
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/49970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 12:24:51 +00:00
Aaron Ballman
565edc0441 Add support for getting file system permissions and implement sys::fs::permissions to set them.
Patch by James Henderson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 12:17:14 +00:00
Balaram Makam
61b914021f [AArch64] Map Sched Read/Write resources for Falkor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 10:42:17 +00:00
Gil Rapaport
710c3a271b [LV] Set memcheck metadata also for VF==1
This commit is a follow-up on r297580. It fixes the FIXME added temporarily
by that commit to keep the removal of Unroller's specialized version of
scalarizeInstruction() an NFC. See https://reviews.llvm.org/D30715 for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 10:23:46 +00:00
Sjoerd Meijer
f106d176a5 ARMDisassembler: loop over ARM decode tables
Loop over the ARM decode tables; this is a clean-up to reduce some code
duplication.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 09:41:10 +00:00
Konstantin Zhuravlyov
cc6885fb95 AMDGPU/RelocVisitor: Handle R_AMDGPU_ABS64
Test is in the separate patch.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 06:03:11 +00:00
Craig Topper
04b36a711b [AVX-512] Add EVEX2VEX test cases for the cvt instructions fixed in r297599 and r297600.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297603 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 05:47:56 +00:00
Craig Topper
760a31890d Revert "[AVX-512] EVEX2VEX, don't reject intrinsic instructions when both have a memory operand. We should just continue to check other operands instead."
This reverts r297596.

There were other issues that were making this not work that have been fixed now. Reverting this results in a more accurate table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 05:34:03 +00:00
Craig Topper
4d3597d1aa [AVX-512] Add VEX_WIG to VEX vcvtsd2ss/vcvtss2sd intrinsic instructions so they can be correctly matched by EVEX2VEX table generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 05:14:47 +00:00
Craig Topper
3fd02da39f [AVX-512] Use sse_loadf32/f64 for vcvtss2sd and vcvtsd2ss intrinsic patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297600 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 05:14:44 +00:00
Craig Topper
8f5c391837 [AVX-512] Use sse_load_f64/f32 in VCVTSS2SI/VCVTSD2SI patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 03:59:06 +00:00
Craig Topper
c68171ad8f [AVX-512] EVEX2VEX, don't reject intrinsic instructions when both have a memory operand. We should just continue to check other operands instead.
This exposed that we have several intrinsic instructions that have identical TSFlags to other instructions. We should merge their patterns and kill of the duplicate. I'll fix that in a follow up patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 00:36:49 +00:00
Craig Topper
026472f7e8 [X86] Minor formatting tweaks in EVEX to VEX tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 00:36:46 +00:00
Craig Topper
0b63a31597 [X86] Remove unused SDTypeProfile. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 23:05:03 +00:00
Craig Topper
b853c36a90 [X86] Lower SSE/AVX cmpps/pd intrinsics directly to X86ISD::CMPP SDNodes.
This allows us to remove a duplicate set of patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297593 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 23:05:00 +00:00
Craig Topper
acde888274 [AVX-512] Fix the valid immediates for the scatter/gather prefetch intrinsics.
The immediate should be 1 or 2, not 0 or 1. This was found while adding bounds checking to clang. In fact the existing clang builtin test failed if we ran it all the way to assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 22:29:12 +00:00
Sanjay Patel
cc9614d291 [x86] don't blindly transform SETB into SBB
I noticed unnecessary 'sbb' instructions in D30472 and while looking at 'ptest' codegen recently. 
This happens because we were transforming any 'setb' - even when we only wanted a single-bit result.

This patch moves those transforms under visitAdd/visitSub, so we we're only creating sbb/adc when it
is a win. I don't know why we need a SETCC_CARRY node type, but I'm not proposing to change that
existing behavior in this patch.

Also, I'm skeptical that sbb/adc are a win for all micro-arches, so I added comments to the test files
where this transform still fires.

The test changes here are all cases where we no longer produce sbb/adc. Avoiding partial register
stalls (generating an xor to clear a register) is not handled in some cases, but that's a separate
issue.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 18:28:48 +00:00
Anna Thomas
5596b4146c [LVI] Add Datalayout to the class LazyValueInfo since all its Impls require it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 14:06:41 +00:00
Azharuddin Mohammed
beaedd7463 Remove CRC32 instructions from AArch64InstrInfo::hasShiftedReg
Summary:
A53 scheduler causes an assertion failure on all CRC instructions:
include/llvm/CodeGen/MachineInstr.h:280: const llvm::MachineOperand
&llvm::MachineInstr::getOperand(unsigned int) const: Assertion `i <
getNumOperands() && "getOperand() out of range!"' failed.

The case statements corresponding to CRC instructions are incorrect and should
be removed.

Also adding a testcase while on this.

Reviewers: t.p.northover, javed.absar, apazos, rengolin

Reviewed By: rengolin

Subscribers: evandro, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 14:02:32 +00:00
Igor Breger
fbb692e572 [X86] Add vector zext tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 13:20:10 +00:00
Gil Rapaport
dd86c5c182 [LV] A unified scalarizeInstruction() for Vectorizer and Unroller; NFC
Unroller's specialized scalarizeInstruction() is mostly duplicating Vectorizer's
variant. OTOH Vectorizer's scalarizeInstruction() already supports the special
case of VF==1 except for avoiding mask-bit extraction in that case. This patch
removes Unroller's specialized version in favor of a unified method.

The only functional difference between the two variants seems to be setting
memcheck metadata for loads and stores only in Vectorizer's variant, which is a
bug in Unroller. To keep this patch an NFC the unified method doesn't set
memcheck metadata for VF==1.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 12:31:38 +00:00
Ayal Zaks
33175e7038 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297579 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 09:48:06 +00:00
Daniel Berlin
6b544010f4 Split NewGVN class into a legacy pass and an impl, instead of a merged class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 04:46:45 +00:00
Daniel Berlin
b9513eac4a Add documentation on debug counters to Programmers Manual.
Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 04:46:41 +00:00
Craig Topper
2e124a6c7c [AVX-512] Fix a bad use of a high GR8 register after copying from a mask register during fast isel. This ends up extracting from bits 15:8 instead of the lower bits of the mask.
I'm pretty sure there are more problems lurking here. But I think this fixes PR32241.

I've added the test case from that bug and added asserts that will fail if we ever try to copy between high registers and mask registers again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297574 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 03:37:37 +00:00
Craig Topper
a168e94d13 [AVX-512] Add test case for PR32241. Fix coming in another commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 03:37:34 +00:00
Craig Topper
dc5289bce8 [AVX-512] Remove unused field in X86VectorVTInfo tablegen class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 03:37:32 +00:00
Simon Pilgrim
c856889d16 [X86][SSE] Improve extraction of elements from v16i8 (pre-SSE41)
Without SSE41 (pextrb) we currently extract byte elements from a vector by spilling to stack and reloading the byte.

This patch is an initial attempt at using MOVD/PEXTRW to extract the relevant DWORD/WORD from the vector and then shift+truncate to collect the correct byte.

Extraction of multiple bytes this way would result in code bloat, but as explained in the patch we could probably afford to be more aggressive with the supported extractions before again falling back on spilling - possibly through counting the number of extracts and which DWORD/WORD they originate?

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297568 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 20:42:31 +00:00
Simon Pilgrim
b19519ea3a Remove unnecessary whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 20:23:59 +00:00
Simon Pilgrim
892d11dc78 Fix signed/unsigned comparison warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 19:38:22 +00:00
Craig Topper
39936dcadb [X86] Add avx2 gather tests cases that show a failure to remove zeroing of the source when the mask is all ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 18:26:00 +00:00
Craig Topper
912d6f2d9c [X86] Remove unnecessary commented out code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297563 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 18:25:56 +00:00