Commit Graph

135141 Commits

Author SHA1 Message Date
Vedant Kumar
343b2711ec [llvm-cov] Fix a use-after-free
Taking a lock before appending to a vector does no good unless threads
reading from the vector also take the lock, because the vector could be
re-sized.

I don't have a good isolated test for this. I found the issue with ASan
while testing a large project.  I'm working on a bot that does this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 01:19:36 +00:00
Vedant Kumar
b9d9ab2c32 [llvm-cov] Clean up an awkward capture-by-reference (NFC)
Writing `for (StringRef &SourceFile : ...)` is strange to begin with.
Subsequently capturing "SourceFile" by reference is even stranger. Just
copy the StringRef, since that's cheap to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 01:19:35 +00:00
Vedant Kumar
7b18a76385 [Coverage] Mark a few more methods const (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 01:19:33 +00:00
Matt Arsenault
beff7fe056 AMDGPU: Fix not expanding control flow after some kill blocks
Also stop trying to insert skip blocks at end_cf. This
was inserting them at the end of the block which doesn't make
sense. The skip should be inserted at the beginning of the block
right after the end cf. Just remove this for now since no tests
seem to stress this and I think this can be handled more generally
later.

Fixes bug 28550

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 00:58:15 +00:00
Matt Arsenault
011dcf3d90 AMDGPU: Fix trying to skip from a block with no successors
Found while reducing bug 28550

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 00:58:13 +00:00
Matt Arsenault
435a4467a3 AMDGPU: Fix splitting kill blocks with defs before kill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 00:58:09 +00:00
Haicheng Wu
f7f8380105 [AArch64] Set COPY ZR isAsCheapAsAMove when needed.
If a subtarget has both ZCZeroing and CustomCheapAsMoveHandling features (now
only Kryo has both), set COPY (W|X)ZR isAsCheapAsAMove.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 00:27:01 +00:00
Reid Kleckner
c61d5f4b2c [codeview] Shrink inlined call site line info tables
For a fully inlined call chain like a -> b -> c -> d, we were emitting
line info for 'd' 3 separate times: once for d's actual InlineSite line
table, and twice for 'b' and 'c'. This is particularly inefficient when
all these functions are in different headers, because now we need to
encode the file change. Windbg was coping with our suboptimal output, so
this should not be noticeable from the debugger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 23:47:15 +00:00
Tim Northover
520a6ed0f1 llvm-objdump: extend __mh_execute_header handling to other special syms
We don't need to print any of the special __mh_*_header symbols when
disassembling. Since they point at the beginning of the segment (not where the
actual code is) they're pretty misleading.

Should also fix lld bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 23:13:03 +00:00
Simon Pilgrim
db8566250f [X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle (reapplied)
This improves the situation discussed in D19228 where we were forcing VPERMPD/VPERMQ where VPERM2F128/VPERM2I128 would have been better.

This was incorrectly reverted in rL275421 during triage of PR28552.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 23:05:09 +00:00
Adam Nemet
81a5520fe8 [LoopDist] Fix typo in diagnostic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 22:33:46 +00:00
Tim Northover
323f7893f4 llvm-objdump: handle stubbed and malformed dylibs better
We were quite happy to read past the end of the valid section data when
disassembling. Instead we entirely skip stub dylibs, and tell the user what's
happened if their section only has partial data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 22:13:32 +00:00
Ekaterina Romanova
9c524094cf [GVN] Fold constant expression in GVN.
Fix for PR 28418.

opt never finishes compiling a test when -gvn option is passed.
The problem is caused by the fact that GVN fails to fold a constant expression.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 22:02:25 +00:00
Peter Collingbourne
ef2acb50d0 Move legacy LTO interface headers to legacy/ directory.
Differential Revision: https://reviews.llvm.org/D22173

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 21:21:16 +00:00
Teresa Johnson
b0786ec025 [ThinLTO/gold] Perform index-based weak/linkonce resolution
Summary:
Invoke the weak/linkonce symbol resolution support (already used by
libLTO) that operates via the summary index.

This ensures prevailing linkonce are kept, by making them weak, and
marks preempted copies as available_externally when possible.

With this change, the older support for keeping the prevailing linkonce
(by changing their symbol resolution) is removed.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 21:13:24 +00:00
Matthew Simpson
d69942c12d [LV] Rename StrideAccesses to AccessStrideInfo (NFC)
We now collect all accesses with a constant stride, not just the ones with a
stride greater than one. This change was requested in the review of D19984.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 21:05:08 +00:00
Matthew Simpson
843f7ad617 [LV] Allow interleaved accesses in loops with predicated blocks
This patch allows the formation of interleaved access groups in loops
containing predicated blocks. However, the predicated accesses are prevented
from forming groups.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:59:47 +00:00
Sanjay Patel
2fa0c5869c don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:54:43 +00:00
Lang Hames
36105c0dde [Object] Change Archive::findSym to return an Expected<Optional<Child>>.
As suggested by Rafael in review of D22079 - this was accidentally left out of
the final commit (r275316).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:44:27 +00:00
Davide Italiano
f3702b696c [SCCP] Pass the Solver by reference, copies are expensive ...
.. enough to cause LTO compile time to regress insanely.
Thanks *a lot* to Rafael for reporting the problem and testing
the fix!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:25:54 +00:00
Mehdi Amini
a43274d789 Add recently added TargetOptions::EnableIPRA member to operator==
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:22:13 +00:00
Sanjoy Das
f5f726b224 [ValueTracking] Use Instruction::getFunction; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:19:01 +00:00
Justin Lebar
d1a73a00b2 s/constexpr/LLVM_CONSTEXPR in AArch64InstrInfo.cpp.
Yet again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 20:08:23 +00:00
Krzysztof Parzyszek
1a360b3be9 [Hexagon] Packetize function call arguments with tail call instructions
On Hexagon is it legal to packetize the instructions setting up call
arguments with the call instruction itself. This was already done,
except for tail calls. Make sure tail calls are handled as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 19:30:55 +00:00
Evandro Menezes
7846f45617 [AArch64] Adjust the scheduling model for Exynos-M1.
Enable use-postra-scheduler. (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 19:25:46 +00:00
Sanjoy Das
c87d751c1e [JumpThreading] PRE unordered loads
Summary: Extend JumpThreading's PRE to unordered atomic loads.

Reviewers: hfinkel, reames

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 19:21:15 +00:00
Krzysztof Parzyszek
8bd1db4d74 Add debugging code to the packetizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 19:04:26 +00:00
Jun Bum Lim
fa907d312a [PM] Port Dead Loop Deletion Pass to the new PM
Summary: Port Dead Loop Deletion Pass to the new pass manager.

Reviewers: silvas, davide

Subscribers: llvm-commits, sanjoy, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 18:28:29 +00:00
Justin Lebar
d4faf8fe43 [CodeGen] Refactor MachineMemOperand::Flags's target-specific flags.
Summary:
Make the target-specific flags in MachineMemOperand::Flags real, bona
fide enum values.  This simplifies users, prevents various constants
from going out of sync, and avoids the false sense of security provided
by declaring static members in classes and then forgetting to define
them inside of cpp files.

Reviewers: MatzeB

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 18:15:20 +00:00
Justin Bogner
505d1e7a4f TableGen: Fix a confusing use of both i and I as variables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 18:08:33 +00:00
Kostya Serebryany
ec8a2f2059 [sanitizer-coverage] make sure that calls to __sanitizer_cov_trace_pc are not merged (otherwise different calls get the same PC and confuse fuzzers)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:59:01 +00:00
Nirav Dave
99b3da61b0 [X86][MC] Fix bracket expression parsing in intel-style assembly.
Only perform struct field check on Identifier tokens.

Fixes PR28547.

Reviewers: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:37:05 +00:00
Ahmed Bougacha
e9edae4b2d [GlobalISel] Fix G_OR opcode after the addition of a TargetOpcode.
r275367 fixed G_ADD and G_BR, but not G_OR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:29:49 +00:00
Ahmed Bougacha
3ce051383c [CodeGen] Simplify reg bank/class union is+get into dyn_cast. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:29:46 +00:00
Saleem Abdulrasool
4d45f1ed0d X86: handle external tail calls in Windows JIT
If there was a tail call, we would incorrectly handle the relocation.  It would
end up indexing into the array with an incorrect section id.  The symbol was
external to the module, so the Section ID was UNDEFINED (-1).  We would then
index the SmallVector with this ID, triggering an assertion.  Use the Value
rather than the section load address in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:27:06 +00:00
Justin Lebar
3eef3988f6 [CodeGen] s/constexpr/LLVM_CONSTEXPR/ in MachineMemOperand.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:16:40 +00:00
Sanjay Patel
e53b5c23a2 auto-generate checks
Note: I removed the checks after each jump because that's noise, but we apparently 
need branches rather than returning i1 to see the bt codegen in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:07:55 +00:00
Justin Lebar
f66cee6be5 [CodeGen] Refactor MachineMemOperand's Flags enum.
Summary:
- Give it a shorter name (because we're going to refer to it often from
  SelectionDAG and friends).

- Split the flags and alignment into separate variables.

- Specialize FlagsEnumTraits for it, so we can do bitwise ops on it
  without losing type information.

- Make some enum values constants in MachineMemOperand instead.
  MOMaxBits should not be a valid Flag.

- Simplify some of the bitwise ops for dealing with Flags.

Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:07:44 +00:00
Tim Northover
5591e3d51d ARM: fix vmov.i64 immediate validity check
Typo meant we were only checking the low byte (repeatedly).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:04:34 +00:00
Tom Stellard
6e4b75df4f GlobalsAA: Functions with the argmemonly attribute won't read arbitrary globals
Summary:
In preparation for changing GlobalsAA to stop assuming that intrinsics
can't read arbitrary globals, we need to make sure GlobalsAA is querying
function attributes rather than relying on this assumption.

This patch was inspired by: http://reviews.llvm.org/D20206

Reviewers: jmolloy, hfinkel

Subscribers: eli.friedman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 15:50:27 +00:00
Nico Weber
3d6b13fb1d Don't optimize movs to pushes in -O0 builds.
https://reviews.llvm.org/D22362


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 15:40:22 +00:00
Nico Weber
b19f420c44 Delete some trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 15:07:44 +00:00
Ahmed Bougacha
6a16f1b7e6 [X86] Decode MPX BND registers.
We were able to assemble, but not disassemble.

Note that fixupRMValue was truncating EA_REG_BND0-3 because we hit
the uint8_t max.  The control registers were already squarely above
it, but I don't think they ever go in .r/m, only in .reg.

I also did notice an extra REX.W in our encoding, but I think that's
fine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:21 +00:00
Ahmed Bougacha
1ac61e2861 [X86] Don't mark addressing mode operands as "outs". NFC-ish.
Nothing in-tree can tell the difference, but it's incorrect: the
addressing mode registers aren't what's defined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:17 +00:00
Ahmed Bougacha
27cc0cc039 [TableGen] Autobrief-ize Record. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:14 +00:00
Ahmed Bougacha
cf03606efc [TableGen] Cleanup Record comments. NFC.
LLVM doesn't use exceptions anymore.
Also remove the implementation comments. Some of them diverged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:11 +00:00
Ahmed Bougacha
8b8511816c [GlobalISel] Fix #include ordering/spacing. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:52:55 +00:00
Sam Kolton
1c8103698f [AMDGPU] Assembler: fix row_bcast parsing
Summary: This change fix bug 28538

Reviewers: tstellarAMD, vpykhtin

Subscribers: arsenm, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:50:35 +00:00
Nico Weber
e76c5af435 Revert r275411, it cause PR28552.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:49:35 +00:00
Nico Weber
037f8a7c73 Revert r275401, it caused PR28551.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:41:25 +00:00