Commit Graph

129108 Commits

Author SHA1 Message Date
Justin Bogner
77531d001a Bitcode: Error out instead of crashing on corrupt metadata
I hit a crash in the bitcode reader on some corrupt input where an
MDString had somehow been attached to an instruction instead of an
MDNode. This input is pretty bogus, but we shouldn't be crashing on bad
input here.

This change adds error handling in all of the places where we
currently have unchecked casts from Metadata to MDNode, which means
we'll error out instead of crashing for that sort of input.

Unfortunately, I don't have tests. Hitting this requires flipping bits
in the input bitcode, and committing corrupt binary files to catch
these cases is a bit too opaque and unmaintainable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 20:12:06 +00:00
Tim Northover
dfee902f30 ARM: stop asserting on weird <3 x Ty> vectors in ISelLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 20:10:28 +00:00
Kostya Serebryany
bcace10c40 [libFuzzer] deprecate several flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 19:59:39 +00:00
Kostya Serebryany
227603719a [libFuzzer] add __attribute__((no_sanitize_memory)) to two functions that may be called from signal handler(s) or from msan. This will hopefully avoid msan false reports which I can't reproduce
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 19:42:35 +00:00
Michael J. Spencer
3d6e8550fd [msan fix] unitalized variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 19:16:54 +00:00
Guozhi Wei
308857f45e [InstCombine] Combine A->B->A BitCast
This patch enhances InstCombine to handle following case:

        A  ->  B    bitcast
        PHI
        B  ->  A    bitcast




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 18:47:20 +00:00
Sanjoy Das
e39be4a6ca [Statepoints] Export a magic constant into a header; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 18:42:17 +00:00
Filipe Cabecinhas
e2a5365d55 [lit] Enqueue tests on a separate thread to not hit limits on parallel queues
Summary:
The multiprocessing.Queue.put() call can hang if we try queueing all the
tests before starting to take them out of the queue.
The current implementation hangs if tests exceed 2^^15, on Mac OS X.
This might happen with a ninja check-all if one has a bunch of llvm
projects.

Reviewers: delcypher, bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 18:27:33 +00:00
Valery Pykhtin
562564f42b [AMDGPU] add VI disassembler tests. NFC.
Autogenerated from the corresponding assembler tests with a few FIXME added (will fix soon).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 17:56:33 +00:00
Petar Jovanovic
cd74bb6415 [PowerPC] Disable CTR loops optimization for soft float operations
This patch prevents CTR loops optimization when using soft float operations
inside loop body. Soft float operations use function calls, but function
calls are not allowed inside CTR optimized loops.

Patch by Aleksandar Beserminji.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 17:11:33 +00:00
Derek Schuff
3d15212029 [WebAssembly] Stackify code emitted by eliminateFrameIndex and SP writeback
Summary:
MRI::eliminateFrameIndex can emit several instructions to do address
calculations; these can usually be stackified. Because instructions with
FI operands can have subsequent operands which may be expression trees,
find the top of the leftmost tree and insert the code before it, to keep
the LIFO property.

Also use stackified registers when writing back the SP value to memory
in the epilog; it's unnecessary because SP will not be used after the
epilog, and it results in better code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 17:00:29 +00:00
David Majnemer
30abf16d67 [COFF] Refactor section alignment calculation
Section alignment isn't completely trivial, let it live in one place so
that we may reuse it in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 16:55:18 +00:00
David Majnemer
5b6b93117d Forgot to commit this with r263692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 16:55:11 +00:00
Changpeng Fang
6405fe8e88 AMDGPU/SI: Do not generate s_waitcnt after ds_permute/ds_bpermute
Symmary:
  ds_permute/ds_bpermute do not read memory so s_waitcnt is not needed.

Reviewers
  arsenm, tstellarAMD

Subscribers
  llvm-commits, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 16:43:50 +00:00
Nicolai Haehnle
d3939c80f8 AMDGPU: mark atomic instructions as sources of divergence
Summary:
As explained by the comment, threads will typically see different values
returned by atomic instructions even if the arguments are equal.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 16:21:59 +00:00
Simon Pilgrim
96ac27b20b [X86][SSE] Simplified blend-with-zero combining
We were being too aggressive in trying to combine a shuffle into a blend-with-zero pattern, often resulting in a endless loop of contrasting combines

This patch stops the combine if we already have a blend in place (means we miss some domain corrections)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 15:59:36 +00:00
Sanjay Patel
1956ff6e28 propagate 'unpredictable' metadata on select instructions
This is similar to D18133 where we allowed profile weights on select instructions. 
This extends that change to also allow the 'unpredictable' attribute of branches to apply to selects.

A test to check that 'unpredictable' metadata is preserved when cloning instructions was checked in at:
http://reviews.llvm.org/rL263648

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 15:30:52 +00:00
Saleem Abdulrasool
a944db98cd ARM: Revert SVN r253865, 254158, fix windows division
The two changes together weakened the test and caused a regression with division
handling in MSVC mode.  They were applied to avoid an assertion being triggered
in the block frequency analysis.  However, the underlying problem was simply
being masked rather than solved properly.  Address the actual underlying problem
and revert the changes.  Rather than analyze the cause of the assertion, the
division failure was assumed to be an overflow.

The underlying issue was a subtle bug in the BB construction in the emission of
the div-by-zero check (WIN__DBZCHK).  We did not construct the proper successor
information in the basic blocks, nor did we update the PHIs associated with the
basic block when we split them.  This would result in assertions being triggered
in the block frequency analysis pass.

Although the original tests are being removed, the tests themselves performed
very little in terms of validation but merely tested that we did not assert when
generating code.  Update this with new tests that actually ensure that we do not
regress on the code generation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 14:10:49 +00:00
Simon Atanasyan
d79846fd6b [llvm-objdump] Add REQUIRES x86 directive to fix buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 11:09:21 +00:00
Simon Atanasyan
bfc21a3426 [llvm-objdump] Add '0x' prefix to a target displacement number to accent its hex format
It might be hard to recognize a hexadecimal number without '0x' prefix.
Besides that '0x' prefix corresponds to GNU objdump behaviour.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:43:44 +00:00
Simon Atanasyan
b23379e537 [mips] Use formatImm call to print immediate value in the MipsInstPrinter
That allows, for example, to print hex-formatted immediates using
llvm-objdump --print-imm-hex command line option.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263704 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:43:36 +00:00
Scott Egerton
afc05c9eb7 [mips] Eliminate instances of "potentially uninitialised local variable" warnings, NFC
Summary:
This should eliminate all occurrences of this within LLVMMipsAsmParser.
This patch is in response to http://reviews.llvm.org/D17983. I was unable
to reproduce the warnings on my machine so please advise if this fixes the
warnings.

Reviewers: ariccio, vkalintiris, dsanders

Subscribers: dblaikie, dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:37:51 +00:00
Wilfred Hughes
0a1bf1d197 Remove obselete reference to TypeResolve from the tutorial.
TypeResolve went away in r134829 in 2011.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:20:58 +00:00
Wilfred Hughes
656df231ed Minor grammar fix in kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:18:13 +00:00
Wilfred Hughes
c2e48fb33a Further typo fixes in kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 09:26:45 +00:00
Wilfred Hughes
a66f9eb55e Fix typo in kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 09:09:07 +00:00
David Majnemer
ba0d0e1663 [yaml2obj, COFF] Correctly handle section alignment
The section alignment field was marked optional but not provided a
default value: initialize it with 0.

While we are here, ensure that the section alignment is plausible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 05:43:26 +00:00
Sanjoy Das
d3bfdecbc0 [Statepoints] Separate out logic for statepoint directives; NFC
This splits out the logic that maps the `"statepoint-id"` attribute into
the actual statepoint ID, and the `"statepoint-num-patch-bytes"`
attribute into the number of patchable bytes the statpeoint is lowered
into.  The new home of this logic is in IR/Statepoint.cpp, and this
refactoring will support similar functionality when lowering calls with
deopt operand bundles in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 01:56:10 +00:00
Sanjoy Das
379dd854aa [Statepoint] Remove unused header; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 01:15:27 +00:00
Sanjoy Das
6222133afc [Statepoints] Minor NFC cleanups
Mostly code simplifcations, and bringing up IR/Statepoints.cpp up to
LLVM coding style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 00:47:18 +00:00
Sanjoy Das
d8f413be52 [SelectionDAG] Remove visitStatepoint; NFC
This way we have a single entry point into StatepointLowering.  The
method was a direct dispatch to LowerStatepoint anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 00:47:14 +00:00
Pete Cooper
3fc5a0caea Require allocator parameter to YAML traits.
The allocator here can still be a nullptr, but this atleast makes the
single caller which needed nullptr be explicit about it.

Note, lld started always passing a parameter here as of r263680.  If
anything builds out of sync, that would be why errors may occur.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 00:34:54 +00:00
Sanjay Patel
d2562e1c7a use FileCheck for tighter checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263679 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:39:37 +00:00
Pete Cooper
343087695c Add optional allocator to YAML code to avoid leaking lld atoms.
In lld we allocate atoms on an allocator and so don't run their
destructors.  This means we also shouldn't allocate memory inside
them without that also being on an allocator.

Reviewed by Lang Hames and Rafael Espindola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:29:31 +00:00
Sanjay Patel
a201b07c07 reduce check strings; no need to check IR comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:22:01 +00:00
Sanjay Patel
74ecf5aca9 use FileCheck for tighter checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:20:20 +00:00
Chris Bieneman
f3dfbbff41 Upgrade TBAA *before* upgrading intrinsics
Summary: If TBAA is on an intrinsic and it gets upgraded and drops the TBAA we hit an odd assert. We should just upgrade the TBAA first because it doesn't have side-effects.

Reviewers: reames, apilipenko, manmanren

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263673 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:17:54 +00:00
Sanjoy Das
94e3841aa9 Fix indentation; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:11:21 +00:00
Sanjoy Das
7eb2f0d9b5 Extract out a SelectionDAGBuilder::LowerAsStatepoint; NFC
Summary:
This is a step towards implementing "direct" lowering of calls and
invokes with deopt operand bundles into STATEPOINT nodes (as opposed to
having them mandatorily pass through RewriteStatepointsForGC, which is
the case today).

This change extracts out a `SelectionDAGBuilder::LowerAsStatepoint`
helper function that is able to lower a "statepoint like thing", and
uses it to lower `gc.statepoint` calls.  This is an NFC now, but in a
later change we will use `LowerAsStatepoint` to directly lower calls and
invokes with operand bundles without going through an intermediate
`gc.statepoint` IR representation.

FYI: I expect `SelectionDAGBuilder::StatepointInfo` will evolve as I add
support for lowering non gc.statepoints, right now it is fairly tightly
coupled with an IR level `gc.statepoint`.

Reviewers: reames, pgavlin, JosephTremoulet

Subscribers: sanjoy, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 23:08:00 +00:00
Sanjay Patel
b851d8a30e use FileCheck for tighter checking
I'm testing out a script that auto-generates the check lines.
It's 98% copied from utils/update_llc_test_checks.py.
If others think this is useful, please let me know.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263668 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 22:34:57 +00:00
Sanjay Patel
d892ed89d1 use FileCheck for tighter checking
I'm testing out a script that auto-generates the check lines.
It's 98% copied from utils/update_llc_test_checks.py.
If others think this is useful, please let me know.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 22:29:07 +00:00
Xinliang David Li
082ab5fb03 Variable name cleanup /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 22:13:41 +00:00
James Y Knight
ceb61bf42f Tweak some atomics functions in preparation for larger changes; NFC.
- Rename getATOMIC to getSYNC, as llvm will soon be able to emit both
  '__sync' libcalls and '__atomic' libcalls, and this function is for
  the '__sync' ones.

- getInsertFencesForAtomic() has been replaced with
  shouldInsertFencesForAtomic(Instruction), so that the decision can be
  made per-instruction. This functionality will be used soon.

- emitLeadingFence/emitTrailingFence are no longer called if
  shouldInsertFencesForAtomic returns false, and thus don't need to
  check the condition themselves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 22:12:04 +00:00
Sanjoy Das
3ca6eb94e8 [SelectionDAG] Extract out populateCallLoweringInfo; NFC
SelectionDAGBuilder::populateCallLoweringInfo is now used instead of
SelectionDAGBuilder::lowerCallOperands.  The populateCallLoweringInfo
interface is more composable in face of design changes like
http://reviews.llvm.org/D18106

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 20:49:31 +00:00
Vedant Kumar
4e25daf577 [ProfileData] Make a utility method public, NFC
The swift frontend needs to be able to look up PGO function name
variables based on the original raw function name. That's because it's
not possible to create PGO function name variables while emitting swift
IR. Instead, we have to create the name variables while lowering swift
IR to llvm IR, at which point we fix up all calls to the increment
intrinsic to point to the right name variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 20:49:26 +00:00
Nicolai Haehnle
d22ce50fea AMDGPU: Prevent uniform loops from becoming infinite
Summary:
Uniform loops where the branch leaving the loop is predicated on VCCNZ
must be skipped if EXEC = 0, otherwise they will be infinite.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 20:14:33 +00:00
Colin LeMahieu
f0ac61f720 [Hexagon] Adding missing break in switch statement. Extra operands would have been appended to the end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 20:00:38 +00:00
Chad Rosier
0c81766bcd [SLP] Make DataLayout a member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 19:48:42 +00:00
Geoff Berry
6350742547 Revert "[LSR] Create fewer redundant instructions."
This reverts commit r263644.  Investigating bootstrap failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 19:21:47 +00:00
Simon Pilgrim
60dd24fdc0 Removed trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 18:37:44 +00:00