Commit Graph

30225 Commits

Author SHA1 Message Date
David Goodwin 6deba28c6f Fix frame index elimination to correctly handle thumb-2 addressing modes that don't allow negative offsets. During frame elimination convert *i12 opcode to a *i8 when necessary due to a negative offset.
llvm-svn: 76883
2009-07-23 17:06:46 +00:00
Andreas Bolka c8cd3f6959 Cache dependence computation using FoldingSet.
This introduces an LDA-internal DependencePair class. The intention is,
that this is a place where dependence testers can store various results
such as SCEVs describing conflicting iterations, breaking conditions,
distance/direction vectors, etc.

llvm-svn: 76877
2009-07-23 14:32:46 +00:00
Evan Cheng edda8cbfad 80 col violation.
llvm-svn: 76872
2009-07-23 07:58:08 +00:00
Chris Lattner 88ab854873 refactor a blob of code out to a new 'FoldOrOfFCmps' function and
simplify it.

llvm-svn: 76866
2009-07-23 05:46:22 +00:00
Lang Hames 077415e84b For real this time: PHI Def & Kill tracking added to PHIElimination.
llvm-svn: 76865
2009-07-23 05:44:24 +00:00
Chris Lattner 7d55541e56 Make some existing optimizations that would only trigger on scalars
also apply to vectors.  This allows us to compile this:

#include <emmintrin.h>
__m128i a(__m128 a, __m128 b) { return a==a & b==b; }
__m128i b(__m128 a, __m128 b) { return a!=a | b!=b; }

to:

_a:
	cmpordps	%xmm1, %xmm0
	ret
_b:
	cmpunordps	%xmm1, %xmm0
	ret

with clang instead of to a ton of horrible code.

llvm-svn: 76863
2009-07-23 05:32:17 +00:00
Chris Lattner 9085438e4b refactor a bunch of code out into a helper function,
no functionality change.

llvm-svn: 76859
2009-07-23 05:14:02 +00:00
Lang Hames a77a3c3782 Added PHI Def & Kill tracking to PHIElimination pass.
llvm-svn: 76849
2009-07-23 04:34:03 +00:00
Eric Christopher b1b77ca862 Support insertps via the intrinsic and add a couple of simple
testcases to make sure it's being generated.

llvm-svn: 76843
2009-07-23 02:22:41 +00:00
Sanjiv Gupta 56df1e7969 Do not call getMangledName on Intrinsics.
llvm-svn: 76842
2009-07-23 02:11:04 +00:00
Devang Patel 6292003492 MDString
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.

llvm-svn: 76841
2009-07-23 02:00:51 +00:00
Andreas Bolka 897e68c660 Minor cosmetics: indentation, formatting, naming.
llvm-svn: 76839
2009-07-23 01:57:06 +00:00
Reid Kleckner 921673225c Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Zhongxing Xu 57421f3e0f add header for 'memset'.
llvm-svn: 76837
2009-07-23 01:38:47 +00:00
Devang Patel c698122d34 Silence "uninitialized use" warning.
llvm-svn: 76836
2009-07-23 01:36:16 +00:00
Devang Patel e059ba6ed2 Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Eric Christopher fef8db605d Fix error message for correct opcode.
llvm-svn: 76829
2009-07-23 01:01:32 +00:00
Reid Kleckner 1a722d9b73 Make the JIT code emitter properly retry and ask for more memory when it runs
out of memory, and also make the default memory manager allocate more memory
when it runs out.

Also, switch function stubs and global data over to using the BumpPtrAllocator.

This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB
of memory, and instead allocates in 512K slabs.  I suspect this size could go
lower, especially on embedded platforms, now that more slabs can be allocated.

llvm-svn: 76828
2009-07-23 00:49:59 +00:00
Reid Kleckner 5bd6105d65 Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
malloc, so there should be no functional changes to other code.

These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.

I also added some tests which helped me pinpoint some bugs.

llvm-svn: 76825
2009-07-23 00:30:41 +00:00
Chris Lattner d2aeef0703 remove SectionFlags::Small: it is only used on Xcore, and we'll find
a better solution for it in the future.

llvm-svn: 76818
2009-07-22 23:27:22 +00:00
Dan Gohman 824ab40381 x86 isel tweak: use lea (%reg,%reg) instead of lea (,%reg,2).
llvm-svn: 76817
2009-07-22 23:26:55 +00:00
Dan Gohman 902dfff8b6 Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap.

llvm-svn: 76810
2009-07-22 22:44:56 +00:00
David Greene 1164d1f283 Reorder if-else branches as suggested by Bill.
llvm-svn: 76808
2009-07-22 22:32:19 +00:00
David Goodwin a0b2dc93b5 Fix typo in addrmode definition.
llvm-svn: 76806
2009-07-22 22:24:31 +00:00
Evan Cheng e270d4a4dd Use getTargetConstant instead of getConstant since it's meant as an constant operand.
llvm-svn: 76803
2009-07-22 22:03:29 +00:00
David Greene e88680e33e Constify the key in Mi2IndexMap.
llvm-svn: 76801
2009-07-22 21:56:14 +00:00
Evan Cheng d2d52d1906 Ignore undef uses.
llvm-svn: 76799
2009-07-22 21:51:42 +00:00
Daniel Dunbar 5899dda08c Switch some clients to Value::getName(), and other getName() user
simplification.
 - NFC

llvm-svn: 76789
2009-07-22 21:33:09 +00:00
Devang Patel 096ecf1bed Fix indentation.
llvm-svn: 76787
2009-07-22 21:10:50 +00:00
Daniel Dunbar 99abb47dd6 Simplify some uses of Value::getName()
llvm-svn: 76786
2009-07-22 21:10:12 +00:00
Daniel Dunbar 0989a9a338 Remove unnecessary store to temporary std::string.
llvm-svn: 76782
2009-07-22 20:46:46 +00:00
David Greene 6e2eda1c8d Put comment printing under asm-verbose.
llvm-svn: 76780
2009-07-22 20:33:26 +00:00
Daniel Dunbar ed1c14ba65 Fix indentation.
llvm-svn: 76778
2009-07-22 20:26:37 +00:00
David Greene 1e2a04ba99 Make some changes suggested by Bill and Evan.
llvm-svn: 76775
2009-07-22 20:08:25 +00:00
Devang Patel e85806f0d1 Fix thinko.
llvm-svn: 76769
2009-07-22 18:56:16 +00:00
Devang Patel 75094f8e83 Use isa<> instead of dyn_cast<>.
llvm-svn: 76767
2009-07-22 18:35:25 +00:00
Devang Patel f03c9bec63 Add replaceAllUsesWith() to FE replace debug info constructs while building complex types.
llvm-svn: 76765
2009-07-22 18:23:44 +00:00
Devang Patel e171bc8ae5 Do not print "metadata" twice while printing MDString.
This fixes unittest failure.

llvm-svn: 76764
2009-07-22 18:10:23 +00:00
Evan Cheng 1ec4396ee3 Eliminate a redudant check Eli pointed out.
llvm-svn: 76762
2009-07-22 18:08:05 +00:00
Sanjiv Gupta 8f3169cf4a Fixed build warning. No functionality change.
llvm-svn: 76761
2009-07-22 17:58:47 +00:00
Devang Patel 7428d8acec Introduce MetadataBase, a base class for MDString and MDNode.
Derive MDString directly from MetadataBase. 
Introduce new bitcode block to hold metadata.

llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Chris Lattner 637ca93fc4 doxygenify
llvm-svn: 76750
2009-07-22 16:53:56 +00:00
Duncan Sands c0647b31ee Add newline at end of file.
llvm-svn: 76736
2009-07-22 13:20:41 +00:00
Richard Osborne 4f7f19a7c0 Thread local globals don't require special handling by the linker and so can
be placed in the standard data / bss sections.

llvm-svn: 76735
2009-07-22 11:01:00 +00:00
Duncan Sands 0cf7f5d6d2 Revert commit 76707, it was breaking the llvm-gcc build
on linux platforms.  The binutils assembler does not
recognize the "s" flag, see for example
http://sourceware.org/binutils/docs/as/Section.html 

llvm-svn: 76733
2009-07-22 10:35:05 +00:00
Eli Friedman 315596c39c Don't give a massive inlining cost bonus to available_externally
functions with a single use; eliminating the single use may eliminate 
the function from the current module, but usually doesn't eliminate 
it from the final program.

llvm-svn: 76730
2009-07-22 08:12:59 +00:00
Evan Cheng 4b02b2f79c Don't forget D16 - D31 are clobbered by calls and sjlj eh.
llvm-svn: 76729
2009-07-22 06:46:53 +00:00
Evan Cheng 6253a19651 Add R12 to the list of registers clobbered by 16-bit Thumb calls as a pre-caution. r12 could be live once we have mixed 32-bit and 16-bit instructions.
llvm-svn: 76728
2009-07-22 06:37:28 +00:00
Evan Cheng eadb6681cf Fix a obvious copy-n-paste bug.
llvm-svn: 76727
2009-07-22 06:12:40 +00:00
Evan Cheng 2e1d66847c Get rid one of the getRegisterNumbering. Also add D16 - D31.
llvm-svn: 76725
2009-07-22 05:55:18 +00:00