Commit Graph

170364 Commits

Author SHA1 Message Date
Saleem Abdulrasool 44419fc3cd ARM IAS: properly handle function entries in .thumb
When a label is parsed, check if there is type information available for the
label.  If so, check if the symbol is a function.  If the symbol is a function
and we are in thumb mode and no explicit thumb_func has been emitted, adjust the
symbol data to indicate that the function definition is a thumb function.

The application of this inferencing is improved value handling in the object
file (the required thumb bit is set on symbols which are thumb functions).  It
also helps improve compatibility with binutils.

The one complication that arises from this handling is the MCAsmStreamer.  The
default implementation of getOrCreateSymbolData in MCStreamer does not support
tracking the symbol data.  In order to support the semantics of thumb functions,
track symbol data in assembly streamer.  Although O(n) in number of labels in
the TU, this is already done in various other streamers and as such the memory
overhead is not a practical concern in this scenario.

llvm-svn: 204544
2014-03-22 19:26:18 +00:00
Hal Finkel 55805eb562 [PowerPC] Fix the VSX v2f64 return register
v2f64 values, like other 128-bit values, are returned under VSX in register
vs34 (Altivec register v2).

llvm-svn: 204543
2014-03-22 18:24:43 +00:00
Hal Finkel 68e03bd41f [TableGen] Don't assert, produce an error, when an instruction has too few operands
When an instruction's operand list does not have a sufficient number of
operands to match with all of the variables that contribute to its
encoding, instead of asserting inside a call to getSubOperandNumber, produce an
informative error.

llvm-svn: 204542
2014-03-22 11:33:32 +00:00
Simon Atanasyan 6690854109 [Mips] Make the test to be a bit more relaxed to lld YAML output.
llvm-svn: 204541
2014-03-22 06:20:38 +00:00
NAKAMURA Takumi 4baaa6a599 llvm-profdata: Avoid F_Text in "merge" for now, since "llvm-profdata show" is confused with CRLF.
FIXME: line_iterator should be tolerant of CR.
llvm-svn: 204540
2014-03-22 05:38:22 +00:00
NAKAMURA Takumi 06246f10cd Revert r204493, "Make clang/test/lit.cfg pre-scan the RUN line looking for tool names,"
It was incompatible to standlalone clang build.

llvm-svn: 204539
2014-03-22 04:46:59 +00:00
Juergen Ributzka e474752f4c [Constant Hoisting] Erase dead cast instructions.
The cleanup code that removes dead cast instructions only removed them from the
basic block, but didn't delete them. This fix erases them now too.

llvm-svn: 204538
2014-03-22 01:49:30 +00:00
Juergen Ributzka e802d507b0 [Constant Hoisting] Fix multiple entries for the same basic block in PHI nodes.
A PHI node usually has only one value/basic block pair per incoming basic block.
In the case of a switch statement it is possible that a following PHI node may
have more than one such pair per incoming basic block. E.g.:
%0 = phi i64 [ 123456, %case2 ], [ 654321, %Entry ], [ 654321, %Entry ]
This is valid and the verfier doesn't complain, because both values are the
same.

Constant hoisting materializes the constant for each operand separately and the
value is still the same, but the variable names have changed. As a result the
verfier can't recognize anymore that they are the same value and complains.

This fix adds special update code for PHI node in constant hoisting to prevent
this corner case.

This fixes <rdar://problem/16394449>

llvm-svn: 204537
2014-03-22 01:49:27 +00:00
Andrea Di Biagio 5b0aacf1c7 [DAG] Fix an assertion failure caused by an invalid cast in method 'BuildVectorSDNode::isConstantSplat'
This patch renames method 'isConstantSplat' as 'getConstantSplatValue'
(mainly for consistency reasons), and rewrites its logic to ensure
that we always perform a legal 'cast<ConstantSDNode>'.

Added test shift-combine-crash.ll to verify that DAGCombiner no longer crashes with an assertion failure in the attempt to simplify a vector shift by a vector of all undef counts.

llvm-svn: 204536
2014-03-22 01:47:22 +00:00
Richard Smith 0ac1b8fd07 Refactor: move loading pending instantiations from chained PCHs to a more appropriate place, so that we only ask the external source once.
llvm-svn: 204535
2014-03-22 01:43:32 +00:00
Jim Ingham 7dabe1a1b6 If a single step ends on a breakpoint, it should be reported as a breakpoint hit
even though the underlying exception is a trace exception.

<rdar://problem/15243355>

llvm-svn: 204534
2014-03-22 00:44:41 +00:00
NAKAMURA Takumi d1c22bef6f Suppress SupportTests.LockFileManagerTest on win32 for investigating.
llvm-svn: 204533
2014-03-22 00:27:17 +00:00
Adrian Prantl 7b622ca9d9 relax testcase to unbreak windows buildbots.
llvm-svn: 204531
2014-03-21 22:58:28 +00:00
Adrian Prantl ca2728ec22 Delete stale comment. Thanks, Eric!
llvm-svn: 204530
2014-03-21 22:58:25 +00:00
Arnaud A. de Grandmaison c6b4045d65 When generating the Attribute dumper code, do not dead-initialize MoreChildren
No functional change. This will cleanup a bunch of scan-build warnings.

llvm-svn: 204529
2014-03-21 22:35:34 +00:00
Adrian Prantl 78619f7171 Dwarf Debug: Remove some cargo-cult type uniquing. Scopes do not have
an ID, so this is a noop.
Thanks Manman for catching this!

llvm-svn: 204528
2014-03-21 22:16:32 +00:00
Rafael Espindola 66f96fe0cb Fix the value computation in
sym_a:
sym_d = sym_a + 1

This is the smallest fix I was able to extract from what got reverted in
r204203.

llvm-svn: 204527
2014-03-21 22:00:29 +00:00
Arnaud A. de Grandmaison c97727a492 Remove some dead assignements found by scan-build
llvm-svn: 204526
2014-03-21 21:54:46 +00:00
Kaelyn Uhrain ec2629964e Be a bit smarter about what nested name qualifiers to allow when
performing typo correction on very short (1 or 2 char) identifiers.

llvm-svn: 204525
2014-03-21 21:54:25 +00:00
Kaelyn Uhrain bbfc05727b [C++11] Simplify some loops in Sema::CorrectTypo as range-based for loops.
llvm-svn: 204524
2014-03-21 21:54:22 +00:00
Rui Ueyama c9411c3357 Use early continues to reduce nesting.
llvm-svn: 204523
2014-03-21 21:46:49 +00:00
Manman Ren c935560568 Register allocator: add condition to hoist a spill to outer loop.
We make sure a spill is not hoisted to a hotter outer loop by adding
a condition. Hoist a spill to outer loop if there are multiple dependents
(it can be beneficial if more than one dependents are hoisted) or
if DepSV (the hoisting source) is hotter than SV (the hoisting destination).

rdar://16268194

llvm-svn: 204522
2014-03-21 21:46:24 +00:00
David Blaikie 089b5c9174 Avoid GCC's "cast from pointer to integer of different size" warning.
This is a bit of a stab in the dark as I'm not sure I've got these
source files compiling correctly locally. (and the warning only
reproduces on a 32bit build anyway)

llvm-svn: 204521
2014-03-21 21:45:49 +00:00
Argyrios Kyrtzidis 900e9a3da0 [Support] Follow up to r204426, for LockFileManager, make the given path absolute so relative paths are properly handled in both Windows and Unix.
llvm-svn: 204520
2014-03-21 21:45:07 +00:00
Alexander Musman 0a6bd8f170 Test commit
llvm-svn: 204519
2014-03-21 21:25:24 +00:00
Duncan P. N. Exon Smith af777bb37c InstrProf: Cleanup binary profdata testcase
Cleanup the current binary testcase for profile data.

  - Rename it to something more specific.
  - Remove the text comparison.
  - Check the output of llvm-profdata show.

llvm-svn: 204518
2014-03-21 21:20:35 +00:00
Adrian Prantl bebb89359a CGDebugInfo: At the end of EmitFunctionStart, Initialize PrevLoc to the
location that the next call emitLocation() would default to. Otherwise
setLocation() may wrongly believe that the current source file didn't
change, when in fact it did.

llvm-svn: 204517
2014-03-21 21:01:58 +00:00
Duncan P. N. Exon Smith ae29f7a5ec InstrProf: Move constructor to the header
Fixes 80-column violation at the same time.

<rdar://problem/15950346>

llvm-svn: 204516
2014-03-21 20:59:19 +00:00
Duncan P. N. Exon Smith 8d02a2ac21 InstrProf: Remove MSVC-specific logic
Apparently, MSVC has stdint.h now?  Let's see if the buildbots complain.
I'm not convinced that the build system is even set up for MSVC to build
this file, but...

llvm-svn: 204515
2014-03-21 20:59:08 +00:00
Duncan P. N. Exon Smith a128956243 InstrProf: Change magic number to have non-text characters
Include non-text characters in the magic number so that text files can't
match.

<rdar://problem/15950346>

llvm-svn: 204514
2014-03-21 20:42:40 +00:00
Duncan P. N. Exon Smith 745a2bf0b8 InstrProf: Change magic number to have non-text characters
Include non-text characters in the magic number so that text files can't
match.

<rdar://problem/15950346>

llvm-svn: 204513
2014-03-21 20:42:37 +00:00
Duncan P. N. Exon Smith 4c5b7cb1fc InstrProf: Use move semantics with unique_ptr
<rdar://problem/15950346>

llvm-svn: 204512
2014-03-21 20:42:34 +00:00
Duncan P. N. Exon Smith 09a67f45ee InstrProf: Detect magic numbers in a more scalable way
No functionality change.

<rdar://problem/15950346>

llvm-svn: 204511
2014-03-21 20:42:31 +00:00
Duncan P. N. Exon Smith 531bb481e2 InstrProf: Actually detect bad headers
<rdar://problem/15950346>

llvm-svn: 204510
2014-03-21 20:42:28 +00:00
Rui Ueyama 83ba74fa3f [PECOFF] Rename link.exe -> lld-link.exe.
Creating the file "link.exe" made some confusion, so it's better to
name it lld-link.exe, as we did for CL (clang-cl.exe).

llvm-svn: 204509
2014-03-21 20:41:48 +00:00
Juergen Ributzka 838282ec3a [RuntimeDyld] Fix comment for previous commit (r204439)
llvm-svn: 204508
2014-03-21 20:38:46 +00:00
Juergen Ributzka 7608dc0441 [RuntimeDyld] clang-format files.
llvm-svn: 204507
2014-03-21 20:28:42 +00:00
David Blaikie 330ec978a6 DebugInfo: Omit DW_AT_addr_base from skeletal type units.
Type units have no addresses, so there's no need for DW_AT_addr_base.
This removes another relocation from every skeletal type unit and brings
LLVM's skeletal type units in line with GCC's (containing only
GNU_dwo_name (strp), comp_dir (strp), and GNU_pubnames (flag_present)).

Cary's got some ideas about using str_index in the .o file to reduce
those last two relocations (well, replace two relocations with one
relocation (pointing to the string index) and two indicies)

llvm-svn: 204506
2014-03-21 20:27:21 +00:00
Chad Rosier b7747e31ef [AArch64] Add SchedRW lists to NEON instructions.
Previously, only regular AArch64 instructions were annotated with SchedRW lists.
This patch does the same for NEON enabling these instructions to be scheduled by
the MIScheduler. Additionally, store operations are now modeled and a few
SchedRW lists were updated for bug fixes (e.g. multiple def operands).

Reviewers: apazos, mcrosier, atrick
Patch by Dave Estes <cestes@codeaurora.org>!

llvm-svn: 204505
2014-03-21 19:34:41 +00:00
Andrew MacPherson ea77a5528d Suppress SIGSTOP under Linux and don't explicitly call SetResumeSignal() in POSIXThread, instead just let StopInfo handle it.
llvm-svn: 204504
2014-03-21 19:08:37 +00:00
Simon Atanasyan b752d6e18b [Mips] Emit LA25 MIPS stubs to call pic code from non-pic routines.
llvm-svn: 204503
2014-03-21 19:08:02 +00:00
Duncan P. N. Exon Smith f1c9361326 InstrProf: __ => _ in header guards
llvm-svn: 204502
2014-03-21 18:47:23 +00:00
Justin Bogner fc048c7443 ProfileData: Avoid double underscores in header guards
llvm-svn: 204501
2014-03-21 18:46:29 +00:00
Duncan P. N. Exon Smith 812dcae09c InstrProf: Unify logic in two profile writers
<rdar://problem/15943240>

llvm-svn: 204500
2014-03-21 18:29:24 +00:00
Duncan P. N. Exon Smith 117cf2bd1f InstrProf: Write the __llvm_profile_write_buffer()
Write __llvm_profile_write_buffer(), which uses the same logic as
__llvm_profile_write_file(), but writes directly to a provided `char*`
buffer instead.

<rdar://problem/15943240>

llvm-svn: 204499
2014-03-21 18:29:22 +00:00
Duncan P. N. Exon Smith cf4bb960bd InstrProf: If libc is available, use it; no functionality change
It was misguided to plan to rely on __llvm_profile_write_buffer() in
__llvm_profile_write_file().  It's less complex to duplicate the writing
logic than to mmap the file.

Since it's here to stay, move `FILE*`-based writing logic into
InstrProfilingFile.c.

<rdar://problem/15943240>

llvm-svn: 204498
2014-03-21 18:29:19 +00:00
Duncan P. N. Exon Smith be0a5e176b InstrProf: Reorganize files; no functionality change
Move functions around to prepare for some other changes.

  - Merge InstrProfilingExtras.h with InstrProfiling.h.  There's no
    benefit to having these split.

  - Rename InstrProfilingExtras.c to InstrProfilingFile.c.

  - Split actual buffer writing code out of InstrProfiling.c into
    InstrProfilingBuffer.c.

  - Drive-by corrections of a couple of header comments.

<rdar://problem/15943240>

llvm-svn: 204497
2014-03-21 18:29:15 +00:00
Duncan P. N. Exon Smith 24b4b65339 InstrProf: Read raw binary profile in llvm-profdata
Read a raw binary profile that corresponds to a memory dump from the
runtime profile.

The test is a binary file generated from
cfe/trunk/test/Profile/c-general.c with the new compiler-rt runtime and
the matching text version of the input.  It includes instructions on how
to regenerate.

<rdar://problem/15950346>

llvm-svn: 204496
2014-03-21 18:26:05 +00:00
Duncan P. N. Exon Smith 76e8731b09 InstrProf: Write raw binary profile from runtime
Write a raw binary profile from the runtime.

<rdar://problem/15950346>

llvm-svn: 204495
2014-03-21 18:25:56 +00:00
Justin Bogner 47b8768fc0 ProfileData: Avoid brace initialization, windows doesn't like it
llvm-svn: 204494
2014-03-21 18:22:16 +00:00