Commit Graph

108459 Commits

Author SHA1 Message Date
Jim Grosbach 166cd88645 Move Thumb tail call pseudos to Thumb.td file.
Fix a FIXME.

llvm-svn: 134727
2011-07-08 20:13:35 +00:00
Eli Friedman 71123fc422 Fix dangling pointer.
llvm-svn: 134725
2011-07-08 20:07:05 +00:00
Evan Cheng 22e9d8f40e TargetAsmParser doesn't need reference to Target.
llvm-svn: 134721
2011-07-08 19:33:14 +00:00
Benjamin Kramer 6a24f9487a Remove unused copy of UpdateInlinedAtInfo.
llvm-svn: 134720
2011-07-08 19:32:06 +00:00
Jim Grosbach dbfb29d6c0 Use ARMPseudoExpand for ARM tail calls.
llvm-svn: 134719
2011-07-08 18:50:22 +00:00
Jim Ingham 368c6301a2 remove errant parenthesis.
llvm-svn: 134717
2011-07-08 18:34:32 +00:00
Greg Clayton affb03b7fb Fixed a few issues where typedefs weren't passing through to the correct
recursive function.

Also fixed ClangASTContext::IsPointerType to correctly NULL out the pointee
handle if a valid one is provided.

llvm-svn: 134715
2011-07-08 18:27:39 +00:00
Jim Grosbach 7ddc1d709f Shuffle productions around a bit.
No functional change.

llvm-svn: 134714
2011-07-08 18:26:27 +00:00
Jim Grosbach 2dfe8e3ccd Use ARMPseudoExpand for BLr9, BLr9_pred, BXr9, and BXr9_pred.
TableGen'erated MC lowering pseudo-expansion.

llvm-svn: 134712
2011-07-08 18:15:12 +00:00
Evan Cheng 1a6d551f7f Fix a dangling reference. Patch by Dave Abrahams. pr10311
llvm-svn: 134709
2011-07-08 18:04:22 +00:00
Devang Patel 35797406a5 Refactor. It is inliner's responsibility to update line number information.
llvm-svn: 134708
2011-07-08 18:01:31 +00:00
Chandler Carruth f21cebf6dd Add CMake support for the new TableGen file introduced in r134705.
llvm-svn: 134707
2011-07-08 17:54:08 +00:00
Fariborz Jahanian f2913401fc objc++-arc: more diagnosis of converting a weak-unavailable
object to a __weak object type. // rdar://9732636

llvm-svn: 134706
2011-07-08 17:41:42 +00:00
Jim Grosbach 95dee40343 Use TableGen'erated pseudo lowering for ARM.
Hook up the TableGen lowering for simple pseudo instructions for ARM and
use it for a subset of the many pseudos the backend has as proof of concept.

More conversions to come.

llvm-svn: 134705
2011-07-08 17:40:42 +00:00
Jim Grosbach bcb36be8e3 TableGen'erated MC lowering for simple pseudo-instructions.
This allows the (many) pseudo-instructions we have that map onto a single
real instruction to have their expansion during MC lowering handled
automatically instead of the current cumbersome manual expansion required.
These sorts of pseudos are common when an instruction is used in situations
that require different MachineInstr flags (isTerminator, isBranch, et. al.)
than the generic instruction description has. For example, using a move
to the PC to implement a branch.

llvm-svn: 134704
2011-07-08 17:36:35 +00:00
Devang Patel 2442a89eb9 Refactor.
llvm-svn: 134703
2011-07-08 17:09:57 +00:00
Devang Patel ed9fd45740 Make provision to have floating point constants in .debug_loc expressions.
llvm-svn: 134702
2011-07-08 16:49:43 +00:00
Douglas Gregor 6336f29669 Teach CXXUnresolvedConstructExpr when it should be an
lvalue/xvalue/rvalue, rather than just (incorrectly) assuming it's an
lvalue. Fixes PR10285 / <rdar://problem/9743926>.

llvm-svn: 134700
2011-07-08 15:50:43 +00:00
Benjamin Kramer 2bb8b26aa8 Apparently we can't expect a BinaryOperator here.
Should fix llvm-gcc selfhost.

llvm-svn: 134699
2011-07-08 12:08:24 +00:00
Chandler Carruth d280754094 Add several CFG-stress-testing input source files. These use the
preprocessor to build up very large CFGs in various shapes that can
produce different algorithmic behavior in CFG-walking code.

llvm-svn: 134698
2011-07-08 11:20:51 +00:00
Chandler Carruth a532863131 Make the worklist in the uninitialized values checker actually a queue.
Previously, despite the names 'enqueue' and 'dequeue', it behaved as
a stack and visited blocks in a LIFO fashion. This interacts badly with
extremely broad CFGs *inside* of a loop (such as a large switch inside
a state machine) where every block updates a different variable.

When encountering such a CFG, the checker visited blocks in essentially
a "depth first" order due to the stack-like behavior of the work list.
Combined with each block updating a different variable, the saturation
logic of the checker caused it to re-traverse blocks [1,N-1] of the
broad CFG inside the loop after traversing block N. These re-traversals
were to propagate the variable values derived from block N. Assuming
approximately the same number of variables as inner blocks exist, the
end result is O(N^2) updates. By making this a queue, we also make the
traversal essentially "breadth-first" across each of the N inner blocks
of the loop. Then all of this state is propagated around to all N inner
blocks of the loop. The result is O(N) updates.

The truth is in the numbers:
Before, gcc.c:   96409 block visits  (max: 61546,   avg: 591)
After,  gcc.c:   69958 block visits  (max: 33090,   avg: 429)
Before, PR10183: 2540494 block vists (max: 2536495, avg: 37360)
After,  PR10183: 137803 block visits (max: 134406,  avg: 2026)

The nearly 20x reduction in work for PR10183 corresponds to a roughly
100x speedup in compile time.

I've tested it on all the code I can get my hands on, and I've seen no
slowdowns due to this change. Where I've collected stats, the ammount of
work done is on average less. I'll also commit shortly some synthetic
test cases useful in analyzing the performance of CFG-based warnings.

Submitting this based on Doug's feedback that post-commit review should
be good. Ted, please review! Hopefully this helps compile times until
then.

llvm-svn: 134697
2011-07-08 11:19:06 +00:00
NAKAMURA Takumi 72a925540c cmake/modules/LLVMLibDeps.cmake: Update to appease cmake builds.
llvm-svn: 134696
2011-07-08 10:45:15 +00:00
Benjamin Kramer 9960a25006 Emit a more efficient magic number multiplication for exact sdivs.
We have to do this in DAGBuilder instead of DAGCombiner, because the exact bit is lost after building.

  struct foo { char x[24]; };
  long bar(struct foo *a, struct foo *b) { return a-b; }
is now compiled into
  movl	4(%esp), %eax
  subl	8(%esp), %eax
  sarl	$3, %eax
  imull	$-1431655765, %eax, %eax
instead of
  movl	4(%esp), %eax
  subl	8(%esp), %eax
  movl	$715827883, %ecx
  imull	%ecx
  movl	%edx, %eax
  shrl	$31, %eax
  sarl	$2, %edx
  addl	%eax, %edx
  movl	%edx, %eax

llvm-svn: 134695
2011-07-08 10:31:30 +00:00
Evan Cheng 491f56d41e Fix a FIXME in clang ARM driver that was exposed as a bug with ARM backend
change.

Previously clang was passing the following feature strings to the ARM backend
when CPU is cortex-a8: +neon,-vfp2,-vfp3

This used to work because -vfp2,-vfp3 had no effect after +neon. Now that the
features are controlled by individual bits (with implied hierarchy), the net
effect is all three features will be turned off.

llvm-svn: 134691
2011-07-08 06:40:11 +00:00
Francois Pichet 3a44e43d40 Random cleanup:
- fix a comment.
- Remove an unnecessary { } block.

llvm-svn: 134690
2011-07-08 06:21:47 +00:00
Jason Molenda d7298d3745 Rewrite get_kinfo_proc_for_pid() to get the kinfo_proc for
the one process we're interested in, instead of fetching all
of them and only keeping one.

(the old implementation made sense when we were doing the
initial find-this-process-by-pid-or-name by looking through
all the kinfo_procs.)

llvm-svn: 134686
2011-07-08 05:04:01 +00:00
Chandler Carruth 904cb14225 Remove a no-op break after a return, and correct one of the most
confusing indentations I've seen recently... Just noticed these while
making a change elsewhere.

No functionality changed.

llvm-svn: 134685
2011-07-08 04:59:44 +00:00
Chandler Carruth c5c3b0a25b Minor style cleanup.
Original patch by John Freeman, some style tweaks by me.

llvm-svn: 134683
2011-07-08 04:28:55 +00:00
Greg Clayton df0b7d5c31 LLDB now has a Kernel dynamic linker that can detect where kexts are
loaded. It locks onto *-apple-darwin binaries where the binary has
a "__KLD" segment. Soon I will modify the lldb_private::ObjectFile
class to return an executable type which will be an enum with values
something like:
eObjectFileTypeUserExectable,
eObjectFileTypeUserSharedLibrary,
eObjectFileTypeKernelExectable,
eObjectFileTypeKernelSharedLibrary,
eObjectFileTypeObjectFile,
eObjectFileTypeCoreFile

But for now we look at the section since a user and kernel mach-o
executable have the same mach-o file type.

llvm-svn: 134682
2011-07-08 04:11:42 +00:00
Greg Clayton 0d9fc764d2 Make the kernel able to do its initial load from target memory with the
process being preferred for all memory reads.

llvm-svn: 134681
2011-07-08 03:21:57 +00:00
Chandler Carruth 961995dc9a Update the creation of the TargetAsmParser based on API change in r134678.
llvm-svn: 134680
2011-07-08 03:15:48 +00:00
Enrico Granata fc7a7f3b75 final fix for the global constructors issue
new GetValueForExpressionPath() method in ValueObject to navigate expression paths in a more bitfield vs slices aware way
changes to the varformats.html document (WIP)

llvm-svn: 134679
2011-07-08 02:51:01 +00:00
Evan Cheng 4d1ca96bfc Eliminate asm parser's dependency on TargetMachine:
- Each target asm parser now creates its own MCSubtatgetInfo (if needed).
- Changed AssemblerPredicate to take subtarget features which tablegen uses
  to generate asm matcher subtarget feature queries. e.g.
  "ModeThumb,FeatureThumb2" is translated to
  "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0".

llvm-svn: 134678
2011-07-08 01:53:10 +00:00
Lang Hames 29cd98fd52 Make GVN look through extractvalues for recognised intrinsics. GVN can then CSE ops that match values produced by the intrinsics.
llvm-svn: 134677
2011-07-08 01:50:54 +00:00
Chandler Carruth 8ae50ad064 Tweak formatting.
llvm-svn: 134675
2011-07-08 01:04:24 +00:00
Chandler Carruth 2536c072f7 Switch the token-paste source locations inside of function style macro
argument expansion to use the macro argument source locations as well.
Add a few tests to exercise this. There is still a bit more work needed
here though.

llvm-svn: 134674
2011-07-08 01:04:21 +00:00
Johnny Chen f4e9a4c676 Rearranged the debug output to come before the assert for function name 'outer_inline'.
Right now clang-139 fails the test.

llvm-svn: 134673
2011-07-08 01:01:45 +00:00
Greg Clayton 7b242381b8 Added the start of the darwin dynamic loader plug-in. It isn't hooked up to
be detected yet, but most of the initial code is there and needs to be 
debugged more.

llvm-svn: 134672
2011-07-08 00:48:09 +00:00
Akira Hatanaka f9a85356bc Raise assertion when MachineOperand has unexpected target flag.
llvm-svn: 134671
2011-07-08 00:42:35 +00:00
Sean Callanan 77eaf442ce Audited the expression parser to find uninitialized
pointers.  Some of the spots are obviously initialized
later, but it's better just to NULL the pointers out
at initialization to make the code more robust when
exposed to later changes.

llvm-svn: 134670
2011-07-08 00:39:14 +00:00
Jason Molenda d9761cd466 Switch to using the S_ISDIR and S_ISREG sys/stat.h macros in
CommandCompletions.cpp and DataBufferMemoryMap.cpp.  The file type
part of the st_mode struct member is not a bitmask.

llvm-svn: 134669
2011-07-08 00:38:03 +00:00
Akira Hatanaka 8ccd65842d Make sure variable Kind is assigned a value to suppress warning.
llvm-svn: 134668
2011-07-08 00:26:25 +00:00
Jakob Stoklund Olesen bbe2a5cfff Fix more register allocation sensitive tests.
llvm-svn: 134667
2011-07-08 00:24:06 +00:00
Jakob Stoklund Olesen b138c44276 Remove a test that no longer makes sense.
It was testing a linear scan feature:

  Test if linearscan is unfavoring registers for allocation to allow
  more reuse of reloads from stack slots.

The greedy register allocator doesn't access any stack slots in this
function, so the linear scan feature was not being tested.

llvm-svn: 134666
2011-07-08 00:24:03 +00:00
Nick Lewycky 9badf60203 Let the inline asm 'q' constraint match float, and on 64-bit double too.
Fixes PR9602!

llvm-svn: 134665
2011-07-08 00:19:27 +00:00
Eric Christopher 7a2a0f80de Go ahead and emit the barrier on x86-64 even without sse2. The
processor supports it just fine.

Fixes PR9675 and rdar://9740801

llvm-svn: 134664
2011-07-08 00:04:56 +00:00
Howard Hinnant 3aa229f7dc provide ~future_error() definition
llvm-svn: 134663
2011-07-08 00:04:40 +00:00
Jason Molenda 4e0c94be76 Handle the possible case where the process launch failed
but we don't have an error message.

llvm-svn: 134662
2011-07-08 00:00:32 +00:00
Akira Hatanaka 9c6028f98e Lower MachineInstr to MC Inst and print to .s files.
llvm-svn: 134661
2011-07-07 23:56:50 +00:00
Chandler Carruth 402bb38823 Keep track of which source locations are part of a macro argument
instantiation and improve diagnostics which are stem from macro
arguments to trace the argument itself back through the layers of macro
expansion.

This requires some tricky handling of the source locations, as the
argument appears to be expanded in the opposite direction from the
surrounding macro. This patch provides helper routines that encapsulate
the logic and explain the reasoning behind how we step through macros
during diagnostic printing.

This fixes the rest of the test cases originially in PR9279, and later
split out into PR10214 and PR10215.

There is still some more work we can do here to improve the macro
backtrace, but those will follow as separate patches.

llvm-svn: 134660
2011-07-07 23:56:36 +00:00