oota-llvm.git
15 years agoAdd a !patsubst operator. Use on string types.
David Greene [Mon, 8 Jun 2009 23:05:37 +0000 (23:05 +0000)]
Add a !patsubst operator.  Use on string types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73099 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTypo
Anton Korobeynikov [Mon, 8 Jun 2009 22:59:50 +0000 (22:59 +0000)]
Typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73098 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert hunk commited by accident
Anton Korobeynikov [Mon, 8 Jun 2009 22:57:18 +0000 (22:57 +0000)]
Revert hunk commited by accident

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73097 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd testcase for register scanveger assertion fix in r72755
Anton Korobeynikov [Mon, 8 Jun 2009 22:54:15 +0000 (22:54 +0000)]
Add testcase for register scanveger assertion fix in r72755
(double def due to livevars)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73096 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe attached patches implement most of the ARM AAPCS-VFP hard float
Anton Korobeynikov [Mon, 8 Jun 2009 22:53:56 +0000 (22:53 +0000)]
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

15 years agoUpdate documentation.
David Greene [Mon, 8 Jun 2009 22:38:07 +0000 (22:38 +0000)]
Update documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73092 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a more robust !if test.
David Greene [Mon, 8 Jun 2009 22:34:57 +0000 (22:34 +0000)]
Add a more robust !if test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73091 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix DejaGNU run line to escape special characters.
David Greene [Mon, 8 Jun 2009 22:20:58 +0000 (22:20 +0000)]
Fix DejaGNU run line to escape special characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73090 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDocument the stack alignment part of target data description.
Daniel Dunbar [Mon, 8 Jun 2009 22:17:53 +0000 (22:17 +0000)]
Document the stack alignment part of target data description.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73089 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSeparate V6 from V6T2 since the latter has some extra nice instructions
Anton Korobeynikov [Mon, 8 Jun 2009 21:20:36 +0000 (21:20 +0000)]
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

15 years agoAllow setting the C runtime to be used with MSVC from cmake.
Stefanus Du Toit [Mon, 8 Jun 2009 21:18:31 +0000 (21:18 +0000)]
Allow setting the C runtime to be used with MSVC from cmake.

Patch by Tareq Siraj.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73084 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd helper for checking of Thumb1 mode
Anton Korobeynikov [Mon, 8 Jun 2009 20:31:02 +0000 (20:31 +0000)]
Add helper for checking of Thumb1 mode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73080 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake IntInits and ListInits typed. This helps deduce types of !if and
David Greene [Mon, 8 Jun 2009 20:23:18 +0000 (20:23 +0000)]
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

15 years agoMake !if short-circuit when possible.
David Greene [Mon, 8 Jun 2009 19:16:56 +0000 (19:16 +0000)]
Make !if short-circuit when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73076 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert r72898. It does not solve the problem I want it to solve.
Bill Wendling [Mon, 8 Jun 2009 18:18:28 +0000 (18:18 +0000)]
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

15 years agoAdd a !regmatch operator to do pattern matching in TableGen.
David Greene [Mon, 8 Jun 2009 17:00:34 +0000 (17:00 +0000)]
Add a !regmatch operator to do pattern matching in TableGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73074 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelete comment and fix typo
Bruno Cardoso Lopes [Sun, 7 Jun 2009 21:49:11 +0000 (21:49 +0000)]
Delete comment and fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73040 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix wrong elf class and byte order initializations.
Bruno Cardoso Lopes [Sun, 7 Jun 2009 21:33:20 +0000 (21:33 +0000)]
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

15 years agoSimple ELF32/64 binary files can now be emitted for x86 and x86_64 without
Bruno Cardoso Lopes [Sun, 7 Jun 2009 21:22:38 +0000 (21:22 +0000)]
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

15 years agoFix the run-line for this test to work correctly outside of x86.
Eli Friedman [Sun, 7 Jun 2009 09:44:19 +0000 (09:44 +0000)]
Fix the run-line for this test to work correctly outside of x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73025 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweak the expansion code for BIT_CONVERT to generate better code
Eli Friedman [Sun, 7 Jun 2009 09:41:57 +0000 (09:41 +0000)]
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

15 years agoGet rid of some unnecessary code.
Eli Friedman [Sun, 7 Jun 2009 07:28:45 +0000 (07:28 +0000)]
Get rid of some unnecessary code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73017 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCreate FunctionType::isValidArgumentType to go along with isValidReturnType.
Nick Lewycky [Sun, 7 Jun 2009 07:26:46 +0000 (07:26 +0000)]
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

15 years agoA basic PIC16 toolchain driver.
Mikhail Glushenkov [Sun, 7 Jun 2009 07:08:01 +0000 (07:08 +0000)]
A basic PIC16 toolchain driver.

Nice addition to the examples and also a starting point for Sanjiv to work on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73013 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSlightly generalize the code that handles shuffles of consecutive loads
Eli Friedman [Sun, 7 Jun 2009 06:52:44 +0000 (06:52 +0000)]
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

15 years agoRemove cyclic MDNode detection. Any attempt to create a cyclic MDNode will
Nick Lewycky [Sun, 7 Jun 2009 04:03:01 +0000 (04:03 +0000)]
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

15 years agoRefuse metadata* type for function arguments.
Nick Lewycky [Sun, 7 Jun 2009 01:45:11 +0000 (01:45 +0000)]
Refuse metadata* type for function arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73010 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3628: Add patterns to match SHL/SRL/SRA to the corresponding Altivec
Eli Friedman [Sun, 7 Jun 2009 01:07:55 +0000 (01:07 +0000)]
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

15 years agoAdd option for specifying the path to assembler, "as". This overrides the path
Nick Lewycky [Sun, 7 Jun 2009 00:50:45 +0000 (00:50 +0000)]
Add option for specifying the path to assembler, "as". This overrides the path
to gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73008 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't crash on multiple return value with no obvious inserted value.
Nick Lewycky [Sat, 6 Jun 2009 23:13:08 +0000 (23:13 +0000)]
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

15 years agoPR4340: Run SimplifyDemandedVectorElts on insertelement instructions;
Eli Friedman [Sat, 6 Jun 2009 20:08:03 +0000 (20:08 +0000)]
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

15 years agoMove </pre> to column one to avoid an extra line of spaces in the example.
Nick Lewycky [Sat, 6 Jun 2009 18:14:04 +0000 (18:14 +0000)]
Move </pre> to column one to avoid an extra line of spaces in the example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73003 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse cast<> instead of dyn_cast<> for things that are known to be
Jay Foad [Sat, 6 Jun 2009 17:49:35 +0000 (17:49 +0000)]
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

15 years agoRename UnknownValue to CouldNotCompute, since it holds an instance of
Dan Gohman [Sat, 6 Jun 2009 14:37:11 +0000 (14:37 +0000)]
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

15 years agoFix the expansion for CONCAT_VECTORS so that it doesn't create illegal
Eli Friedman [Sat, 6 Jun 2009 07:08:26 +0000 (07:08 +0000)]
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

15 years agoFactor out a couple of helpers.
Eli Friedman [Sat, 6 Jun 2009 07:04:42 +0000 (07:04 +0000)]
Factor out a couple of helpers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72992 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAvoid crashing on a variable-index insertelement with element type i16.
Eli Friedman [Sat, 6 Jun 2009 06:32:50 +0000 (06:32 +0000)]
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

15 years agoRegenerate.
Nick Lewycky [Sat, 6 Jun 2009 06:25:09 +0000 (06:25 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72990 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a flag to permit disabling libffi.
Nick Lewycky [Sat, 6 Jun 2009 06:24:44 +0000 (06:24 +0000)]
Add a flag to permit disabling libffi.

Also, there were a bunch of flags with no text in --help because the square
brackets were in the wrong place. I've fixed those too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72989 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGet rid of some bogus patterns for X86vzmovl. Don't create VZEXT_MOVL
Eli Friedman [Sat, 6 Jun 2009 06:05:10 +0000 (06:05 +0000)]
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

15 years agoFix an obvious typo.
Eli Friedman [Sat, 6 Jun 2009 05:55:37 +0000 (05:55 +0000)]
Fix an obvious typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72987 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agox86_64 now uses the correct ELF e_machine type
Bruno Cardoso Lopes [Sat, 6 Jun 2009 04:29:16 +0000 (04:29 +0000)]
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

15 years agoGet rid of a bogus pattern that interferes with optimization.
Eli Friedman [Sat, 6 Jun 2009 04:17:04 +0000 (04:17 +0000)]
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

15 years agoPR2598: make sure to expand illegal forms of integer/floating-point
Eli Friedman [Sat, 6 Jun 2009 03:57:58 +0000 (03:57 +0000)]
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

15 years agoRemove elf specific info from ELFWriter.h to Elf.h. Code cleanup and more comments...
Bruno Cardoso Lopes [Sat, 6 Jun 2009 03:56:29 +0000 (03:56 +0000)]
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

15 years agoMake SINT_TO_FP/UINT_TO_FP vector legalization queries query on the
Eli Friedman [Sat, 6 Jun 2009 03:27:50 +0000 (03:27 +0000)]
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

15 years agoMore portability checks for CMake's config.h.
Douglas Gregor [Fri, 5 Jun 2009 23:46:34 +0000 (23:46 +0000)]
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

15 years agoSimplify.
Devang Patel [Fri, 5 Jun 2009 23:08:56 +0000 (23:08 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72970 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd explicit keywords.
Dan Gohman [Fri, 5 Jun 2009 23:05:51 +0000 (23:05 +0000)]
Add explicit keywords.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72969 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify.
Devang Patel [Fri, 5 Jun 2009 22:39:21 +0000 (22:39 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72965 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd new function attribute - noimplicitfloat
Devang Patel [Fri, 5 Jun 2009 21:57:13 +0000 (21:57 +0000)]
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

15 years agoAdapt the x86 build_vector dagcombine to the current state of the legalizer.
Nate Begeman [Fri, 5 Jun 2009 21:37:30 +0000 (21:37 +0000)]
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

15 years agoChanging allocation ordering from r3 ... r0 back to r0 ... r3. The order change no...
Evan Cheng [Fri, 5 Jun 2009 19:08:58 +0000 (19:08 +0000)]
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

15 years agoEvan thinks NoImplicitFloat check is not required here.
Devang Patel [Fri, 5 Jun 2009 18:48:29 +0000 (18:48 +0000)]
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

15 years agoFix a copy+pasto in an assertion string that Jay Foad noticed.
Dan Gohman [Fri, 5 Jun 2009 18:34:16 +0000 (18:34 +0000)]
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

15 years agoWhen merging multiple load / store instructions. Use the DebugLoc of the first one.
Evan Cheng [Fri, 5 Jun 2009 18:19:23 +0000 (18:19 +0000)]
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

15 years agoCode clean up: return vector by reference rather than by value. No functionality...
Evan Cheng [Fri, 5 Jun 2009 17:56:14 +0000 (17:56 +0000)]
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

15 years agoMove SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
Dan Gohman [Fri, 5 Jun 2009 16:35:53 +0000 (16:35 +0000)]
Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72949 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove some unnecessary #includes.
Dan Gohman [Fri, 5 Jun 2009 16:32:58 +0000 (16:32 +0000)]
Remove some unnecessary #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72948 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate the Verifier to be aware of the difference between Add and FAdd, etc.
Dan Gohman [Fri, 5 Jun 2009 16:10:00 +0000 (16:10 +0000)]
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

15 years agoOn platforms like Sparc64 you need to pass -r to
Duncan Sands [Fri, 5 Jun 2009 15:05:19 +0000 (15:05 +0000)]
On platforms like Sparc64 you need to pass -r to
gcc rather than directly to the linker: gcc will
then modify the linker options it generates (it
will not use --relax for example, incompatible
with -r, as it otherwise would).  This fixes the
sparc build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72943 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLower i16/i32 sdiv/udiv/srem/urem using libcalls.
Sanjiv Gupta [Fri, 5 Jun 2009 14:43:12 +0000 (14:43 +0000)]
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

15 years agoAllow libcalls for i16 sdiv/udiv/rem operations.
Sanjiv Gupta [Fri, 5 Jun 2009 14:41:10 +0000 (14:41 +0000)]
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

15 years agoELF Code Emitter now uses CurBufferPtr, BufferBegin and BufferEnd, as do JIT and
Bruno Cardoso Lopes [Fri, 5 Jun 2009 00:22:10 +0000 (00:22 +0000)]
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

15 years agoFix an erroneous check for isFNeg; the FNeg case is handled
Dan Gohman [Thu, 4 Jun 2009 23:43:29 +0000 (23:43 +0000)]
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

15 years agoFix these so that they work on non-x86 Darwin machines.
Bill Wendling [Thu, 4 Jun 2009 23:37:19 +0000 (23:37 +0000)]
Fix these so that they work on non-x86 Darwin machines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72903 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSpecify that this works for Darwin.
Bill Wendling [Thu, 4 Jun 2009 22:56:29 +0000 (22:56 +0000)]
Specify that this works for Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72899 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe DWARF unwind info was incorrect. While compiling with
Bill Wendling [Thu, 4 Jun 2009 22:52:30 +0000 (22:52 +0000)]
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

15 years agoSplit the Add, Sub, and Mul instruction opcodes into separate
Dan Gohman [Thu, 4 Jun 2009 22:49:04 +0000 (22:49 +0000)]
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

15 years agoAdd new function attribute - noredzone.
Devang Patel [Thu, 4 Jun 2009 22:05:33 +0000 (22:05 +0000)]
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

15 years agoFix FP_TO_UINT->i32 on ppc32 -mcpu=g5. This was
Dale Johannesen [Thu, 4 Jun 2009 20:53:52 +0000 (20:53 +0000)]
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

15 years agoRALinScan::attemptTrivialCoalescing() was returning a virtual register instead of...
Evan Cheng [Thu, 4 Jun 2009 20:53:36 +0000 (20:53 +0000)]
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

15 years agoA value defined by an implicit_def can be liven to a use BB. This is unfortunate...
Evan Cheng [Thu, 4 Jun 2009 20:28:22 +0000 (20:28 +0000)]
A value defined by an implicit_def can be liven to a use BB. This is unfortunate. But register allocator still has to add it to the live-in set of the use BB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72889 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA value defined by an implicit_def can be liven to a use BB. This is unfortunate...
Evan Cheng [Thu, 4 Jun 2009 20:25:48 +0000 (20:25 +0000)]
A value defined by an implicit_def can be liven to a use BB. This is unfortunate. But register allocator still has to add it to the live-in set of the use BB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72888 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCMake: Use explicit dependencies for Xcode (as well as MSVC), to make
Douglas Gregor [Thu, 4 Jun 2009 19:53:37 +0000 (19:53 +0000)]
CMake: Use explicit dependencies for Xcode (as well as MSVC), to make
the CMake-generated Xcode project build properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72883 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago<rdar://problem/6944342> libLTO for darwin should add -static when assembling .s
Nick Kledzik [Thu, 4 Jun 2009 19:14:08 +0000 (19:14 +0000)]
<rdar://problem/6944342> libLTO for darwin should add -static when assembling .s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72881 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemoved SimpleRewriter.
Lang Hames [Thu, 4 Jun 2009 18:45:36 +0000 (18:45 +0000)]
Removed SimpleRewriter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72880 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFor XTARGET to work on targets not in the list,
Dale Johannesen [Thu, 4 Jun 2009 18:27:43 +0000 (18:27 +0000)]
For XTARGET to work on targets not in the list,
there must also be an XFAIL line.  Fix a couple
examples of this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72876 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCheck in test changes that I accidentally left out of r72872.
Dan Gohman [Thu, 4 Jun 2009 18:22:31 +0000 (18:22 +0000)]
Check in test changes that I accidentally left out of r72872.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72875 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoProperly detect malloc_zone_statistics in CMake build system
Douglas Gregor [Thu, 4 Jun 2009 17:22:52 +0000 (17:22 +0000)]
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

15 years agoDon't do the X * 0.0 -> 0.0 transformation in instcombine, because
Dan Gohman [Thu, 4 Jun 2009 17:12:12 +0000 (17:12 +0000)]
Don't do the X * 0.0 -> 0.0 transformation in instcombine, because
instcombine doesn't know when it's safe. To partially compensate
for this, introduce new code to do this transformation in
dagcombine, which can use UnsafeFPMath.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72872 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix comments.
Dan Gohman [Thu, 4 Jun 2009 16:49:15 +0000 (16:49 +0000)]
Fix comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72870 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago--plugin is not needed for bfd anymore. Update docs.
Torok Edwin [Thu, 4 Jun 2009 16:08:10 +0000 (16:08 +0000)]
--plugin is not needed for bfd anymore. Update docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72867 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove unused code.
Sanjiv Gupta [Thu, 4 Jun 2009 15:16:24 +0000 (15:16 +0000)]
Remove unused code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72866 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCMake: Renamed LLVM_ENABLE_ASSERTS to
Oscar Fuentes [Thu, 4 Jun 2009 09:26:16 +0000 (09:26 +0000)]
CMake: Renamed LLVM_ENABLE_ASSERTS to
LLVM_ENABLE_ASSERTIONS. Fine-tuned the logic that controls the
definition of NDEBUG and _DEBUG macros.

Thanks to Jay Foad for this suggestions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72864 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCustom lower SUB with two register operands.
Sanjiv Gupta [Thu, 4 Jun 2009 08:52:28 +0000 (08:52 +0000)]
Custom lower SUB with two register operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72861 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix comments.
Torok Edwin [Thu, 4 Jun 2009 08:18:25 +0000 (08:18 +0000)]
Fix comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72858 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for outputting ANSI colors to raw_fd_ostream.
Torok Edwin [Thu, 4 Jun 2009 07:09:50 +0000 (07:09 +0000)]
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

15 years agoPR3739, part 2: Use an explicit store to spill XMM registers. (Previously,
Eli Friedman [Thu, 4 Jun 2009 02:32:04 +0000 (02:32 +0000)]
PR3739, part 2: Use an explicit store to spill XMM registers. (Previously,
the code tried to use "push", which doesn't exist for XMM registers.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72836 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3739, part 1: Disable the red zone on Win64.
Eli Friedman [Thu, 4 Jun 2009 02:02:01 +0000 (02:02 +0000)]
PR3739, part 1: Disable the red zone on Win64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72830 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove a #include of <iostream>.
Dan Gohman [Thu, 4 Jun 2009 01:59:35 +0000 (01:59 +0000)]
Remove a #include of <iostream>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72828 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRe-apply 72756 with fixes. One of those was introduced by we changed MachineInstrBuil...
Evan Cheng [Thu, 4 Jun 2009 01:15:28 +0000 (01:15 +0000)]
Re-apply 72756 with fixes. One of those was introduced by we changed MachineInstrBuilder::addReg() interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72826 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemoved more testing code that snuck in earlier.
Lang Hames [Thu, 4 Jun 2009 01:04:22 +0000 (01:04 +0000)]
Removed more testing code that snuck in earlier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72825 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago<rdar://problem/6940611> libLTO.dylib needs to let linker specify path to assembler
Nick Kledzik [Thu, 4 Jun 2009 00:28:45 +0000 (00:28 +0000)]
<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

15 years agoUse uint8_t and int32_t in {JIT,Machine}CodeEmiters
Bruno Cardoso Lopes [Thu, 4 Jun 2009 00:15:51 +0000 (00:15 +0000)]
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

15 years agoEvan says it's wrong; back out 72808.
Stuart Hastings [Wed, 3 Jun 2009 22:59:34 +0000 (22:59 +0000)]
Evan says it's wrong; back out 72808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72817 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago<rdar://problem/6941517> C++ static constructors not preserved for static executable...
Nick Kledzik [Wed, 3 Jun 2009 22:52:12 +0000 (22:52 +0000)]
<rdar://problem/6941517> C++ static constructors not preserved for static executable using LTO
Move setRelocationModel() to be called before TargetMachine is instantiated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72816 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange LTO to run the global opt pass twice.
Daniel Dunbar [Wed, 3 Jun 2009 21:51:32 +0000 (21:51 +0000)]
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

15 years agoPR4317: Handle splits where the new block is unreachable correctly in
Eli Friedman [Wed, 3 Jun 2009 21:42:06 +0000 (21:42 +0000)]
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

15 years agoRecognize another euphemism for MOVDQ2Q.
Stuart Hastings [Wed, 3 Jun 2009 21:39:14 +0000 (21:39 +0000)]
Recognize another euphemism for MOVDQ2Q.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72808 91177308-0d34-0410-b5e6-96231b3b80d8