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

8644 Commits

Author SHA1 Message Date
Owen Anderson
48d53f2c53 Add a portable wrapper for reader-writer locks.
llvm-svn: 73545
2009-06-16 20:19:28 +00:00
Douglas Gregor
f5291553f2 Introduce new headers whose inclusion forces linking and
initialization of all targets (InitializeAllTargets.h) or assembler
printers (InitializeAllAsmPrinters.h). This is a step toward the
elimination of relinked object files, so that we can build normal
archives.

llvm-svn: 73543
2009-06-16 20:12:29 +00:00
Anton Korobeynikov
cc8d0058e2 Address review comments: add 3 ARM calling conventions.
Dispatch C calling conv. to one of these conventions based on
target triple and subtarget features.

llvm-svn: 73530
2009-06-16 18:50:49 +00:00
Owen Anderson
8a07791070 Add a configure check for pthread_rwlock_init.
llvm-svn: 73523
2009-06-16 18:20:20 +00:00
Owen Anderson
b7cdd1a395 Split the thread-related APIs out into their own file, and add a few more
calls for convenience.

llvm-svn: 73512
2009-06-16 17:33:51 +00:00
Chris Lattner
574c5de9f8 Generalize instcombine's isSafeToLoadUnconditionally() function
to ignore readonly calls, and factor it out of instcombine so
that it can be used by other passes.  Patch by Frits van Bommel!

llvm-svn: 73506
2009-06-16 17:23:12 +00:00
Sanjiv Gupta
30e21aabcb Fixed names of libcalls checked in r73480.
llvm-svn: 73483
2009-06-16 10:22:58 +00:00
Sanjiv Gupta
00e60c0154 Added required libcalls for PIC16 (mostly floating points to integer casting operations).
llvm-svn: 73480
2009-06-16 09:03:58 +00:00
Dan Gohman
b501e5ddbd Add comments to ConstantInt::get and ConstantFP::get to more fully
describe their behavior.

llvm-svn: 73454
2009-06-16 01:02:32 +00:00
Owen Anderson
3234d9d040 Owen Anderson 2009-06-15: Use a SmallPtrSet here, for speed and to match df_iterator.
Owen Anderson 2009-06-15: Remember to clear out our maps to prevent crashing.

llvm-svn: 73438
2009-06-15 22:54:48 +00:00
Dan Gohman
cccda40191 Add a CreateFNeg function to IRBuilder.
llvm-svn: 73437
2009-06-15 22:50:40 +00:00
Dan Gohman
2e737ac21f Support vector casts in more places, fixing a variety of assertion
failures.

To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.

Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.

llvm-svn: 73431
2009-06-15 22:12:54 +00:00
Anton Korobeynikov
536048774c Address more comments :)
llvm-svn: 73430
2009-06-15 22:08:48 +00:00
Anton Korobeynikov
f734bdb5df Document ABIType enum. Patch by Sandeep Patel!
llvm-svn: 73427
2009-06-15 21:46:02 +00:00
Evan Cheng
3219c7fbe5 Part 1.
- Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent.
- Allow targets to specify alternative register allocation orders based on allocation hint.

Part 2.
- Use the register allocation hint system to implement more aggressive load / store multiple formation.
- Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g.
v1025 = LDR v1024, 0
v1026 = LDR v1024, 0
=>
v1025,v1026 = LDRD v1024, 0

If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair.

- Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions.

This is work in progress, not yet enabled.

llvm-svn: 73381
2009-06-15 08:28:29 +00:00
Chris Lattner
dfaaf63aff add a new static method to portably determine whether a patch is
absolute or not, based on a patch by Gregory Curfman!

llvm-svn: 73368
2009-06-15 04:17:07 +00:00
Dan Gohman
111f127d23 Fix old-style type names in comments.
llvm-svn: 73362
2009-06-14 23:30:43 +00:00
Dan Gohman
dda7e316db Specialize DenseMapInfo for SCEVHandle, so that SCEVHandles can be
used as keys in DenseMaps.

llvm-svn: 73360
2009-06-14 22:55:07 +00:00
Dan Gohman
d895ed43c8 Convert several parts of the ScalarEvolution framework to use
SmallVector instead of std::vector.

llvm-svn: 73357
2009-06-14 22:47:23 +00:00
Evan Cheng
1607bd1fa9 Move register allocation preference (or hint) from LiveInterval to MachineRegisterInfo. This allows more passes to set them.
llvm-svn: 73346
2009-06-14 20:22:55 +00:00
Owen Anderson
6aa3d83630 Add an early implementation of a partial inlining pass. The idea behind this
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.

This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.

llvm-svn: 73338
2009-06-14 08:26:32 +00:00
Bruno Cardoso Lopes
d73d79eaf9 Introduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject.h by Aaron Gray
llvm-svn: 73333
2009-06-14 07:53:21 +00:00
Dan Gohman
25827fdc12 Add a ScalarEvolution::getAnyExtendExpr utility function for performing
extension with unspecified bits.

llvm-svn: 73293
2009-06-13 15:56:47 +00:00
Bruno Cardoso Lopes
9cb41aaf57 Type change cleanup on JCE and MCE. Patch by Aaron Gray
llvm-svn: 73271
2009-06-12 23:51:56 +00:00
Bruno Cardoso Lopes
2b429fb48f Use forward declarations and move TargetELFWriterInfo impl to a new file.
llvm-svn: 73209
2009-06-11 22:13:00 +00:00
Bill Wendling
038b8dd7b5 Remove unused parameter warnings.
llvm-svn: 73202
2009-06-11 20:10:02 +00:00
Bruno Cardoso Lopes
9b68e8653f Support for ELF Visibility
Emission for globals, using the correct data sections
Function alignment can be computed for each target using TargetELFWriterInfo
Some small fixes

llvm-svn: 73201
2009-06-11 19:16:03 +00:00
Duncan Sands
9b5e3effef Cosmetic changes to parameter attribute verification.
llvm-svn: 73188
2009-06-11 08:11:03 +00:00
Jay Foad
5affd7b2c9 Implement and use new method Function::hasAddressTaken().
llvm-svn: 73164
2009-06-10 08:41:11 +00:00
Sanjiv Gupta
02c9163ae2 Remove warnings: no newline at end of file.
llvm-svn: 73156
2009-06-10 03:42:13 +00:00
Owen Anderson
996a7f7f37 Add the beginnings of an implementatation of lazy liveness analysis, based on "Fast Liveness Checking for SSA-form Programs" by Boissinot, et al.
This is still very early, hasn't been tested, and is not yet well documented.  More to come soon.

llvm-svn: 73141
2009-06-09 19:30:45 +00:00
David Greene
3f7cc686d9 Change IndexedModeAction representation.
This changes the IndexedModeAction representation to remove the
limitation on the number of value types in MVT.  This limitation
prevents us from specifying AVX types.

Prior to this change IndexedModActions was represented as follows...

uint64_t IndexedModeActions[2][ISD::LAST_INDEXED_MODE];

the first dimension was used to represent loads, then stores.  This
imposed a limitation of 32 on the number of value types that could be
handled with this method.  The value type was used to shift the two bits
into and out of the approprate bits in the uint64_t.

With this change the array is now represented as ...

uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][2][ISD::LAST_INDEXED_MODE];

Takes more space but removes the limitation on MVT::LAST_VALUETYPE.  The
first dimension is now the value_type for the reference.  The second
dimension is the load [0] vs. store[1].  The third dimension represents
the various modes for load store.  Accesses are now direct, no shifting
or masking.

There are other limitations that need to be removed, so that
MVT::LAST_VALUETYPE can be greater than 32.  This is merely the first
step towards that goal.

llvm-svn: 73104
2009-06-09 00:19:10 +00:00
David Greene
00c5ffe4d4 Oops, didn't mean to commit 73102 yet. Revert it.
llvm-svn: 73103
2009-06-08 23:54:42 +00:00
David Greene
901b8d38f4 Change IndexedModeAction representation.
This changes the IndexedModeAction representation to remove the
limitation on the number of value types in MVT.  This limitation
prevents us from specifying AVX types.

Prior to this change IndexedModActions was represented as follows...

uint64_t IndexedModeActions[2][ISD::LAST_INDEXED_MODE];

the first dimension was used to represent loads, then stores.  This
imposed a limitation of 32 on the number of value types that could be
handled with this method.  The value type was used to shift the two bits
into and out of the approprate bits in the uint64_t.

With this change the array is now represented as ...

uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][2][ISD::LAST_INDEXED_MODE];

Takes more space but removes the limitation on MVT::LAST_VALUETYPE.  The
first dimension is now the value_type for the reference.  The second
dimension is the load [0] vs. store[1].  The third dimension represents
the various modes for load store.  Accesses are now direct, no shifting
or masking.

There are other limitations that need to be removed, so that
MVT::LAST_VALUETYPE can be greater than 32.  This is merely the first
step towards that goal.

llvm-svn: 73102
2009-06-08 23:53:19 +00:00
Anton Korobeynikov
d08df21f36 The attached patches implement most of the ARM AAPCS-VFP hard float
ABI. The missing piece is support for putting "homogeneous aggregates"
into registers.

Patch by Sandeep Patel!

llvm-svn: 73095
2009-06-08 22:53:56 +00:00
David Greene
62a2f2fb97 Make IntInits and ListInits typed. This helps deduce types of !if and
other operators.  For the rare cases where a list type cannot be
deduced, provide a []<type> syntax, where <type> is the list element
type.

llvm-svn: 73078
2009-06-08 20:23:18 +00:00
Bruno Cardoso Lopes
cfa07266cf Simple ELF32/64 binary files can now be emitted for x86 and x86_64 without
relocation sections.

llvm-svn: 73038
2009-06-07 21:22:38 +00:00
Nick Lewycky
71dc3c5d85 Create FunctionType::isValidArgumentType to go along with isValidReturnType.
Also create isValidElementType for ArrayType, PointerType, StructType and
VectorType.

Make LLParser use them. This closes up some holes like an assertion failure on:

  %x = type {label}

but largely doesn't change any semantics. The only thing we accept now which
we didn't before is vectors of opaque type such as "<4 x opaque>". The opaque
can be resolved to an int or float when linking.

llvm-svn: 73016
2009-06-07 07:26:46 +00:00
Dan Gohman
5470ba421d Rename UnknownValue to CouldNotCompute, since it holds an instance of
SCEVCouldNotCompute, and not SCEVUnknown.

llvm-svn: 72999
2009-06-06 14:37:11 +00:00
Bruno Cardoso Lopes
b3b24681ca Remove elf specific info from ELFWriter.h to Elf.h. Code cleanup and more comments added
llvm-svn: 72982
2009-06-06 03:56:29 +00:00
Douglas Gregor
472479c173 More portability checks for CMake's config.h.
llvm-svn: 72975
2009-06-05 23:46:34 +00:00
Devang Patel
8d170194e8 Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.

llvm-svn: 72959
2009-06-05 21:57:13 +00:00
Nate Begeman
058d4eeccf Adapt the x86 build_vector dagcombine to the current state of the legalizer.
build vectors with i64 elements will only appear on 32b x86 before legalize.
Since vector widening occurs during legalize, and produces i64 build_vector 
elements, the dag combiner is never run on these before legalize splits them
into 32b elements.

Teach the build_vector dag combine in x86 back end to recognize consecutive 
loads producing the low part of the vector.

Convert the two uses of TLI's consecutive load recognizer to pass LoadSDNodes
since that was required implicitly.

Add a testcase for the transform.

Old:
	subl	$28, %esp
	movl	32(%esp), %eax
	movl	4(%eax), %ecx
	movl	%ecx, 4(%esp)
	movl	(%eax), %eax
	movl	%eax, (%esp)
	movaps	(%esp), %xmm0
	pmovzxwd	%xmm0, %xmm0
	movl	36(%esp), %eax
	movaps	%xmm0, (%eax)
	addl	$28, %esp
	ret

New:
	movl	4(%esp), %eax
	pmovzxwd	(%eax), %xmm0
	movl	8(%esp), %eax
	movaps	%xmm0, (%eax)
	ret

llvm-svn: 72957
2009-06-05 21:37:30 +00:00
Dan Gohman
856e18c047 Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
llvm-svn: 72949
2009-06-05 16:35:53 +00:00
Dan Gohman
5f6f8101d5 Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Devang Patel
9757e4f9f3 Add new function attribute - noredzone.
Update code generator to use this attribute and remove DisableRedZone target option.
Update llc to set this attribute when -disable-red-zone command line option is used.

llvm-svn: 72894
2009-06-04 22:05:33 +00:00
Douglas Gregor
8de3150a4d Properly detect malloc_zone_statistics in CMake build system
llvm-svn: 72873
2009-06-04 17:22:52 +00:00
Torok Edwin
a10c3b9bc6 Fix comments.
llvm-svn: 72858
2009-06-04 08:18:25 +00:00
Torok Edwin
5da9f51d1e Add support for outputting ANSI colors to raw_fd_ostream.
llvm-svn: 72854
2009-06-04 07:09:50 +00:00
Nick Kledzik
870391a06e <rdar://problem/6940611> libLTO.dylib needs to let linker specify path to assembler
Add lto_codegen_set_assembler_path() API which allows the linker to specify the
path to the assembler tool to run.  When assembler is used (instead of compiler)
different command line options are used.
Add LTO_API_VERSION #define so clients (linkers) can conditionalize use of new APIs.

llvm-svn: 72823
2009-06-04 00:28:45 +00:00