Commit Graph

126751 Commits

Author SHA1 Message Date
Craig Topper
aed38efd95 [TableGen] In AsmWriterEmitter unique command search, rather than storing a mapping from instruction to unique command, instead store a list of which instructions each unique command corresponds to.
This simplifies the complexity of the code that tries to find further operands to merge into the unique command.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-24 07:13:28 +00:00
David Majnemer
f79a93da00 Fix buildbot failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-24 06:40:37 +00:00
David Majnemer
2f0346603d [SCCP] Remove duplicate code
SCCP has code identical to changeToUnreachable's behavior, switch it
over to just call changeToUnreachable.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-24 06:26:47 +00:00
David Majnemer
6b7f46e721 [InstCombine, SCCP] Consolidate code used to remove instructions
InstCombine and SCCP both want to remove dead code in a very particular
way but using identical means to do so.  Share the code between the two.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-24 05:26:18 +00:00
David Majnemer
50a24fa5b1 [WinEH] Don't miscompile cleanups which conditionally unwind to caller
A cleanup can have paths which unwind or end up in unreachable.
If there is an unreachable path *and* a path which unwinds to caller,
we would mistakenly inject an unwind path to a catchswitch on the
unreachable path.  This results in a verifier assertion firing because
the cleanup unwinds to two different places: to the caller and to the
catchswitch.

This occured because we used getCleanupRetUnwindDest to determine if the
cleanuppad had no cleanuprets.
This is incorrect, getCleanupRetUnwindDest returns null for cleanuprets
which unwind to caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258651 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 23:54:33 +00:00
Manuel Jacob
df6fe8fd26 Remove duplicate documentation in ConstantFolding.cpp. NFC.
The documentation for these functions is already present in the header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258649 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 22:49:54 +00:00
Manuel Jacob
2d0376c55d Remove duplicate documentation in Attributes.cpp. NFC.
The documentation for these methods is already present in the header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 22:42:24 +00:00
Manuel Jacob
0bed86eaa2 Update outdated method documention in Attributes.h. NFC.
Nowadays the alignment attribute is not the only integer attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258647 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 22:38:39 +00:00
Simon Pilgrim
6130726074 [SelectionDAG] Generalised the CONCAT_VECTORS creation to support BUILD_VECTOR and UNDEF folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 22:27:54 +00:00
Simon Pilgrim
228d587153 [X86][SSE] Generalised TRUNC -> PACKSS/PACKUS code. NFC.
Generalised mask generation / subvector extraction to use the input/output types directly instead of an if/else through all the currently accepted types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 22:02:48 +00:00
Simon Pilgrim
2a554ce9c0 Tidied up TRUNC combine code. NFC.
Make use of DAG.getBitcast and use clang-format to reduce number of lines (and make it more readable).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 21:50:40 +00:00
Justin Lebar
ec0f2d8352 [CUDA] Add Target::isNVPTX().
Summary: Helper so we don't have to enumerate nvptx && nvptx64 everywhere.

Reviewers: echristo

Subscribers: llvm-commits, jhen, tra

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 21:12:22 +00:00
Justin Lebar
e7e7a4409a [CUDA] Die gracefully when trying to output an LLVM alias.
Summary:
Previously, we would just output "foo = bar" in the assembly, and then
ptxas would choke.  Now we die before emitting any invalid code.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, jhen, tra

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 21:12:20 +00:00
Justin Lebar
df736b776a [CUDA] Make empty parameter lists in nvptx function decls easier to read.
Summary:
Before:

  .func  (.param .b32 func_retval0) _ZL21__nvvm_reflect_anchorv(

  )
  {

After:

  .func  (.param .b32 func_retval0) _ZL21__nvvm_reflect_anchorv()
  {

Reviewers: bkramer

Subscribers: llvm-commits, tra, jhen, echristo, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 21:12:17 +00:00
Benjamin Kramer
a2815b5dd7 Don't check if a list is empty with ilist::size.
ilist::size() is O(n) while ilist::empty() is O(1)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 20:58:09 +00:00
NAKAMURA Takumi
d755861f7e ObjectTransformLayerTest.cpp: Rework r258633. [-Winconsistent-missing-override]
Sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 20:48:50 +00:00
NAKAMURA Takumi
3dd226c84b ObjectTransformLayerTest.cpp: Fix a warning. [-Wredundant-move]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258634 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 20:45:55 +00:00
NAKAMURA Takumi
550eae18a9 ObjectTransformLayerTest.cpp: Fix a warning. [-Winconsistent-missing-override]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 20:45:50 +00:00
Kostya Serebryany
d75ddafc2f [libFuzzer] add -abort_on_timeout option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 19:34:19 +00:00
Joseph Tremoulet
88a19038a7 [ORC] Update ObjectTransformLayer signature
Summary:
Update ObjectTransformLayer::addObjectSet to take the object set by
value rather than reference and pass it to the base layer with move
semantics rather than copy, to match r258185's changes to
ObjectLinkingLayer.

Update the unit test to verify that ObjectTransformLayer's signature stays
in sync with ObjectLinkingLayer's.


Reviewers: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 18:36:01 +00:00
Sanjay Patel
d33ffc66c6 regenerate checks and note some near-term improvements
For the moment, this file takes way too long to run (see inline comments), but
that should be a temporary problem. The fact that the compile time is so slow
for a target that doesn't support maskmov may be a bug worth investigating too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 17:52:56 +00:00
Akira Hatanaka
11db5ceb3a [Bitcode] Insert the darwin wrapper at the beginning of a file when the
target is macho.

It looks like the check for macho was accidentally dropped in r132959.

I don't have a test case, but I'll add one if anyone knows how this can
be tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 16:02:10 +00:00
Aaron Ballman
34a32c256c Silence a -Wparentheses warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 15:42:21 +00:00
Simon Pilgrim
103f73af6c Added missing comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 14:38:02 +00:00
NAKAMURA Takumi
eff8299f82 AlignOf.h: Satisfy both g++-4.7 and msc18.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 13:52:09 +00:00
Simon Pilgrim
36a34a0671 [X86][SSE] Remove INSERTPS dependencies from unreferenced operands.
If the INSERTPS zeroes out all the referenced elements from either of the 2 input vectors (and the input is not already UNDEF), then set that input to UNDEF to reduce dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 13:37:07 +00:00
Haicheng Wu
98b6bad4c8 [LIR] Add support for structs and hand unrolled loops
Now LIR can turn following codes into memset:

typedef struct foo {
  int a;
  int b;
} foo_t;

void bar(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; ++i) {
    f[i].a = 0;
    f[i].b = 0;
  }
}

void test(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; i += 2) {
    f[i] = 0;
    f[i+1] = 0;
  }
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 06:52:41 +00:00
Matthias Braun
578afd47d5 Inline variable into assert
Seems like some compilers still give unused variable warnings for
bool var = ...;
(void)var;
so I have to inline the variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 06:49:29 +00:00
NAKAMURA Takumi
71c1bf1b4f AArch64ISelLowering.cpp: Fix a warning. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 06:34:59 +00:00
Junmo Park
3be2621beb Remove extra whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258617 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 06:34:36 +00:00
David Majnemer
ca688cd35b [PruneEH] Don't try to insert a terminator after another terminator
LLVM's BasicBlock has a single terminator, it is not valid to have two.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 06:00:44 +00:00
Manuel Jacob
f47ed12e80 Put space after pointer type in test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:47:34 +00:00
Matt Arsenault
ba78f314e9 AMDGPU: Replace some deprecated intrinsic uses in tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:42:49 +00:00
Matt Arsenault
ed7be7aac6 AMDGPU: Run instnamer on a few tests
This will make future test updates easier

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:42:43 +00:00
Matt Arsenault
78c5400038 AMDGPU: Remove more unused intrinsics
Replace tests with lrp with basic IR expansion

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:42:38 +00:00
David Majnemer
21b6d45ea5 [PruneEH] FuncletPads must not have undef operands
Instead of RAUW with undef, replace the first non-token instruction with
unreachable.

This fixes PR26263.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258611 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:41:29 +00:00
David Majnemer
ee28a1875c [PruneEH] Unify invoke and call handling in DeleteBasicBlock
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:41:27 +00:00
David Majnemer
3f85d7777e [PruneEH] Reuse code from removeUnwindEdge
PruneEH had functionality idential to removeUnwindEdge.
Consolidate around removeUnwindEdge.
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:41:22 +00:00
Matt Arsenault
79f77a9c0d AMDGPU: Move amdgcn intrinsic handling into SITargetLowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:32:20 +00:00
Matt Arsenault
6b44025db3 AMDGPU: Remove IntrNoMem from llvm.SI.sendmsg
This has side effects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:32:18 +00:00
Matt Arsenault
2b74ecaae4 AMDGPU: Remove Feature64BitPtr
This is a leftover from AMDIL that doesn't do anything
and doesn't belong here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258606 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 05:32:14 +00:00
Matthias Braun
52d72897ff AArch64ISel: Fix ccmp code selection matching deep expressions.
Some of the conditions necessary to produce ccmp sequences were only
checked in recursive calls to emitConjunctionDisjunctionTree() after
some of the earlier expressions were already built. Move all checks over
to isConjunctionDisjunctionTree() so they are all checked before we
start emitting instructions.

Also rename some variable to better reflect their usage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258605 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 04:05:22 +00:00
Matthias Braun
7b63e4a855 AArch64ISelLowering: Reduce maximum recursion depth of isConjunctionDisjunctionTree()
This function will exhibit exponential runtime (2**n) so we should
rather use a lower limit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 04:05:18 +00:00
Matthias Braun
8e055c9655 Fix wrong indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 04:05:16 +00:00
NAKAMURA Takumi
d9234e1279 AlignOf.h: Appease g++-4.7 for now. Will fix later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 02:22:36 +00:00
Derek Schuff
8f05ec1038 [WebAssembly] Fix RegNumbering for the stack pointer
Previously it failed to add NumArgRegs to the offset and so clobbered an
already-used register. Now just start the numbering after the arg regs
and don't duplicate the add. Test coverage for this coming shortly with
the implementation of byval.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 01:20:43 +00:00
Kostya Serebryany
21a169fad1 [libFuzzer] add more fields to DictionaryEntry to count the number of uses and successes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 23:55:14 +00:00
Reid Kleckner
0fdcaf7ce8 [cmake] Disable manifest generation when LLD is the linker
Running mt.exe to make the manifest is really slow. Disabling manifest
generation doesn't seem to break anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 23:27:13 +00:00
David Majnemer
be7879e869 [WinEH] Let cleanups post-dominated by unreachable get executed
Cleanups in C++ are a little weird.  They are only guaranteed to be
reliably executed if, and only if, there is a viable catch handler which
can handle the exception.

This means that reachability of a cleanup is lexically determined by it
being nested with a try-block which unwinds to a catch.  It is *cannot*
be reasoned about by examining the control flow edges leaving a cleanup.

Usually this is not a problem.  It becomes a problem when there are *no*
edges out of a cleanup because we believed that code post-dominated by
the cleanup is dead.  In LLVM's case, this code is what informs the
personality routine about the presence of a suitable catch handler.
However, the lack of edges to that catch handler makes the handler
become unreachable which causes us to remove it.  By removing the
handler, the cleanup becomes unreachable.

Instead, inject a catch-all handler with every cleanup that has no
unwind edges.  This will allow us to properly unwind the stack.

This fixes PR25997.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 23:20:43 +00:00
Kevin Enderby
5479bf7bf0 Fix the code that leads to the incorrect trigger of the report_fatal_error()
in MachOObjectFile::getSymbolByIndex() when a Mach-O file has
a symbol table load command but the number of symbols are zero.

The code in MachOObjectFile::symbol_begin_impl() should not be
assuming there is a symbol at index 0, in cases there is no symbol
table load command or the count of symbol is zero.  So I also fixed
that.  And needed to fix MachOObjectFile::symbol_end_impl() to
also do the same thing for no symbol table or one with zero entries.

The code in MachOObjectFile::getSymbolByIndex() should trigger
the report_fatal_error() for programmatic errors for any index when
there is no symbol table load command and not return the end iterator.
So also fixed that. Note there is no test case as this is a programmatic
error.

The test case using the file macho-invalid-bad-symbol-index has
a symbol table load command with its number of symbols (nsyms)
is zero. Which was incorrectly testing the bad triggering of the
report_fatal_error() in in MachOObjectFile::getSymbolByIndex().

This test case is an invalid Mach-O file but not for that reason.
It appears this Mach-O file use to have an nsyms value of 11,
and what makes this Mach-O file invalid is the counts and
indexes into the symbol table of the dynamic load command
are now invalid because the number of symbol table entries
(nsyms) is now zero.  Which can be seen with the existing
llvm-obdump:

% llvm-objdump -private-headers macho-invalid-bad-symbol-index
…
Load command 4
     cmd LC_SYMTAB
 cmdsize 24
  symoff 4216
   nsyms 0
  stroff 4392
 strsize 144
Load command 5
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 8 (past the end of the symbol table)
     iextdefsym 8 (greater than the number of symbols)
     nextdefsym 2 (past the end of the symbol table)
      iundefsym 10 (greater than the number of symbols)
      nundefsym 1 (past the end of the symbol table)
...

And the native darwin tools generates an error for this file:

% nm macho-invalid-bad-symbol-index
nm: object: macho-invalid-bad-symbol-index truncated or malformed object (ilocalsym plus nlocalsym in LC_DYSYMTAB load command extends past the end of the symbol table)

I added new checks for the indexes and sizes for these in the
constructor of MachOObjectFile.  And added comments for what
would be a proper diagnostic messages.

And changed the test case using macho-invalid-bad-symbol-index
to test for the new error now produced.

Also added a test with a valid Mach-O file with a symbol table
load command where the number of symbols is zero that shows
the report_fatal_error() is not called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 22:49:55 +00:00