1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

17327 Commits

Author SHA1 Message Date
Chandler Carruth
632fcee01a Switch CodeMetrics itself over to use TTI to determine if an instruction
is free. The whole CodeMetrics API should probably be reworked more, but
this is enough to allow deleting the duplicate code there for computing
whether an instruction is free.

All of the passes using this have been updated to pull in TTI and hand
it to the CodeMetrics stuff. Further, a dead CodeMetrics API
(analyzeFunction) is nuked for lack of users.

llvm-svn: 173036
2013-01-21 13:04:33 +00:00
Chandler Carruth
ba32c4f085 Fix indentation and formatting.
This change brought to by clang-format. =]

llvm-svn: 173034
2013-01-21 12:14:42 +00:00
Chandler Carruth
6607b69d72 Now that the inline cost analysis is a pass, we can easily have it
depend on and use other analyses (as long as they're either immutable
passes or CGSCC passes of course -- nothing in the pass manager has been
fixed here). Leverage this to thread TargetTransformInfo down through
the inline cost analysis.

No functionality changed here, this just threads things through.

llvm-svn: 173031
2013-01-21 11:55:09 +00:00
Chandler Carruth
d8a3f95fb1 Make the inline cost a proper analysis pass. This remains essentially
a dynamic analysis done on each call to the routine. However, now it can
use the standard pass infrastructure to reference other analyses,
instead of a silly setter method. This will become more interesting as
I teach it about more analysis passes.

This updates the two inliner passes to use the inline cost analysis.
Doing so highlights how utterly redundant these two passes are. Either
we should find a cheaper way to do always inlining, or we should merge
the two and just fiddle with the thresholds to get the desired behavior.
I'm leaning increasingly toward the latter as it would also remove the
Inliner sub-class split.

llvm-svn: 173030
2013-01-21 11:39:18 +00:00
Chandler Carruth
8c97596ffb Fix an old-style doxygen comment.
llvm-svn: 173027
2013-01-21 11:39:12 +00:00
Chandler Carruth
bf1318fb55 Cleanup the formatting of this header. This removes the namespace indent
and reformats a few constructors using clang-format. Only whitespace
changes here.

llvm-svn: 173018
2013-01-21 10:08:42 +00:00
Michael J. Spencer
2a2e500f2f Revert "[Object] .bss sections have no content. PR15005."
This reverts commit r173007.

llvm-svn: 173012
2013-01-21 08:13:04 +00:00
Michael J. Spencer
0ca0490f83 [Object] .bss sections have no content. PR15005.
llvm-svn: 173007
2013-01-21 06:46:11 +00:00
Chandler Carruth
b0321f928d Remove the comma from the last enumerator to fix -pedantic warnings.
llvm-svn: 172999
2013-01-21 02:17:36 +00:00
Chandler Carruth
6fdaccc9cd Introduce a generic interface for querying an operation's expected
lowered cost.

Currently, this is a direct port of the logic implementing
isInstructionFree in CodeMetrics. The hope is that the interface can be
improved (f.ex. supporting un-formed instruction queries) and the
implementation abstracted so that as we have test cases and target
knowledge we can expose increasingly accurate heuristics to clients.

I'll start switching existing consumers over and kill off the routine in
CodeMetrics in subsequent commits.

llvm-svn: 172998
2013-01-21 01:27:39 +00:00
NAKAMURA Takumi
9bc551d3f8 Support/Compiler.h: MSC1600, aka VS2010, is not C++11-ready.
LLVM_HAS_CXX11_TYPETRAITS -- std::is_constructible
LLVM_HAS_CXX11_STDLIB -- std::unique_ptr

llvm-svn: 172997
2013-01-21 00:30:31 +00:00
Renato Golin
5260b180e5 Revert CostTable algorithm, will re-write
llvm-svn: 172992
2013-01-20 20:57:20 +00:00
Michael J. Spencer
74395cc7b4 [Support] Port ErrorOr<T> from lld to C++03.
llvm-svn: 172991
2013-01-20 20:32:30 +00:00
Michael Gottesman
9d9d4177c8 Changed IRBuilder::CreateZExtOrTrunc and IRBuilder::CreateSExtOrTrunc so they also work with vectors.
I also changed the name of a variable in IRBuilder::CreateFPExtOrFPTrunc to
match the names used in its two matching brethern as well.

llvm-svn: 172967
2013-01-20 07:33:26 +00:00
Michael Gottesman
267605ce40 More copy editing.
llvm-svn: 172962
2013-01-20 05:12:35 +00:00
Michael Gottesman
dbf99c2186 Doxygenified and copy edited BasicBlock.h.
llvm-svn: 172961
2013-01-20 05:03:42 +00:00
Michael Gottesman
e10d38568b Doxygenified Argument.h and performed some copy editing of the documentation.
llvm-svn: 172960
2013-01-20 05:03:39 +00:00
Michael Gottesman
227fb44dae Converted all method comments in IRBuilder.h to use doxygen style comments.
This implies changing method documentation from the following style:

/// MethodName - Method description...

to

/// \brief Method description...

ala the LLVM Style Guide.

llvm-svn: 172959
2013-01-20 05:03:37 +00:00
Michael Gottesman
5716eb1faa Corrected assert messages for CreateZExtOrTrunc/CreateSExtOrTrunc.
llvm-svn: 172958
2013-01-20 04:19:39 +00:00
Michael Gottesman
613607db03 Added IRBuilder::CreateFPExtOrFPTrunc.
This method serves an analogous purpose to CreateZExtOrTrunc/CreateSExtOrTrunc
but for floating point types.

In detail, it provides a manner when one is handling conversions of floating
point types of automatically selecting fpext, fptrunc, or identity depending on
the relative bitsize of the source and destination types.

llvm-svn: 172957
2013-01-20 03:56:31 +00:00
Chris Lattner
c4e6c445bc trivial micro-optimization: lazily call the virtual method instead of eagerly calling it.
llvm-svn: 172953
2013-01-20 02:54:05 +00:00
Chris Lattner
8d845237cb switch llvm-bcanalyzer onto the new cursor APIs, allowing deletion of
the old ReadRecord methods.

llvm-svn: 172952
2013-01-20 02:50:32 +00:00
Chris Lattner
ffaa6ec19b add an option to not auto-process abbreviations in advance()
llvm-svn: 172946
2013-01-20 02:12:39 +00:00
Chris Lattner
2d0eb94aea stringref'ize readRecord and properly capitalize it. Add a compatibility method to easy
the transition.

llvm-svn: 172940
2013-01-20 01:06:48 +00:00
Chris Lattner
9ae8e75d23 move some private methods out of line, add a skipRecord() method.
llvm-svn: 172931
2013-01-20 00:00:00 +00:00
Chris Lattner
c77969940a add some optional flags to affect the way advance works.
llvm-svn: 172928
2013-01-19 23:31:15 +00:00
Chris Lattner
4589d285da Add a new BitstreamEntry concept, and add two helper methods for walking
through a BitstreamCursor that produce it: advance() and 
advanceSkippingSubblocks(), representing the two most common ways clients
want to walk through bitcode.

llvm-svn: 172919
2013-01-19 21:35:24 +00:00
Jakub Staszak
69044702f5 Include Support/ELF.h instead of Object/ELF.h. It is much lighter and completely
sufficient.

llvm-svn: 172916
2013-01-19 19:56:11 +00:00
Chris Lattner
1eaf2fb33a BitstreamReader hasn't aged well. It's been hacked on by various people and
has past the point of making sense.  Lets tidy things up: first step, moving
a ton of big functions out of line.

llvm-svn: 172904
2013-01-19 18:19:39 +00:00
Chandler Carruth
7c0d682f47 Sort all of the includes. Several files got checked in with mis-sorted
includes.

llvm-svn: 172891
2013-01-19 08:03:47 +00:00
Andrew Kaylor
2840f10066 Fixing behavior of ELFObjectFile::getSymbolFileOffset().
llvm-svn: 172872
2013-01-18 23:40:42 +00:00
Bill Wendling
7777bbbbf3 Use AttributeSet accessor methods instead of Attribute accessor methods.
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.

llvm-svn: 172853
2013-01-18 21:53:16 +00:00
Bill Wendling
3d4b33ca13 Remove unused parameter. Also use the AttributeSet query methods instead of the Attribute query methods.
llvm-svn: 172852
2013-01-18 21:50:24 +00:00
Jordan Rose
4de2cdf763 Add llvm::hexDigitValue to convert single characters to hex.
This is duplicated in a couple places in the codebase. Adopt this in APFloat.

llvm-svn: 172851
2013-01-18 21:45:30 +00:00
Jack Carter
3f50a8d5c0 This is a resubmittal. For some reason it broke the bots yesterday
but I cannot reproduce the problem and have scrubed my sources and
even tested with llvm-lit -v --vg.
Support for Mips register information sections.

Mips ELF object files have a section that is dedicated
to register use info. Some of this information such as
the assumed Global Pointer value is used by the linker
in relocation resolution.

The register info file is .reginfo in o32 and .MIPS.options
in 64 and n32 abi files.

This patch contains the changes needed to create the sections,
but leaves the actual register accounting for a future patch.


Contributer: Jack Carter
 
llvm-svn: 172847
2013-01-18 21:20:38 +00:00
Bill Wendling
b5ddc9a5f8 Push some more methods down to hide the use of the Attribute class.
Because the Attribute class is going to stop representing a collection of
attributes, limit the use of it as an aggregate in favor of using AttributeSet.
This replaces some of the uses for querying the function attributes.

llvm-svn: 172844
2013-01-18 21:11:39 +00:00
Daniel Dunbar
c3319a35d0 [Linker] Zap a dead typedef.
llvm-svn: 172841
2013-01-18 20:08:09 +00:00
Daniel Dunbar
9f18b39611 [Linker] Kill Linker::LoadObject which is dead, and drop the BitReader dependency again.
llvm-svn: 172838
2013-01-18 19:37:11 +00:00
Will Dietz
8f6c040948 Move Blacklist.h to include/ to enable use from clang.
llvm-svn: 172806
2013-01-18 11:29:21 +00:00
Daniel Dunbar
1cb39fe210 [MC/Mach-O] Add support for linker options in Mach-O files.
llvm-svn: 172779
2013-01-18 01:26:07 +00:00
Daniel Dunbar
4f5f37798a [MC/Mach-O] Add AsmParser support for .linker_option directive.
llvm-svn: 172778
2013-01-18 01:25:48 +00:00
Daniel Dunbar
870ae74b9b [MC] Expose ParseEscapedString to target AsmParser implementations.
llvm-svn: 172777
2013-01-18 01:25:33 +00:00
Bill Wendling
9449705327 Reverting r171325 & r172363. This was causing a mis-compile on the self-hosted LTO build bots.
Okay, here's how to reproduce the problem:

1) Build a Release (or Release+Asserts) version of clang in the normal way.

2) Using the clang & clang++ binaries from (1), build a Release (or
   Release+Asserts) version of the same sources, but this time enable LTO ---
   specify the `-flto' flag on the command line.

3) Run the ARC migrator tests:

    $ arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ ./src/tools/clang/test/ARCMT/cxx-rewrite.mm

You'll see that the output isn't correct (the whitespace is off).

The mis-compile is in the function `RewriteBuffer::RemoveText' in the
clang/lib/Rewrite/Core/Rewriter.cpp file. When that function and RewriteRope.cpp
are compiled with LTO and the `arcmt-test' executable is regenerated, you'll see
the error. When those files are not LTO'ed, then the output of the `arcmt-test'
is fine.

It is *really* hard to get a testcase out of this. I'll file a PR with what I
have currently.

--- Reverse-merging r172363 into '.':
U    include/llvm/Analysis/MemoryBuiltins.h
U    lib/Analysis/MemoryBuiltins.cpp

--- Reverse-merging r171325 into '.':
U    test/Transforms/InstCombine/objsize.ll
G    include/llvm/Analysis/MemoryBuiltins.h
G    lib/Analysis/MemoryBuiltins.cpp

llvm-svn: 172756
2013-01-17 21:28:46 +00:00
Aaron Ballman
9f5e7fbd5c Reverting back to the fallback instead of using the 64-bit popcnt instruction as it doesn't exist on all x64 CPU architectures.
llvm-svn: 172751
2013-01-17 20:04:28 +00:00
Daniel Dunbar
788e6c1c16 [Linker] Drop support for IR-level extended linking support (archives, etc.).
- This code is dead, and the "right" way to get this support is to use the
   platform-specific linker-integrated LTO mechanisms, or the forthcoming LLVM
   linker.

llvm-svn: 172749
2013-01-17 19:52:25 +00:00
Chad Rosier
bb513e22fa [ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.
Part of rdar://12576868

llvm-svn: 172743
2013-01-17 19:21:48 +00:00
Aaron Ballman
84f436abf8 Reverting back to the fallback instead of using popcnt; this instruction doesn't exist on all CPU architectures. Fixes PR14982
llvm-svn: 172734
2013-01-17 18:27:30 +00:00
Alexey Samsonov
fdff1da8c4 ASan: add optional 'zero-based shadow' option to ASan passes. Always tell the values of shadow scale and offset to the runtime
llvm-svn: 172709
2013-01-17 11:12:32 +00:00
Jakob Stoklund Olesen
10c1e03917 Move MachineTraceMetrics.h into include/llvm/CodeGen.
Let targets use it.

llvm-svn: 172688
2013-01-17 01:06:04 +00:00
Jakob Stoklund Olesen
4cc85cb304 Provide a place for targets to insert ILP optimization passes.
Move the early if-conversion pass into this group.

ILP optimizations usually need to find the right balance between
register pressure and ILP using the MachineTraceMetrics analysis to
identify critical paths and estimate other costs. Such passes should run
together so they can share dominator tree and loop info analyses.

Besides if-conversion, future passes to run here here could include
expression height reduction and ARM's MLxExpansion pass.

llvm-svn: 172687
2013-01-17 00:58:38 +00:00