Commit Graph

104209 Commits

Author SHA1 Message Date
Fariborz Jahanian b107143fed Fix a bug in calculation of composite type
of conditional expressions of objc pointer types
where one type is the immediate base type of the
other. // rdar://9296866

llvm-svn: 129718
2011-04-18 21:16:59 +00:00
Johnny Chen 1ee61a7f3b Add a test script for exercising the "taregt create", "target list", and "target select" commands.
llvm-svn: 129717
2011-04-18 21:08:05 +00:00
Eli Friedman b2545fbc2a malloc elimination: it's a bad idea to use raw_svector_ostream on a
small heap-allocated SmallString because it unconditionally forces a malloc.

(Revised version of r129688, with the necessary flush() call.)

llvm-svn: 129716
2011-04-18 20:54:46 +00:00
Devang Patel 17740e70d5 Reduce clutter in asm output. Do not emit source location as comment for each instruction.
llvm-svn: 129715
2011-04-18 20:26:49 +00:00
Jakob Stoklund Olesen 9f294a9e52 Handle spilling around an instruction that has an early-clobber re-definition of
the spilled register.

This is quite common on ARM now that some stores have early-clobber defines.

llvm-svn: 129714
2011-04-18 20:23:27 +00:00
Sean Callanan 5d73033e0f Small fix to the ARM AsmParser to ensure that a
superclass variable is instantiated properly.

llvm-svn: 129713
2011-04-18 20:20:44 +00:00
Daniel Dunbar 10d0868efb Driver: Support -fno-lto.
llvm-svn: 129712
2011-04-18 19:44:09 +00:00
Eric Christopher c37aa0b26a Fix a bug where we were counting the alias sets as completely used
registers for fast allocation a different way. This has us updating
used registers only when we're using that exact register.

Fixes rdar://9207598

llvm-svn: 129711
2011-04-18 19:26:25 +00:00
Johnny Chen d28977c7c2 Add header comment.
llvm-svn: 129710
2011-04-18 18:50:24 +00:00
Chandler Carruth 2b1ba48f8d Mark some functions as used which are used within debug-only code. This
silences Clang's -Wunused-function when building in release mode.

llvm-svn: 129709
2011-04-18 18:49:44 +00:00
Owen Anderson f2e8397b4b Enhance the fixed-length disassembler to support the callbacks necessary for symbolic disassembly.
llvm-svn: 129708
2011-04-18 18:42:26 +00:00
Johnny Chen 238de9a804 Add docstring.
llvm-svn: 129707
2011-04-18 18:34:09 +00:00
Johnny Chen 72f51aafe7 Modify some docstrings.
llvm-svn: 129706
2011-04-18 18:32:09 +00:00
Ted Kremenek 00abe8ee31 Add ToolChain path support for linker on Slackware.
llvm-svn: 129704
2011-04-18 17:50:19 +00:00
Devang Patel 43cfa5dce1 Fix typo in comment.
llvm-svn: 129703
2011-04-18 17:30:25 +00:00
Richard Smith 0c502d2a62 Fix PR9741. The implicit declarations created for range-based for loops weren't being added to the DeclContext (nor were they being marked as implicit). Also, the declarations were being emitted in the wrong order when building the CFG.
llvm-svn: 129700
2011-04-18 15:49:25 +00:00
Douglas Gregor 6c7a9eec42 When providing code completions of ivar names for a property
implementation such as

  @synthesize Prop1 = 

Give priority to ivars whose type matches or closely matches the
property type (as we do for several other kinds of
results). Additionally, if there is an ivar with the same name as the
property, or differs only due to a _ prefix or suffix, give that ivar
a priority bump. Finally, verify that this search is properly
returning ivars within class extensions and implementations
(<rdar://problem/8488854>).

llvm-svn: 129699
2011-04-18 14:40:46 +00:00
Anders Carlsson 566ae67ef8 Get rid of std::vector usage when getting function types in CGException.cpp
llvm-svn: 129698
2011-04-18 14:24:10 +00:00
Douglas Gregor 331faa0f73 When producing code completion results for the Objective-C property
implementation 

  @synthesize <property> = 

also produce a completion for a to-be-synthesized ivar named
_<property>.

llvm-svn: 129697
2011-04-18 14:13:53 +00:00
Anders Carlsson 7170f064c0 Make the empty StructType::get overload use an empty ArrayRef.
llvm-svn: 129696
2011-04-18 14:02:06 +00:00
Greg Clayton 7260f6206f Centralized a lot of the status information for processes,
threads, and stack frame down in the lldb_private::Process,
lldb_private::Thread, lldb_private::StackFrameList and the 
lldb_private::StackFrame classes. We had some command line
commands that had duplicate versions of the process status
output ("thread list" and "process status" for example). 

Removed the "file" command and placed it where it should
have been: "target create". Made an alias for "file" to
"target create" so we stay compatible with GDB commands.

We can now have multple usable targets in lldb at the
same time. This is nice for comparing two runs of a program
or debugging more than one binary at the same time. The
new command is "target select <target-idx>" and also to see
a list of the current targets you can use the new "target list"
command. The flow in a debug session can be:

(lldb) target create /path/to/exe/a.out
(lldb) breakpoint set --name main
(lldb) run
... hit breakpoint
(lldb) target create /bin/ls
(lldb) run /tmp
Process 36001 exited with status = 0 (0x00000000) 
(lldb) target list
Current targets:
  target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
* target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) target select 0
Current targets:
* target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
  target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) bt
* thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1
  frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16
  frame #1: 0x0000000100000b64 a.out`start + 52

Above we created a target for "a.out" and ran and hit a
breakpoint at "main". Then we created a new target for /bin/ls
and ran it. Then we listed the targest and selected our original
"a.out" program, so we showed two concurent debug sessions
going on at the same time.

llvm-svn: 129695
2011-04-18 08:33:37 +00:00
Chris Lattner 48f75ad678 while we're at it, handle 'sdiv exact' of a power of 2 also,
this fixes a few rejects on c++ iterator loops.

llvm-svn: 129694
2011-04-18 07:00:40 +00:00
Chris Lattner 562d6e82bd fix rdar://9297011 - udiv by power of two causing fast-isel rejects
llvm-svn: 129693
2011-04-18 06:55:51 +00:00
Chris Lattner 80254a53cc Add a new bit that ImmLeaf's can opt into, which allows them to duck out of
the generated FastISel.  X86 doesn't need to generate code to match ADD16ri8 
since ADD16ri will do just fine.  This is a small codesize win in the generated
instruction selector.

llvm-svn: 129692
2011-04-18 06:36:55 +00:00
Chris Lattner 07add49a4b Implement major new fastisel functionality: the matcher can now handle immediates with
value constraints on them (when defined as ImmLeaf's).  This is particularly important
for X86-64, where almost all reg/imm instructions take a i64immSExt32 immediate operand,
which has a value constraint.  Before this patch we ended up iseling the examples into
such amazing code as:

	movabsq	$7, %rax
	imulq	%rax, %rdi
	movq	%rdi, %rax
	ret

now we produce:

	imulq	$7, %rdi, %rax
	ret

This dramatically shrinks the generated code at -O0 on x86-64.

llvm-svn: 129691
2011-04-18 06:22:33 +00:00
Chris Lattner 353fda159d relax this test to just check that the lock prefix is encoded properly,
and to not rely on the register allocator's arbitrary operand choices.

llvm-svn: 129690
2011-04-18 06:15:35 +00:00
Eli Friedman 3f8ecf5cc5 Revert r129688; it's breaking buildbots.
llvm-svn: 129689
2011-04-18 05:54:54 +00:00
Eli Friedman 2dc287a147 More malloc elimination: it's a bad idea to use raw_svector_ostream on a
small heap-allocated SmallString because it unconditionally forces a malloc.

llvm-svn: 129688
2011-04-18 05:38:58 +00:00
Eli Friedman 0e40208d7b Make the StringMaps attached to MCContext use the MCContext's allocator;
reduces the number of calls to malloc().

llvm-svn: 129687
2011-04-18 05:02:31 +00:00
Anders Carlsson 73a559fe93 Use an empty ArrayRef instead of an empty std::vector for the Function::get overload that takes no parameters.
llvm-svn: 129686
2011-04-18 04:55:06 +00:00
NAKAMURA Takumi 6483513a6d docs: Redefine Heading elements as below;
H1 ... Title (and might be Chapter in future)
H2 ... Section
H3 ... Subsection
H4 ... Sub-subsection

llvm-svn: 129683
2011-04-18 01:17:51 +00:00
Anders Carlsson 940f02d248 Clean up code generation of typeid expressions and add C++ standard references.
llvm-svn: 129682
2011-04-18 00:57:03 +00:00
Anders Carlsson ce758c1d27 Put a typeid test in its own namespace.
llvm-svn: 129681
2011-04-17 23:33:40 +00:00
Chris Lattner 722f0ccdf9 introduce a new OpKind abstraction which wraps up operand flavors in a tidy little wrapper.
No functionality change.

llvm-svn: 129680
2011-04-17 23:29:05 +00:00
Chris Lattner 97bbee2fb4 Fix a miscompilation I introduced in r129652, thanks for Eli for tracking
it down.  we effectively were compile the testcase into:

void test14(int x) {
  switch (x) {
    case 11: break;
    case 42: test14(97);  // fallthrough
    default: test14(42); break;

which is not the same thing at all.  This fixes a miscompilation of 
MallocBench/gs seen on the clang-x86_64-linux-fnt buildbot.

llvm-svn: 129679
2011-04-17 23:21:26 +00:00
Chris Lattner 9080391b55 change OperandsSignature to use SmallVector<char> instead of std::vector<string>
since the strings are always exactly one character, and there are usually only 2-3 operands.

llvm-svn: 129678
2011-04-17 22:24:13 +00:00
Chris Lattner 0d7a5a7daa since the VT is fixed for a ImmLeaf, there is no reason to expose it to the matching code.
llvm-svn: 129677
2011-04-17 22:17:27 +00:00
Chris Lattner c479e0631f switch the rest of the x86 immediate patterns over to ImmLeaf,
simplifying them and exposing more information to tblgen.  It would be nice
if other target authors adopted this as well, particularly arm since it has fastisel.

llvm-svn: 129676
2011-04-17 22:12:55 +00:00
Chris Lattner 2ff8c1a25f now that predicates have a decent abstraction layer on them, introduce a new
kind of predicate: one that is specific to imm nodes.  The predicate function
specified here just checks an int64_t directly instead of messing around with
SDNode's.  The virtue of this is that it means that fastisel and other things
can reason about these predicates.

llvm-svn: 129675
2011-04-17 22:05:17 +00:00
Anders Carlsson 02feb58dd7 Use the right type name.
llvm-svn: 129674
2011-04-17 21:57:29 +00:00
Anders Carlsson fcaaa697ec When laying out bases in, always try the "base subobject" LLVM type. If it
turns out that a field or base needs to be laid out in the tail padding of
the base, CGRecordLayoutBuilder::ResizeLastBaseFieldIfNecessary will convert
it to an array of i8.

I've audited the new test results to make sure that they are still valid. I've
also verified that we pass a self-host with this change.

This (finally) fixes PR5589!

llvm-svn: 129673
2011-04-17 21:56:13 +00:00
Anders Carlsson 2caf2074fd Cleanup tests, no functionality change.
llvm-svn: 129672
2011-04-17 21:49:47 +00:00
Anders Carlsson 56c4d80a4e Add addBaseSubobjectTypeName which isn't used yet.
llvm-svn: 129671
2011-04-17 21:40:34 +00:00
Chris Lattner 514e292b72 Rework our internal representation of node predicates to expose more
structure and fix some fixmes.  We now have a TreePredicateFn class
that handles all of the decoding of these things.  This is an internal
cleanup that has no impact on the code generated by tblgen.

llvm-svn: 129670
2011-04-17 21:38:24 +00:00
Anders Carlsson c58f8cb7fc Move code to add a type name to a TagDecl type out into a helper function. No functionality change.
llvm-svn: 129669
2011-04-17 21:36:59 +00:00
Chris Lattner 4604bddc07 remove some debugging code I added.
llvm-svn: 129668
2011-04-17 21:36:19 +00:00
Anders Carlsson b6d31e7dcc Use a SmallVector for field types in CGRecordLayoutBuilder now that llvm::StructType::get takes an ArrayRef.
llvm-svn: 129667
2011-04-17 21:32:41 +00:00
Chris Lattner b53ccb8e36 1. merge fast-isel-shift-imm.ll into fast-isel-x86-64.ll
2. implement rdar://9289501 - fast isel should fold trivial multiplies to shifts
3. teach tblgen to handle shift immediates that are different sizes than the 
   shifted operands, eliminating some code from the X86 fast isel backend.
4. Have FastISel::SelectBinaryOp use (the poorly named) FastEmit_ri_ function
   instead of FastEmit_ri to simplify code.

llvm-svn: 129666
2011-04-17 20:23:29 +00:00
Michael J. Spencer a9e4117991 Make -mno-mmx imply -mno-3dnow. This is what gcc does, and it makes sense.
Also, fold the sse4 and sse4.1 cases together.

Patch by Alexander Best!

llvm-svn: 129665
2011-04-17 19:22:03 +00:00
Chris Lattner eb729d48ff fix an x86 fast isel issue where we'd completely give up on folding an address
when we have a global variable base an an index.  Instead, just give up on
folding the global variable.

Before we'd geenrate:

_test:                                  ## @test
## BB#0:
	movq	_rtx_length@GOTPCREL(%rip), %rax
	leaq	(%rax), %rax
	addq	%rdi, %rax
	movzbl	(%rax), %eax
	ret

now we generate:

_test:                                  ## @test
## BB#0:
	movq	_rtx_length@GOTPCREL(%rip), %rax
	movzbl	(%rax,%rdi), %eax
	ret

The difference is even more significant when there is a scale
involved.

This fixes rdar://9289558 - total fail with addr mode formation at -O0/x86-64

llvm-svn: 129664
2011-04-17 17:47:38 +00:00