Commit Graph

8680 Commits

Author SHA1 Message Date
Dan Gohman
a7a8af0c58 Add a CreateFNeg function to IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:50:40 +00:00
Dan Gohman
6de29f8d96 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:12:54 +00:00
Anton Korobeynikov
0d492bdf4d Address more comments :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:08:48 +00:00
Anton Korobeynikov
52edfc7a6d Document ABIType enum. Patch by Sandeep Patel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 21:46:02 +00:00
Evan Cheng
358dec5180 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 08:28:29 +00:00
Chris Lattner
88d7e403d0 add a new static method to portably determine whether a patch is
absolute or not, based on a patch by Gregory Curfman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 04:17:07 +00:00
Dan Gohman
a119de86a0 Fix old-style type names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 23:30:43 +00:00
Dan Gohman
444f49150d Specialize DenseMapInfo for SCEVHandle, so that SCEVHandles can be
used as keys in DenseMaps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 22:55:07 +00:00
Dan Gohman
a82752c9eb Convert several parts of the ScalarEvolution framework to use
SmallVector instead of std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 22:47:23 +00:00
Evan Cheng
90f95f88c6 Move register allocation preference (or hint) from LiveInterval to MachineRegisterInfo. This allows more passes to set them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 20:22:55 +00:00
Owen Anderson
ca399021d4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 08:26:32 +00:00
Bruno Cardoso Lopes
ae9163f0e2 Introduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject.h by Aaron Gray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 07:53:21 +00:00
Dan Gohman
2ce84c8d47 Add a ScalarEvolution::getAnyExtendExpr utility function for performing
extension with unspecified bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13 15:56:47 +00:00
Bruno Cardoso Lopes
7e0b551e2a Type change cleanup on JCE and MCE. Patch by Aaron Gray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 23:51:56 +00:00
Bruno Cardoso Lopes
d00d4159d4 Use forward declarations and move TargetELFWriterInfo impl to a new file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 22:13:00 +00:00
Bill Wendling
5e0644c73e Remove unused parameter warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 20:10:02 +00:00
Bruno Cardoso Lopes
c997d45ae5 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 19:16:03 +00:00
Duncan Sands
d6de30ceea Cosmetic changes to parameter attribute verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 08:11:03 +00:00
Jay Foad
757068f3ba Implement and use new method Function::hasAddressTaken().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-10 08:41:11 +00:00
Sanjiv Gupta
cb597c9cc4 Remove warnings: no newline at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-10 03:42:13 +00:00
Owen Anderson
6cbd8da86e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-09 19:30:45 +00:00
David Greene
f5aefbdb79 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-09 00:19:10 +00:00
David Greene
63ec51d86b Oops, didn't mean to commit 73102 yet. Revert it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 23:54:42 +00:00
David Greene
9df4eb8cfe 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 23:53:19 +00:00
Anton Korobeynikov
0eebf653a7 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 22:53:56 +00:00
David Greene
e1b469170b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 20:23:18 +00:00
Bruno Cardoso Lopes
a029a27fae Simple ELF32/64 binary files can now be emitted for x86 and x86_64 without
relocation sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 21:22:38 +00:00
Nick Lewycky
a5f54a06b0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 07:26:46 +00:00
Dan Gohman
86fbf2fe4c Rename UnknownValue to CouldNotCompute, since it holds an instance of
SCEVCouldNotCompute, and not SCEVUnknown.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 14:37:11 +00:00
Bruno Cardoso Lopes
f5b0c5a1c7 Remove elf specific info from ELFWriter.h to Elf.h. Code cleanup and more comments added
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 03:56:29 +00:00
Douglas Gregor
318de60701 More portability checks for CMake's config.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 23:46:34 +00:00
Devang Patel
578efa920a 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 21:57:13 +00:00
Nate Begeman
abc0199680 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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 21:37:30 +00:00
Dan Gohman
1d09de3eca Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:35:53 +00:00
Dan Gohman
ae3a0be92e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:49:04 +00:00
Devang Patel
d18e31ae17 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:05:33 +00:00
Douglas Gregor
ef23d711bc Properly detect malloc_zone_statistics in CMake build system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 17:22:52 +00:00
Torok Edwin
6c8db34165 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 08:18:25 +00:00
Torok Edwin
e8ebb0fe1b Add support for outputting ANSI colors to raw_fd_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 07:09:50 +00:00
Nick Kledzik
cbad586240 <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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 00:28:45 +00:00
Bruno Cardoso Lopes
186c670e15 Use uint8_t and int32_t in {JIT,Machine}CodeEmiters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 00:15:51 +00:00
Daniel Dunbar
e0f0e0be1c Change LTO to run the global opt pass twice.
- This matches llvm-ld.

It took a bit of archeology to figure out what the right thing to do was
(whether this was intentionally added or intentionally removed). My final
conclusion is that Chris added this intentionally here:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=16913
but the changes weren't propogated to llvm-ld until here:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=34058
which was after lto.cpp had been cloned off (of llvm-ld), here:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=29494

From the commit message, it looks like the motivation for running global opt
again is because we ran it prior to inlining. Based on that I updated the
comment and also only run the pass if we actually ran the inliner.

Chris, please review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 21:51:32 +00:00
Eli Friedman
a8ba2c25e9 PR4317: Handle splits where the new block is unreachable correctly in
DominatorTreeBase::Split.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 21:42:06 +00:00
Daniel Dunbar
006a034828 Add createStandardLTOPasses to StandardPasses.h, and move lto and llvm-ld over.
- I know it sounds crazy, but I think all the pass lists are now coalesced into
   StandardPasses.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 21:06:14 +00:00
Daniel Dunbar
e98c4d0b10 Remove some silly code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 18:13:05 +00:00
Daniel Dunbar
04d5f44882 Add StandardPasses.h which embeds the standard compilation passes shared by
clang/llvm-gcc.
 - Implemented as inline functions for linking simplicity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 17:52:39 +00:00
Bruno Cardoso Lopes
bae049cd9e Revert 72650
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72783 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 16:55:02 +00:00
Dan Gohman
b3ae97cffe Change TargetFolder's TD member from a reference to a
pointer, now that ConstantFoldConstantExpression can
accept a null TargetData pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 00:13:48 +00:00
Dan Gohman
7714285efd Change ConstantFoldConstantExpression to accept a null
TargetData pointer. The only thing it's used for are
calls to ConstantFoldCompareInstOperands and
ConstantFoldInstOperands, which both already accept a
null TargetData pointer. This makes
ConstantFoldConstantExpression easier to use in clients
where TargetData is optional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-02 21:48:15 +00:00
Dan Gohman
014d53595c Delete an unnecessary forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-02 21:37:43 +00:00