Commit Graph

165173 Commits

Author SHA1 Message Date
Chandler Carruth b8ddc7043c [PM] Rename the IR printing pass header to a more generic and correct
name to match the source file which I got earlier. Update the include
sites. Also modernize the comments in the header to use the more
recommended doxygen style.

llvm-svn: 199041
2014-01-12 11:10:32 +00:00
Chandler Carruth a54dc82e33 [PM] Un-indent this file-level namespace. It's far more common to not
indent the outer-most llvm namespace in header files.

llvm-svn: 199040
2014-01-12 10:56:57 +00:00
Chandler Carruth 6546cb6313 [PM] Fix a bunch of bugs I spotted by inspection when working on this
code. Copious tests added to cover these cases.

llvm-svn: 199039
2014-01-12 10:02:02 +00:00
Chandler Carruth d833098d17 [PM] Add support for parsing function passes and function pass manager
nests to the opt commandline support. This also showcases the
implicit-initial-manager support which will be most useful for testing.
There are several bugs that I spotted by inspection here that I'll fix
with test cases in subsequent commits.

llvm-svn: 199038
2014-01-12 09:34:22 +00:00
Jakob Stoklund Olesen b81eb3eb51 SPARC passes non-trivial C++ objects indirectly like everybody else.
llvm-svn: 199037
2014-01-12 06:54:56 +00:00
Saleem Abdulrasool bdae4b8743 ARM IAS: fix diagnostics of improper qualification
An improper qualifier would result in a superfluous error due to the parser not
consuming the remainder of the statement.  Simply consume the remainder of the
statement to avoid the error.

llvm-svn: 199035
2014-01-12 05:25:44 +00:00
Jakob Stoklund Olesen 8d7f5066bf MIPS and SPARC assemblers both take the -KPIC flag.
llvm-svn: 199034
2014-01-12 04:53:36 +00:00
Venkatraman Govindaraju cd4d9ac62a [Sparc] Add support for parsing floating point instructions.
llvm-svn: 199033
2014-01-12 04:48:54 +00:00
Saleem Abdulrasool fb3950ec63 ARM: change implicit immediate forms of {ld,st}r{,b}t to psuedo-instructions
The implicit immediate 0 forms are assembly aliases, not distinct instruction
encodings.  Fix the initial implementation introduced in r198914 to an alias to
avoid two separate instruction definitions for the same encoding.

An InstAlias is insufficient in this case as the necessary due to the need to
add a new additional operand for the implicit zero.  By using the AsmPsuedoInst,
fall back to the C++ code to transform the instruction to the equivalent
_POST_IMM form, inserting the additional implicit immediate 0.

llvm-svn: 199032
2014-01-12 04:36:01 +00:00
Venkatraman Govindaraju 0b9debf1f6 [Sparc] Replace (unsigned)-1 with ~OU as suggested by Reid Kleckner.
llvm-svn: 199031
2014-01-12 04:34:31 +00:00
Jakob Stoklund Olesen e7084a1c5c The SPARCv9 ABI returns a float in %f0.
This is different from the argument passing convention which puts the
first float argument in %f1.

With this patch, all returned floats are treated as if the 'inreg' flag
were set. This means multiple float return values get packed in %f0,
%f1, %f2, ...

Note that when returning a struct in registers, clang will set the
'inreg' flag on the return value, so that behavior is unchanged. This
also happens when returning a float _Complex.

llvm-svn: 199028
2014-01-12 04:13:17 +00:00
Joerg Sonnenberger 4bde03023b Typo
llvm-svn: 199027
2014-01-12 03:38:30 +00:00
Joerg Sonnenberger 485f00fe0f Add missing mul aliases for armv4 support. Add checks that armv4 can
assemble the various mul instructions.

llvm-svn: 199026
2014-01-12 03:35:18 +00:00
Hans Wennborg ac114a3ce7 Switch-to-lookup tables: Don't require a result for the default
case when the lookup table doesn't have any holes.

This means we can build a lookup table for switches like this:

  switch (x) {
    case 0: return 1;
    case 1: return 2;
    case 2: return 3;
    case 3: return 4;
    default: exit(1);
  }

The default case doesn't yield a constant result here, but that doesn't matter,
since a default result is only necessary for filling holes in the lookup table,
and this table doesn't have any holes.

This makes us transform 505 more switches in a clang bootstrap, and shaves 164 KB
off the resulting clang binary.

llvm-svn: 199025
2014-01-12 00:44:41 +00:00
Venkatraman Govindaraju a66b314c34 [Sparc] Add missing processor types: v7 and niagara
llvm-svn: 199024
2014-01-11 23:56:13 +00:00
Saleem Abdulrasool 2d48edeca3 ARM IAS: support emitting constant values in target expressions
A 32-bit immediate value can be formed from a constant expression and loaded
into a register.  Add support to emit this into an object file.  Because this
value is a constant, a relocation must *not* be produced for it.

llvm-svn: 199023
2014-01-11 23:03:48 +00:00
Rui Ueyama 415625028c [PECOFF] Support VERSION directive.
llvm-svn: 199022
2014-01-11 22:45:00 +00:00
Rui Ueyama 605f7791a3 Make anonymous namespace as small as possible.
llvm-svn: 199021
2014-01-11 22:15:54 +00:00
Rui Ueyama b214e1aba2 [PECOFF] Support NAME directive.
llvm-svn: 199020
2014-01-11 21:53:46 +00:00
Rui Ueyama 66a4445658 [PECOFF] Add a helper function to read an integer from .def file.
llvm-svn: 199019
2014-01-11 21:37:25 +00:00
Rui Ueyama 6cc96bf2d2 [PECOFF] Print a better error message for unknown module-definition file directive.
llvm-svn: 199018
2014-01-11 21:24:43 +00:00
Benjamin Kramer 06e0dadede test case hygiene.
llvm-svn: 199017
2014-01-11 21:22:35 +00:00
Benjamin Kramer c10563d14e Fix broken CHECK lines.
llvm-svn: 199016
2014-01-11 21:06:00 +00:00
Arnold Schwaighofer 66c742aeea LoopVectorizer: Enable strided memory accesses versioning per default
I saw no compile or execution time regressions on x86_64 -mavx -O3.

radar://13075509

llvm-svn: 199015
2014-01-11 20:40:34 +00:00
Venkatraman Govindaraju 0653218b2b [Sparc] Bundle instruction with delay slow and its filler. Now, we can use -verify-machineinstrs with SPARC backend.
llvm-svn: 199014
2014-01-11 19:38:03 +00:00
Benjamin Kramer 2210562249 Make helper function static.
llvm-svn: 199013
2014-01-11 18:42:35 +00:00
Jakob Stoklund Olesen 58801bf1dc Select the UltraSPARC instruction set when invoking the assembler.
llvm-svn: 199012
2014-01-11 18:25:01 +00:00
Alp Toker 749971901a lit: Provide source locations in cfg files with older Python versions
This commit prospectively brings the benefits of r198766 to older supported
Python versions (2.5+).

Tested with Python 2.6, 2.7, 3.1 and 3.3 (!)

llvm-svn: 199009
2014-01-11 14:34:18 +00:00
Alp Toker 798060e006 Fix 'ned' typo in doc comment
Patch by Jasper Neumann!

llvm-svn: 199007
2014-01-11 14:01:43 +00:00
Alp Toker f0a245944e lit: execfile() isn't present in Python 3.3
On the other hand, exec(compile()) doesn't work in older Python versions in the
2.x series.

This commit introduces exec(compile()) with a fallback to plain exec(). That'll
hopefully hit the sweet spot in terms of version support.

Followup to r198766 which added enhanced source locations for lit cfg parsing.

llvm-svn: 199006
2014-01-11 13:27:28 +00:00
Chandler Carruth 258dbb3b12 [PM] Actually nest pass managers correctly when parsing the pass
pipeline string. Add tests that cover this now that we have execution
dumping in the pass managers.

llvm-svn: 199005
2014-01-11 12:06:47 +00:00
Chandler Carruth a13f27cc34 [PM] Add names to passes under the new pass manager, and a debug output
mode that can be used to debug the execution of everything.

No support for analyses here, that will come later. This already helps
show parts of the opt commandline integration that isn't working. Tests
of that will start using it as the bugs are fixed.

llvm-svn: 199004
2014-01-11 11:52:05 +00:00
Chandler Carruth d7693d8444 [PM] Somehow I missed the header guards on this file. Yikes!
llvm-svn: 199003
2014-01-11 10:59:00 +00:00
NAKAMURA Takumi 41c409ce0d LoopVectorize.cpp: Appease MSC16.
Excuse me, I hope msc16 builders would be fine till its end day.
Introduce nullptr then. ;)

llvm-svn: 199001
2014-01-11 09:59:27 +00:00
NAKAMURA Takumi a64d0bccc8 llvm/test/Transforms/SampleProfile/syntax.ll: Eliminate locale-sensitive message check.
llvm-svn: 199000
2014-01-11 09:23:52 +00:00
NAKAMURA Takumi 80a474c1c3 llvm/test/CodeGen/X86/anyregcc.ll: Add explicit -mtriple=x86_64-unknown-unknown.
XMM(s) are really spilling for targeting Win64.

llvm-svn: 198999
2014-01-11 09:23:44 +00:00
Chandler Carruth 66445382ff [PM] Add (very skeletal) support to opt for running the new pass
manager. I cannot emphasize enough that this is a WIP. =] I expect it
to change a great deal as things stabilize, but I think its really
important to get *some* functionality here so that the infrastructure
can be tested more traditionally from the commandline.

The current design is looking something like this:

  ./bin/opt -passes='module(pass_a,pass_b,function(pass_c,pass_d))'

So rather than custom-parsed flags, there is a single flag with a string
argument that is parsed into the pass pipeline structure. This makes it
really easy to have nice structural properties that are very explicit.
There is one obvious and important shortcut. You can start off the
pipeline with a pass, and the minimal context of pass managers will be
built around the entire specified pipeline. This makes the common case
for tests super easy:

  ./bin/opt -passes=instcombine,sroa,gvn

But this won't introduce any of the complexity of the fully inferred old
system -- we only ever do this for the *entire* argument, and we only
look at the first pass. If the other passes don't fit in the pass
manager selected it is a hard error.

The other interesting aspect here is that I'm not relying on any
registration facilities. Such facilities may be unavoidable for
supporting plugins, but I have alternative ideas for plugins that I'd
like to try first. My plan is essentially to build everything without
registration until we hit an absolute requirement.

Instead of registration of pass names, there will be a library dedicated
to parsing pass names and the pass pipeline strings described above.
Currently, this is directly embedded into opt for simplicity as it is
very early, but I plan to eventually pull this into a library that opt,
bugpoint, and even Clang can depend on. It should end up as a good home
for things like the existing PassManagerBuilder as well.

There are a bunch of FIXMEs in the code for the parts of this that are
just stubbed out to make the patch more incremental. A quick list of
what's coming up directly after this:
- Support for function passes and building the structured nesting.
- Support for printing the pass structure, and FileCheck tests of all of
  this code.
- The .def-file based pass name parsing.
- IR priting passes and the corresponding tests.

Some obvious things that I'm not going to do right now, but am
definitely planning on as the pass manager work gets a bit further:
- Pull the parsing into library, including the builders.
- Thread the rest of the target stuff into the new pass manager.
- Wire support for the new pass manager up to llc.
- Plugin support.

Some things that I'd like to have, but are significantly lower on my
priority list. I'll get to these eventually, but they may also be places
where others want to contribute:
- Adding nice error reporting for broken pass pipeline descriptions.
- Typo-correction for pass names.

llvm-svn: 198998
2014-01-11 08:16:35 +00:00
Nick Lewycky 7dae818117 Whoops! Fix major think-o in the first example in the documentation that I edited at 3am.
llvm-svn: 198997
2014-01-11 02:55:22 +00:00
Nick Lewycky 35a6ef4c35 Add a new attribute 'enable_if' which can be used to control overload resolution based on the values of the function arguments at the call site.
llvm-svn: 198996
2014-01-11 02:50:57 +00:00
Nick Lewycky 5641233047 Use the appropriate SourceLocation for the template backtrace when doing
template argument deduction.

llvm-svn: 198995
2014-01-11 02:37:12 +00:00
Rui Ueyama 6a5f7c22ad [PECOFF] Support HEAPSIZE directive.
llvm-svn: 198994
2014-01-11 01:58:21 +00:00
Rui Ueyama f98a18acb7 [PECOFF] Refactor module-defintion file parser.
Refactor the parser so that the parser can return arbitrary type of parse
result other than a vector of ExportDesc. Parsers for non-EXPORTS directives
will be implemented in different patches. No functionality change.

llvm-svn: 198993
2014-01-11 01:33:42 +00:00
Richard Smith 454b4af0b0 PR12208: Under -fno-elide-constructors, don't forget to actually copy an NRVO
variable to the return slot. Patch by David Wiberg, with test case alterations
by me.

llvm-svn: 198991
2014-01-11 01:24:05 +00:00
Jim Ingham 55d3a0c3d4 Sometimes the trampoline refers directly to the indirect symbol. Handle that too.
llvm-svn: 198990
2014-01-11 01:21:50 +00:00
Warren Hunt 9425891f28 [ms-abi] Change the way alignment is tracked
This patch more cleanly seperates the concepts of Preferred Alignment 
and Required Alignment.  Most notable that changes to Required Alignment 
do *not* impact preferred alignment until late in struct layout.  This 
is observable when using pragma pack and non-virtual bases and the use 
of tail padding when laying them out.

Test cases included.

llvm-svn: 198988
2014-01-11 01:16:40 +00:00
Nick Kledzik 8293c711e7 [yaml] use BumpPtrAllocator for string copies
llvm-svn: 198987
2014-01-11 01:11:49 +00:00
Nick Kledzik 6edd722a2c [mach-o] enable mach-o and native yaml to be intermixed
The main goal of this patch is to allow "mach-o encoded as yaml" and "native
encoded as yaml" documents to be intermixed.  They are distinguished via 
yaml tags at the start of the document.  This will enable all mach-o test cases
to be written using yaml instead of checking in object files.

The Registry was extend to allow yaml tag handlers to be registered.  The
mach-o Reader adds a yaml tag handler for the tag "!mach-o". 

Additionally, this patch fixes some buffer ownership issues.  When parsing
mach-o binaries, the mach-o atoms can have pointers back into the memory 
mapped .o file.  But with yaml encoded mach-o, name and content are ephemeral, 
so a copyRefs parameter was added to cause the mach-o atoms to make their
own copy.  

llvm-svn: 198986
2014-01-11 01:07:43 +00:00
Juergen Ributzka 976d94b834 [anyregcc] Fix callee-save mask for anyregcc
Use separate callee-save masks for XMM and YMM registers for anyregcc on X86 and
select the proper mask depending on the target cpu we compile for.

llvm-svn: 198985
2014-01-11 01:00:27 +00:00
Greg Clayton fd6e4b91b7 Make sure to cleanup the "dwarf-lookups.txt" log file.
llvm-svn: 198984
2014-01-11 00:54:56 +00:00
Richard Smith 6fa28ffd5a Fix "regression" caused by updating our notion of POD to better match the C++11
rules: instead of requiring flexible array members to be POD, require them to
be trivially-destructible. This seems to be the only constraint that actually
matters here (and even then, it's questionable whether this matters).

llvm-svn: 198983
2014-01-11 00:53:35 +00:00