Commit Graph

103024 Commits

Author SHA1 Message Date
Rafael Espindola
0af058ff9c Don't include an invalid symbol in the symbol table.
The symbol table itself has no relocations, so it is not possible to represent
things like

a = undefined + 1

With the patch we just omit these variables. That matches the behaviour of the
gnu assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 13:39:57 +00:00
Rafael Espindola
086e9aaa55 List the entire symbol table in this test.
This will allow us to extend this test to show that other symbols don't
show up in the symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207418 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 13:26:35 +00:00
Rafael Espindola
c074b096d5 Produce an error instead of a crash in an expr we cannot represent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 12:40:50 +00:00
Patrik Hagglund
696bbc59ae Fix gcc -Wsign-compare warning in X86DisassemblerTables.cpp.
X86_MAX_OPERANDS is changed to unsigned.

Also, add range-based for loops for affected loops. This in turn
needed an ArrayRef instead of a pointer-to-array in
InternalInstruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207413 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 12:12:27 +00:00
Tim Northover
16aac4387f ARM64: diagnose use of v16-v31 in certain indexed NEON instructions.
Someone couldn't bear to have a completely orthogonal set of floating-point
registers, so we've got some instructions that only accept v0-v15 (coming in
ARMv9, V128_prime: you're allowed v2, v3, v5, v7, ...).

Anyway, we were permitting even the out of range registers during assembly
(CodeGen handled it correctly). This adds a diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207412 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 11:27:43 +00:00
Chandler Carruth
db0b52c8e0 [LCG] Add the most basic of edge insertion to the lazy call graph. This
just handles the pre-DFS case. Also add some test cases for this case to
make sure it works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207411 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 11:10:23 +00:00
Chandler Carruth
e52aad4202 [LCG] Make the return of the IntraSCC removal method actually match its
contract (and be much more useful). It now provides exactly the
post-order traversal a caller might need to perform on newly formed
SCCs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207410 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 10:49:06 +00:00
Chandler Carruth
55eab086e3 Fix rampant quadratic behavior in UpdatePHINodes. The operation of
mapping from a basic block to an incoming value, either for removal or
just lookup, is linear in the number of predecessors, and we were doing
this for every entry in the 'Preds' list which is in many cases almost
all of them!

Unfortunately, the fixes are quite ugly. PHI nodes just don't make this
operation easy. The efficient way to fix this is to have a clever
'remove_if' operation on PHI nodes that lets us do a single pass over
all the incoming values of the original PHI node, extracting the ones we
care about. Then we could quickly construct the new phi node from this
list. This would remove the remaining underlying quadratic movement of
unrelated incoming values and the need for silly backwards looping to
"minimize" how often we hit the quadratic case.

This is the last obvious fix for PR19499. It shaves another 20% off the
compile time for me, and while UpdatePHINodes remains in the profile,
most of the time is now stemming from the well known inefficiencies of
LVI and jump threading.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207409 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 10:37:30 +00:00
Chandler Carruth
f1a7403e86 Fix very poor compile-time in PR19499 due to excessive tree walks in
domtree. When finding a nearest common dominator, if neither A dominates
B nor B dominates A, we immediately resorted to a tree walk. The tree
walk here is *particularly* expensive because we have to build
a (potentially very large) set for one side's dominators and compare it
with the other side's.

If at any point we have DFS info, we don't need to do any of this. We
can just walk up one side's immediate dominators and return the first
one which dominates the other side. Because of the DFS info, the
dominates queries are trivially constant time.

This reduces the optimizers time in the test case on PR19499 by 70%. It
now optimizes in about 30 seconds for me. And there is still more to be
done for this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 09:34:03 +00:00
Dan Liew
859530fba6 If building with LLVM_ENABLE_DOXYGEN and using CMake then
abort while configuring if doxygen could not be found. This
is desirable because if the build is going to fail then it should
fail as early as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207404 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 09:10:05 +00:00
Chandler Carruth
d6d57bc3fb [inliner] Significantly improve the compile time in cases like PR19499
by avoiding inlining massive switches merely because they have no
instructions in them. These switches still show up where we fail to form
lookup tables, and in those cases they are actually going to cause
a very significant code size hit anyways, so inlining them is not the
right call. The right way to fix any performance regressions stemming
from this is to enhance the switch-to-lookup-table logic to fire in more
places.

This makes PR19499 about 5x less bad. It uncovers a second compile time
problem in that test case that is unrelated (surprisingly!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207403 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 08:52:44 +00:00
Hao Liu
0ddc7447d9 [ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207399 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 07:34:27 +00:00
Craig Topper
7d811a53de Convert more SelectionDAG functions to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207397 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 05:57:50 +00:00
Craig Topper
c34a25d59d [C++] Use 'nullptr'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207394 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 04:05:08 +00:00
Saleem Abdulrasool
1c5e4e5021 MC: range-loopify
Use C++11 range-based loops rather than explicit constructors.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 03:34:48 +00:00
Chandler Carruth
98e5006d92 Use raw_ostream and Format.h on Windows so that we don't have to roll
our own portability system to cope without snprintf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 01:57:46 +00:00
Chandler Carruth
d1536b3088 Update the Windows TimeValue formatting to match the new formatting on
Unix-like OSes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207388 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 01:24:35 +00:00
Chandler Carruth
7a36912a9d Update tests to use the new format of printing a TimeValue. It's a bit
odd to have the output of 'llvm-ar tv' depend on the format of
TimeValue::str(), but that's what we have today. If anyone needs the
output to remain compatible with GNU ar or old versions of llvm-ar, just
shout and I'll switch the code to manually format its times.

Note that there isn't a portable format -- Mac and GNU have different
formats at least (thanks Rafael!) so...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207387 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 01:24:32 +00:00
Chandler Carruth
7f1946408d Teach the pass manager's execution dump to print the current time before
each line. This is particularly nice for tracking which run of
a particular pass over a particular function was slow.

This also required making the TimeValue string much more useful. First,
there is a standard format for writing out a date and time. Let's use
that rather than strings that would have to be parsed. Second, actually
output the nanosecond resolution that timevalue claims to have.

This is proving useful working on PR19499, so I figured it would be
generally useful to commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207385 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 23:59:25 +00:00
NAKAMURA Takumi
befce904c0 CodeGen/AsmPrinter.h: Fix \param in r207369. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207384 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 23:57:57 +00:00
Craig Topper
a8e8d83e65 Convert AddNodeIDNode and SelectionDAG::getNodeIfExiists to use ArrayRef<SDValue>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207383 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 23:22:43 +00:00
Rafael Espindola
2dc04b4604 Add emitThumbSet to the arm target streamer.
This fixes the asm printer implementation and lets the parser be unaware of
what .thumb_set is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207381 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 20:23:58 +00:00
Craig Topper
fe2da45555 Fix an assert I accidentally broke to hopefully fix the build bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207380 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:40:43 +00:00
Craig Topper
a440b0f2dd Convert SelectionDAGISel::MorphNode to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207379 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:21:20 +00:00
Craig Topper
f564ea31f0 Convert SelectionDAG::MorphNodeTo to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:21:16 +00:00
Craig Topper
1aa05f3844 Convert SelectionDAG::SelectNodeTo to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:21:11 +00:00
Craig Topper
7e1ae6d9e0 Convert one last signature of getNode to take an ArrayRef of SDUse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207376 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:21:06 +00:00
Craig Topper
479c81774d Convert SDNode constructor to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:21:02 +00:00
Craig Topper
a7f892b33b Convert SelectionDAG::getMergeValues to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207374 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:20:57 +00:00
Craig Topper
e046664a0e Const-correct SelectionDAG::getAtomic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207373 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 19:20:47 +00:00
Adrian Prantl
d8e141c0c1 Clarify the doxygen comment for AsmPrinter::EmitDwarfRegOpPiece and add
default arguments to the function.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207372 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 18:50:45 +00:00
Benjamin Kramer
3551384ae2 X86TTI: Adjust sdiv cost now that we can lower it on plain SSE2.
Includes a fix for a horrible typo that caused all SDIV costs to be
slightly off :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207371 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 18:47:54 +00:00
Benjamin Kramer
ad1f916eaf X86: If SSE4.1 is missing lower SMUL_LOHI of v4i32 to pmuludq and fix up the high parts.
This is more expensive than pmuldq but still cheaper than scalarizing the whole thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207370 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 18:47:41 +00:00
Adrian Prantl
75955d843f Debug info: Refactor EmitDwarfRegOpPiece to be a member function of
AsmPrinter.
No functional change.

http://reviews.llvm.org/D3373
rdar://problem/15928306

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207369 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 18:25:45 +00:00
Adrian Prantl
eccd574af8 Debug Info: Prepare DebugLocEntry to handle more than a single value per
entry. This is in preparation for generic DW_OP_piece support.
No functional change so far.

http://reviews.llvm.org/D3373
rdar://problem/15928306

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207368 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 18:25:40 +00:00
Rafael Espindola
14a1490eb8 Make getOrCreateSymbolData non virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207367 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 17:23:37 +00:00
Rafael Espindola
70883a252c Avoid using MCSymbolData on the asm streamer.
Only the object streamers need to track if a symbol should be marked thumb or
not. This ports the ELF case. The COFF case is not ported since it is currently
not working for some other reason (I will report a bug).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207366 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 17:10:46 +00:00
Saleem Abdulrasool
189a2a91c7 MC: duplicate .file test for WoA (SVN r207341)
Since the COFF tests are dependent on X86, duplicate the test for ARM.  Use the
default check prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207365 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 16:10:57 +00:00
Benjamin Kramer
38df4bd031 Make helper functions static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207359 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 14:54:59 +00:00
David Blaikie
35d4ad33f6 Remove redundant explicit default initialization of non-trivially constructed member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207357 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 14:47:23 +00:00
NAKAMURA Takumi
1a6bd31d24 Add the default constructor DwarfAccelTable::DataArray() to initialize (MCSymbol*)StrSym explicitly.
It will fix crash in codegen on msvc x64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207356 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 11:59:44 +00:00
NAKAMURA Takumi
1d7595a123 Revert r206989, "Mark llvm/test/BugPoint/compile-custom.ll as XFAIL:vg_leak." It has been fixed since r207265.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207355 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 11:59:33 +00:00
Benjamin Kramer
3fd5902758 Update test not to check for a shuffle of an all-zero vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207354 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 11:54:45 +00:00
Benjamin Kramer
55e03c1992 SelectionDAG: Aggressively fold shuffles of constant splats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207352 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 11:41:06 +00:00
Saleem Abdulrasool
f090afddb4 ARM: MSVC does not support = default
Explicitly "implement" the destructor as MSVC does not support defaulted methods
yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207350 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 05:28:10 +00:00
Saleem Abdulrasool
103f947472 MC: restore behaviour of defaulting to ELF
This restores the previous behaviour of just assuming that if you dont specify a
valid triple that you really meant the default triple with an ELF object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 04:54:16 +00:00
Saleem Abdulrasool
b7c41fe882 tests: Windows ARM now supports object emission
Update lit.cfg with the fact that LLVM can now generate WoA PE/COFF objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207347 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 04:29:36 +00:00
Saleem Abdulrasool
86e4b7dadb COFF: move ARM COFF test to ARM directory
The COFF tests all assume X86.  Just move the new COFF tests under ARM to
appease the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207346 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 04:29:32 +00:00
Saleem Abdulrasool
2d0d7fd085 Add WoA object file emission support
Introduce support for WoA PE/COFF object file emission from LLVM.  Add the new
target specific PE/COFF Streamer (ARMWinCOFFStreamer) that handles the ARM
specific behaviour of PE/COFF object emission.  ARM exception information is not
yet emitted and is a TODO item.

The ARM specific object writer (ARMWinCOFFObjectWriter) handles the ARM specific
relocation handling in conjunction with the WinCOFFObjectWriter in the MC layer.
The MC layer needs to be updated to deal with the relocation adjustments.
Branch relocations are adjusted by 4 bytes (unlikely their ELF counterparts).

Minor tweaks to switch multiple conditional checks into equivalent switch
statements.  The ObjectFileInfo is updated to relax the object file setup for
Windows COFF.  Move the architecture checks into an assertion.  Windows COFF is
currently only supported on x86, x86_64, and ARM (thumb).  Rather than
defaulting to ELF, we will refuse to generate an object file.  This is better
though as you do not get an (arbitrary) object file which is different from the
request.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207345 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 03:48:22 +00:00
Saleem Abdulrasool
6c76c959e4 MC: create X86WinCOFFStreamer for target specific behaviour
This introduces a target specific streamer, X86WinCOFFStreamer, which handles
the target specific behaviour (e.g. WinEH).  This is mostly to ensure that
differences between ARM and X86 remain disjoint and do not accidentally cross
boundaries.  This is the final staging change for enabling object emission for
Windows on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207344 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-27 03:48:12 +00:00