Commit Graph

28775 Commits

Author SHA1 Message Date
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
Anton Korobeynikov
fbbf1eeccf Separate V6 from V6T2 since the latter has some extra nice instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 21:20:36 +00:00
Anton Korobeynikov
a7b0ded2a2 Add helper for checking of Thumb1 mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 20:31:02 +00:00
Bill Wendling
faf2671776 Revert r72898. It does not solve the problem I want it to solve.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 18:18:28 +00:00
Bruno Cardoso Lopes
06bfa33eef Delete comment and fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 21:49:11 +00:00
Bruno Cardoso Lopes
24f14f16fd Fix wrong elf class and byte order initializations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 21:33:20 +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
Eli Friedman
f10d3a7bcd Tweak the expansion code for BIT_CONVERT to generate better code
converting from an MMX vector to an i64.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 09:41:57 +00:00
Eli Friedman
5d28eb9e97 Get rid of some unnecessary code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 07:28:45 +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
Eli Friedman
7a5e55509b Slightly generalize the code that handles shuffles of consecutive loads
on x86 to handle more cases.  Fix a bug in said code that would cause it 
to read past the end of an object.  Rewrite the code in 
SelectionDAGLegalize::ExpandBUILD_VECTOR to be a bit more general. 
Remove PerformBuildVectorCombine, which is no longer necessary with 
these changes.  In addition to simplifying the code, with this change, 
we can now catch a few more cases of consecutive loads.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 06:52:44 +00:00
Nick Lewycky
dcef849ab0 Remove cyclic MDNode detection. Any attempt to create a cyclic MDNode will
crash LLVM first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 04:03:01 +00:00
Nick Lewycky
00907c7d81 Refuse metadata* type for function arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 01:45:11 +00:00
Eli Friedman
0da9975299 PR3628: Add patterns to match SHL/SRL/SRA to the corresponding Altivec
instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 01:07:55 +00:00
Nick Lewycky
d7f20b6b98 Don't crash on multiple return value with no obvious inserted value.
Fixes PR4314.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 23:13:08 +00:00
Eli Friedman
b9a4cacc91 PR4340: Run SimplifyDemandedVectorElts on insertelement instructions;
sometimes it can find simplifications that won't be found otherwise.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 20:08:03 +00:00
Jay Foad
0906b1bf09 Use cast<> instead of dyn_cast<> for things that are known to be
Instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 17:49:35 +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
Eli Friedman
5257106c4d Fix the expansion for CONCAT_VECTORS so that it doesn't create illegal
types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 07:08:26 +00:00
Eli Friedman
7ef3d17866 Factor out a couple of helpers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 07:04:42 +00:00
Eli Friedman
30e71eb61b Avoid crashing on a variable-index insertelement with element type i16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 06:32:50 +00:00
Eli Friedman
1041553424 Get rid of some bogus patterns for X86vzmovl. Don't create VZEXT_MOVL
nodes for vectors with an i16 element type.  Add an optimization for 
building a vector which is all zeros/undef except for the bottom 
element, where the bottom element is an i8 or i16.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 06:05:10 +00:00
Eli Friedman
9d47b8d8ea Fix an obvious typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 05:55:37 +00:00
Bruno Cardoso Lopes
cf0a577033 x86_64 now uses the correct ELF e_machine type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 04:29:16 +00:00
Eli Friedman
1762c1439e Get rid of a bogus pattern that interferes with optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 04:17:04 +00:00
Eli Friedman
23ef105580 PR2598: make sure to expand illegal forms of integer/floating-point
conversions for x86, like <2 x i32> -> <2 x float> and <4 x i16> -> 
<4 x float>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 03:57:58 +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
Eli Friedman
556929a84b Make SINT_TO_FP/UINT_TO_FP vector legalization queries query on the
integer type to be consistent with normal operation legalization.  No visible
change because nothing is actually using this at the moment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 03:27:50 +00:00
Devang Patel
5c06f61e57 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 23:08:56 +00:00
Dan Gohman
2392efef1b Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 23:05:51 +00:00
Devang Patel
da634298fc Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 22:39:21 +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
Evan Cheng
925492279a Changing allocation ordering from r3 ... r0 back to r0 ... r3. The order change no longer make sense after the coalescing changes we have made since then.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 19:08:58 +00:00
Devang Patel
6a784894b1 Evan thinks NoImplicitFloat check is not required here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:48:29 +00:00
Dan Gohman
f38fd690ad Fix a copy+pasto in an assertion string that Jay Foad noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:34:16 +00:00
Evan Cheng
87d59e49e9 When merging multiple load / store instructions. Use the DebugLoc of the first one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:19:23 +00:00
Evan Cheng
5ba71887f9 Code clean up: return vector by reference rather than by value. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 17:56:14 +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
c965ee223c Remove some unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:32:58 +00:00
Dan Gohman
11cc35de41 Update the Verifier to be aware of the difference between Add and FAdd, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:10:00 +00:00
Sanjiv Gupta
4680077959 Lower i16/i32 sdiv/udiv/srem/urem using libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 14:43:12 +00:00
Sanjiv Gupta
a43a7aefd7 Allow libcalls for i16 sdiv/udiv/rem operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 14:41:10 +00:00
Bruno Cardoso Lopes
5d41910396 ELF Code Emitter now uses CurBufferPtr, BufferBegin and BufferEnd, as do JIT and
MachO Writer. This will change with the arrival of ObjectCodeEmitter and
BinaryObject


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 00:22:10 +00:00
Dan Gohman
9f5f322a03 Fix an erroneous check for isFNeg; the FNeg case is handled
a few lines later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 23:43:29 +00:00
Bill Wendling
e075a62746 The DWARF unwind info was incorrect. While compiling with
`-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a
lot of function, and then they would be `0'. The linker (at least on Darwin)
needs to encode the stack size. In some cases, the stack size is too large to
directly encode. So the linker checks to see if there is a "subl $xxx,%esp"
instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If
so, the compact encoding records the offset in the function to where the stack
size is embedded. But because the `DW_CFA_advance_loc' instructions are missing,
it looks before the function and dies.

So, instead of emitting the EH debug label before the stack adjustment
operations, emit it afterwards, right before the frame move stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:52:30 +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
Dale Johannesen
4c9369df57 Fix FP_TO_UINT->i32 on ppc32 -mcpu=g5. This was
using Promote which won't work because i64 isn't
a legal type.  It's easy enough to use Custom, but
then we have the problem that when the type
legalizer is promoting FP_TO_UINT->i16, it has no
way of telling it should prefer FP_TO_SINT->i32
to FP_TO_UINT->i32.  I have uncomfortably hacked
this by making the type legalizer choose FP_TO_SINT
when both are Custom.
This fixes several regressions in the testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 20:53:52 +00:00
Evan Cheng
073e7e5807 RALinScan::attemptTrivialCoalescing() was returning a virtual register instead of the physical register it is allocated to. This resulted in virtual register(s) being added the live-in sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 20:53:36 +00:00