Commit Graph

141634 Commits

Author SHA1 Message Date
Paul Robinson
b31b2ecb10 Revert r288212 due to lldb failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 23:20:35 +00:00
Jacques Pienaar
65c488a748 [lanai] Manually match 0/-1 with R0/R1.
Summary: Previously 0 and -1 was matched via tablegen rules. But this could cause problems where a physical register was being used where a virtual register was expected (seen in optimizeSelect and TwoAddressInstructionPass). Instead follow AArch64 and match in DAGToDAGISel.

Reviewers: eliben, majnemer

Subscribers: llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 23:01:09 +00:00
Nemanja Ivanovic
0b07a5ae00 Revert https://reviews.llvm.org/rL287679
This commit caused some miscompiles that did not show up on any of the bots.
Reverting until we can investigate the cause of those failures.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 23:00:33 +00:00
Paul Robinson
f1f1223546 Emit 'no line' information for interesting 'orphan' instructions.
DWARF specifies that "line 0" really means "no appropriate source
location" in the line table.  Use this for branch targets and some
other cases that have no specified source location, to prevent
inheriting unfortunate line numbers from physically preceding
instructions (which might be from completely unrelated source).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:41:16 +00:00
Simon Pilgrim
68d9b14b39 [X86][AVX512VL] Improved testing of vcvtpd2ps, vcvtpd2dq/vcvtpd2udq and vcvttpd2dq/vcvttpd2udq implicit zeroing of upper 64-bits of xmm result
Ensure that masked instruction doesn't assume implicit zeroing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:38:30 +00:00
Adam Nemet
ae45a93f50 [GVN] Basic optimization remark support
[recommiting patches one-by-one to see which breaks the stage2 LTO bot]

Follow-on patches will add more interesting cases.

The goal of this patch-set is to get the GVN messages printed in
opt-viewer from Dhrystone as was presented in my Dev Meeting talk.  This
is the optimization view for the function (the last remark in the
function has a bug which is fixed in this series):
http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L430

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288210 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:37:01 +00:00
Simon Pilgrim
f09dc03ed5 [X86][AVX512DQVL] Improved testing of vcvtqq2ps/vcvtuqq2ps implicit zeroing of upper 64-bits of xmm result
Ensure that masked instruction doesn't assume implicit zeroing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:36:28 +00:00
Sanjay Patel
f4d1201a27 [AArch64] allow and-not-compare transform to form 'bics'
This target hook was added with D19087:
https://reviews.llvm.org/D19087

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:28:58 +00:00
Zachary Turner
29916a15c8 Add documentation for the PDB Module Info stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:14:56 +00:00
Peter Collingbourne
10e4110233 Bitcode: Add a more comprehensive multi-module test now that we have both llvm-cat and llvm-modextract.
Differential Revision: https://reviews.llvm.org/D27189

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 21:55:09 +00:00
Peter Collingbourne
c67ca17e5e Add llvm-modextract tool.
This program is for testing features that rely on multi-module bitcode files.
It takes a multi-module bitcode file, extracts one of the modules and writes
it to the output file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 21:54:33 +00:00
Justin Lebar
649bcb99b4 [StructurizeCFG] Fix infinite loop in rebuildSSA.
Michel Dänzer reported that r288051, "[StructurizeCFG] Use range-based
for loops", introduced a bug into rebuildSSA, wherein we were iterating
over an instruction's use list while modifying it, without taking care
to do this correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 21:49:02 +00:00
Kevin Enderby
dc150d07a5 Add to llvm-objdump the -no-leading-headers option with the use of the -macho option.
In some cases the leading headers of the file name, archive member and
architecture slice name in the output of lvm-objdump is not wanted so the
tool’s output can be directly used by scripts.  This matches the -X option
of the Apple otool(1) program.

rdar://28491674


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 21:43:40 +00:00
Peter Collingbourne
2a4cea29fc Add missing dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 21:02:19 +00:00
Mehdi Amini
fa5f3d188d Change Error unittest to use the LLVM_ENABLE_ABI_BREAKING_CHECKS instead of NDEBUG
This is consistent with the header (after r288087) and fixes the
test for the configuration:
  -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 20:45:48 +00:00
Peter Collingbourne
e6480e2add Bitcode: Introduce BitcodeWriter interface.
This interface allows clients to write multiple modules to a single
bitcode file. Also introduce the llvm-cat utility which can be used
to create a bitcode file containing multiple modules.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 20:43:47 +00:00
Chad Rosier
c83371f0eb [AArch64] Add a basic SchedMachineModel for Falkor.
Differential Revision: https://reviews.llvm.org/D26972

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 20:00:27 +00:00
David Blaikie
375d719e55 Use CallSite to simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:42:27 +00:00
Matt Arsenault
a55fccbc47 AMDGPU: Disallow exec as SMEM instruction operand
This is not in the list of valid inputs for the encoding.
When spilling, copies from exec can be folded directly
into the spill instruction which results in broken
stores.

This only fixes the operand constraints, more codegen
work is required to avoid emitting the invalid
spills.

This sort of breaks the dbg.value test. Because the
register class of the s_load_dwordx2 changes, there
is a copy to SReg_64, and the copy is the operand
of dbg_value. The copy is later dead, and removed
from the dbg_value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:39:53 +00:00
Matt Arsenault
c562d96ea6 AMDGPU: Use SGPR_64 for argument lowerings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:39:48 +00:00
Geoff Berry
81e1a9d383 [LiveRangeEdit] Handle instructions with no defs correctly.
Summary:
The code in LiveRangeEdit::eliminateDeadDef() that computes isOrigDef
doesn't handle instructions in which operand 0 is not a def (e.g. KILL)
correctly.  Add a check that operand 0 is a def before doing the rest of
the isOrigDef computation.

Reviewers: qcolombet, MatzeB, wmi

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:31:35 +00:00
Matt Arsenault
a89dd1d1c4 AMDGPU: Rename flat operands to match mubuf
Use vaddr/vdst for the same purposes.

This also fixes a beg in SIInsertWaits for the
operand check. The stored value operand is currently called
data0 in the single offset case, not data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:30:44 +00:00
Matt Arsenault
3f3671600c AMDGPU: Use else if
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:30:41 +00:00
Matt Arsenault
8d2aadbfac AMDGPU: Materialize frame index before add
It isn't generally safe to fold the frame index
directly into the operand since it will possibly
not be an inline immediate after it is expanded.

This surprisingly seems to produce better code, since
the FI doesn't prevent folding other immediate operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:20:48 +00:00
Matt Arsenault
a333ef5119 AMDGPU: Refactor immediate folding logic
Change the logic for when to fold immediates to
consider the destination operand rather than the
source of the materializing mov instruction.

No change yet, but this will allow for correctly handling
i16/f16 operands. Since 32-bit moves are used to materialize
constants for these, the same bitvalue will not be in the
register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:20:42 +00:00
Sanjay Patel
57d4f76dcd [AArch64] add tests for bics; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 19:15:27 +00:00
Sanjay Patel
9ade85fb43 [AArch64] add tests to show select transforms; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:35:04 +00:00
Adam Nemet
f618d6ef67 Revert "[GVN] Basic optimization remark support"
This reverts commit r288046.

Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:32:04 +00:00
Adam Nemet
5d693faf41 Revert "[GVN, OptDiag] Include the value that is forwarded in load elimination"
This reverts commit r288047.

Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:32:00 +00:00
Adam Nemet
996fdfddd0 Revert "[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination"
This reverts commit r288090.

Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:31:53 +00:00
Geoff Berry
ba3cf58b60 [AArch64] Fold spills of COPY of WZR/XZR
Summary:
In AArch64InstrInfo::foldMemoryOperandImpl, catch more cases where the
COPY being spilled is copying from WZR/XZR, but the source register is
not in the COPY destination register's regclass.

For example, when spilling:

  %vreg0 = COPY %XZR ; %vreg0:GPR64common

without this change, the code in TargetInstrInfo::foldMemoryOperand()
and canFoldCopy() that normally handles cases like this would fail to
optimize since %XZR is not in GPR64common.  So the spill code generated
would be:

  %vreg0 = COPY %XZR
  STR %vreg

instead of the new code generated:

  STR %XZR

Reviewers: qcolombet, MatzeB

Subscribers: mcrosier, aemerson, t.p.northover, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:28:32 +00:00
Mehdi Amini
c72d18a2cb [docs] Typos and whitespace fixed in LTO docs.
While reading the LTO docs I fixed few small typos and whitespace issues.

Patch by: Jonas Devlieghere <jonas@devlieghere.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:00:31 +00:00
Simon Pilgrim
e148f0a7b8 Avoid repeated calls to MVT getSizeInBits and getScalarSizeInBits(). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 17:57:48 +00:00
NAKAMURA Takumi
e6dbf90240 Suppress abi-breaking.h on cygming, for now.
FIXME: Implement checks without weak for them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 17:32:58 +00:00
NAKAMURA Takumi
f33188e05e Fix a linefeed at eof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 17:32:43 +00:00
Artur Pilipenko
9d387d6693 [CVP] Remove use of removed flag (-cvp-dont-process-adds) from the test
The flag was removed by 288154

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:43:30 +00:00
Artur Pilipenko
a310ebcb97 [CVP] Remove cvp-dont-process-adds flag
The flag was introduced because the optimization controlled by the flag initially caused regressions. All the regressions were fixed some time ago and the flag has been false for quite a while. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:24:57 +00:00
Nemanja Ivanovic
1ec5b2fb75 [PowerPC] Improvements for BUILD_VECTOR Vol. 1
This patch corresponds to review:
https://reviews.llvm.org/D25912

This is the first patch in a series of 4 that improve the lowering and combining
for BUILD_VECTOR nodes on PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:11:34 +00:00
Alexey Bataev
e58c265916 [SLP] Add a new test for tree vectorization starting from insertelement
instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 15:37:52 +00:00
Simon Pilgrim
341c07ba83 [X86] Moved getTargetConstantFromNode function so a future patch is more understandable. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 15:32:58 +00:00
Aditya Kumar
b67e91ee50 [GVNHoist] Rename variables.
Differential Revision: https://reviews.llvm.org/D27110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 14:36:27 +00:00
Aditya Kumar
06f75183e3 [GVNHoist] Enable aggressive hoisting when optimizing for code-size
Enable scalar hoisting at -Oz as it is safe to hoist scalars to a place
where they are partially needed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 14:34:01 +00:00
Simon Pilgrim
bdcd71da4d [X86][SSE] Add initial support for combining target shuffles to (V)PMOVZX.
We can only handle 128-bit vectors until we support target shuffle inputs of different size to the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 14:18:51 +00:00
Simon Pilgrim
c02671cd35 Avoid repeated calls to MVT::getScalarSizeInBits(). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 13:43:08 +00:00
Simon Pilgrim
f4ee49f32f [X86][SSE] Added tests showing missed combines to (V)PMOVZX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 13:16:11 +00:00
Chandler Carruth
e1b9ddfe20 [PM] Fix a bad invalid densemap iterator bug in the new invalidation
logic.

Yup, the invalidation logic has an invalid iterator bug. Can't make this
stuff up.

We can recursively insert things into the map so we can't cache the
iterator into that map across those recursive calls. We did this
differently in two places. I have an end-to-end test that triggers at
least one of them. I'm going to work on a nice minimal test case that
triggers these, but I didn't want to leave the bug in the tree while
I tried to trigger it.

Also, the dense map iterator checking stuff we have now is awesome. =D

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 12:54:34 +00:00
Malcolm Parsons
15bd6737cf [StringRef] Use default member initializers and = default.
Summary: This makes the default constructor implicitly constexpr and noexcept.

Reviewers: zturner, beanz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 10:53:18 +00:00
Alexey Bataev
62c10d6781 [SLPVectorizer] Improved support of partial tree vectorization.
Currently SLP vectorizer tries to vectorize a binary operation and dies
immediately after unsuccessful the first unsuccessfull attempt. Patch
tries to improve the situation, trying to vectorize all binary
operations of all children nodes in the binop tree.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 08:21:14 +00:00
Warren Ristow
14cd31679b Test commit. Comment changes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288100 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 02:37:13 +00:00
Peter Collingbourne
a0894a8257 Bitcode: Change expected layout of module blocks.
We now expect each module's identification block to appear immediately before
the module block. Any module block that appears without an identification block
immediately before it is interpreted as if it does not have a module block.

Also change the interpretation of VST and function offsets in bitcode.
The offset is always taken as relative to the start of the identification
(or module if not present) block, minus one word. This corresponds to the
historical interpretation of offsets, i.e. relative to the start of the file.

These changes allow for bitcode modules to be concatenated by copying bytes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 02:27:04 +00:00