Commit Graph

101366 Commits

Author SHA1 Message Date
Rafael Espindola cfee7efde9 Teach llvm-readobj to print human friendly description of reserved sections.
llvm-svn: 204584
2014-03-24 05:00:34 +00:00
Karthik Bhat 195e9dd91b Allow constant folding of ceil function whenever feasible
llvm-svn: 204583
2014-03-24 04:36:06 +00:00
Rafael Espindola 717aeb6d7b Add back tests that were reverted in r204203.
They pass again with the fix in r204581.

llvm-svn: 204582
2014-03-24 03:48:15 +00:00
Rafael Espindola 022bb76879 Propagate section from base to derived symbol.
We were already propagating the section in

a = b

With this patch we also propagate it for

a = b + 1

llvm-svn: 204581
2014-03-24 03:43:21 +00:00
Duncan P. N. Exon Smith d7d83477fa InstrProf: Silence spurious warnings in GCC 4.8
No functionality change.

llvm-svn: 204580
2014-03-24 00:47:18 +00:00
NAKAMURA Takumi 126a6c0238 SupportTests.LockFileManagerTest: Add assertions for Win32.
- create_link doesn't work for nonexistent file.
  - remove cannot remove working directory.

llvm-svn: 204579
2014-03-23 23:55:57 +00:00
Arnaud A. de Grandmaison 1182600f20 ARM: no need to update SplatBits as it is not used
llvm-svn: 204575
2014-03-23 21:14:32 +00:00
Justin Bogner db1225d061 llvm-profdata: Check for bad data in the show command
llvm-svn: 204573
2014-03-23 20:55:53 +00:00
Justin Bogner 423380f9a2 llvm-profdata: Use Format.h instead of handrolling a formatter
llvm-svn: 204571
2014-03-23 20:43:50 +00:00
David Majnemer 9338984f57 WinCOFF: Add support for -ffunction-sections
This is a pretty straight forward translation for COFF, we just need to
stick the function in a COMDAT section marked as
IMAGE_COMDAT_SELECT_NODUPLICATES.

llvm-svn: 204565
2014-03-23 17:47:39 +00:00
Nuno Lopes 31617266ea remove a bunch of unused private methods
found with a smarter version of -Wunused-member-function that I'm playwing with.
Appologies in advance if I removed someone's WIP code.

 include/llvm/CodeGen/MachineSSAUpdater.h            |    1 
 include/llvm/IR/DebugInfo.h                         |    3 
 lib/CodeGen/MachineSSAUpdater.cpp                   |   10 --
 lib/CodeGen/PostRASchedulerList.cpp                 |    1 
 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp    |   10 --
 lib/IR/DebugInfo.cpp                                |   12 --
 lib/MC/MCAsmStreamer.cpp                            |    2 
 lib/Support/YAMLParser.cpp                          |   39 ---------
 lib/TableGen/TGParser.cpp                           |   16 ---
 lib/TableGen/TGParser.h                             |    1 
 lib/Target/AArch64/AArch64TargetTransformInfo.cpp   |    9 --
 lib/Target/ARM/ARMCodeEmitter.cpp                   |   12 --
 lib/Target/ARM/ARMFastISel.cpp                      |   84 --------------------
 lib/Target/Mips/MipsCodeEmitter.cpp                 |   11 --
 lib/Target/Mips/MipsConstantIslandPass.cpp          |   12 --
 lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp              |   21 -----
 lib/Target/NVPTX/NVPTXISelDAGToDAG.h                |    2 
 lib/Target/PowerPC/PPCFastISel.cpp                  |    1 
 lib/Transforms/Instrumentation/AddressSanitizer.cpp |    2 
 lib/Transforms/Instrumentation/BoundsChecking.cpp   |    2 
 lib/Transforms/Instrumentation/MemorySanitizer.cpp  |    1 
 lib/Transforms/Scalar/LoopIdiomRecognize.cpp        |    8 -
 lib/Transforms/Scalar/SCCP.cpp                      |    1 
 utils/TableGen/CodeEmitterGen.cpp                   |    2 
 24 files changed, 2 insertions(+), 261 deletions(-)

llvm-svn: 204560
2014-03-23 17:09:26 +00:00
Hal Finkel 4a912250fa [PowerPC] Make use of VSX f64 <-> i64 conversion instructions
When VSX is available, these instructions should be used in preference to the
older variants that only have access to the scalar floating-point registers.

llvm-svn: 204559
2014-03-23 05:35:00 +00:00
Lang Hames 459b5dc39e Revert r204076 for now - it caused significant regressions in a number of
benchmarks.

<rdar://problem/16368461>

llvm-svn: 204558
2014-03-23 04:22:31 +00:00
Duncan P. N. Exon Smith 4680361d7c InstrProf: Check pointer size in raw profile
Since the profile can come from 32-bit machines, we need to check the
pointer size.  Change the magic number to facilitate this.

Adds tests for reading 32-bit and 64-bit binaries (both big- and
little-endian).  The tests write a binary using printf in RUN lines
(like raw-magic-but-no-header.test).  Assuming the bots don't complain,
this seems like a better way forward for testing RawInstrProfReader than
committing binary files.

<rdar://problem/16400648>

llvm-svn: 204557
2014-03-23 03:38:12 +00:00
Rafael Espindola a6e3a599d1 Propagate types from symbol to aliases.
This is similar, but not identical to what gas does. The logic in MC is to just
compute the symbol table after parsing the entire file. GAS is mixed, given

.type b, @object
a = b
b:
.type b, @function

It will propagate the change and make 'a' a function. Given

.type b, @object
b:
a = b
.type b, @function

the type of 'a' is still object.

Since we do the computation in the end, we produce a function in both cases.

llvm-svn: 204555
2014-03-23 03:33:20 +00:00
NAKAMURA Takumi d3415c2440 [CMake] LLVMProfileData: No need to add LINK_LIBS here. LLVMBuild should do.
llvm-svn: 204553
2014-03-23 01:23:36 +00:00
NAKAMURA Takumi 8971fcae25 llvm-profdata doesn't require LLVMCore.
llvm-svn: 204552
2014-03-23 01:23:26 +00:00
Justin Bogner 957a2944df llvm-profdata: Don't pipe stderr into show for the tests
Some text shows up on stderr when using guard malloc, and this test
was trying to treat that as input to llvm-profdata show. There's no
reason to pipe stderr into show at all here.

llvm-svn: 204549
2014-03-22 23:53:43 +00:00
Craig Topper a9253267a9 Prune includes in ARM target.
llvm-svn: 204548
2014-03-22 23:51:00 +00:00
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
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
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
NAKAMURA Takumi d1c22bef6f Suppress SupportTests.LockFileManagerTest on win32 for investigating.
llvm-svn: 204533
2014-03-22 00:27:17 +00:00
Adrian Prantl ca2728ec22 Delete stale comment. Thanks, Eric!
llvm-svn: 204530
2014-03-21 22:58:25 +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
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
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
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
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 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
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
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 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
Justin Bogner 47b8768fc0 ProfileData: Avoid brace initialization, windows doesn't like it
llvm-svn: 204494
2014-03-21 18:22:16 +00:00
Matt Arsenault 8e2581b11e R600/SI: Move instruction patterns to scalar versions.
Some of them also had the pattern on both, so this removes the
duplication.

llvm-svn: 204492
2014-03-21 18:01:18 +00:00
Rafael Espindola d2bd8def3f Remove redundant test.
This is tested from MC already.

llvm-svn: 204491
2014-03-21 18:00:51 +00:00
Rafael Espindola 734f105379 Move codegen test over to MC.
llvm-svn: 204490
2014-03-21 17:55:34 +00:00
Justin Bogner b9bd7f85a7 ProfileData: Introduce InstrProfWriter using the naive text format
This isn't a format we'll want to write out in practice, but moving it
to the writer library simplifies llvm-profdata and isolates it from
further changes to the format.

This also allows us to update the tests to not rely on the text output
format.

llvm-svn: 204489
2014-03-21 17:46:22 +00:00