oota-llvm.git
14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 years agoFor Darwin / x86_64, override -relocation-model=static to pic if the output is assemb...
Evan Cheng [Wed, 3 Jun 2009 21:13:54 +0000 (21:13 +0000)]
For Darwin / x86_64, override -relocation-model=static to pic if the output is assembly since Darwin assembler does not really support -static codeine.

I view this as a temporary workaround until the assembler / linker changes.

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

14 years agoAdd createStandardLTOPasses to StandardPasses.h, and move lto and llvm-ld over.
Daniel Dunbar [Wed, 3 Jun 2009 21:06:14 +0000 (21:06 +0000)]
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

14 years agoConvert Alpha and Mips to use a MachineFunctionInfo subclass to
Dan Gohman [Wed, 3 Jun 2009 20:30:14 +0000 (20:30 +0000)]
Convert Alpha and Mips to use a MachineFunctionInfo subclass to
carry GlobalBaseReg, and GlobalRetAddr too in Alpha's case. This
eliminates the need for them to search through the
MachineRegisterInfo livein list in order to identify these
virtual registers. EmitLiveInCopies is now the only user of the
virtual register portion of MachineRegisterInfo's livein data.

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

14 years agoRemove the redundant TM member from X86DAGToDAGISel; replace it
Dan Gohman [Wed, 3 Jun 2009 20:20:00 +0000 (20:20 +0000)]
Remove the redundant TM member from X86DAGToDAGISel; replace it
with an accessor method which simply casts the parent class
SelectionDAGISel's TM to the target-specific type.

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

14 years agoDon't attempt to simplify an non-affine IV expression if it can't
Dan Gohman [Wed, 3 Jun 2009 19:11:31 +0000 (19:11 +0000)]
Don't attempt to simplify an non-affine IV expression if it can't
be simplified to a loop-invariant value. This fixes PR4315.

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

14 years agoMake the buildbot see green (to make it easier to spot the next person
Mike Stump [Wed, 3 Jun 2009 19:07:46 +0000 (19:07 +0000)]
Make the buildbot see green (to make it easier to spot the next person
that puts a new warning in).

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

14 years agoSwitch opt to using StandardPasses.h
Daniel Dunbar [Wed, 3 Jun 2009 18:22:15 +0000 (18:22 +0000)]
Switch opt to using StandardPasses.h
 - No functionality change, but please check if you don't believe me.

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

14 years agoRemove some silly code.
Daniel Dunbar [Wed, 3 Jun 2009 18:13:05 +0000 (18:13 +0000)]
Remove some silly code.

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

14 years agoAdd StandardPasses.h which embeds the standard compilation passes shared by
Daniel Dunbar [Wed, 3 Jun 2009 17:52:39 +0000 (17:52 +0000)]
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

14 years agoMove ELFCodeEmiter stuff to new files
Bruno Cardoso Lopes [Wed, 3 Jun 2009 17:47:27 +0000 (17:47 +0000)]
Move ELFCodeEmiter stuff to new files

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

14 years agoRevert 72650
Bruno Cardoso Lopes [Wed, 3 Jun 2009 16:55:02 +0000 (16:55 +0000)]
Revert 72650

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

14 years agoRemove unnecessary #includes.
Dan Gohman [Wed, 3 Jun 2009 16:47:12 +0000 (16:47 +0000)]
Remove unnecessary #includes.

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

14 years agoEmit file directives correctly in case of a .bc is generated by llvm-ld after linking...
Sanjiv Gupta [Wed, 3 Jun 2009 16:27:49 +0000 (16:27 +0000)]
Emit file directives correctly in case of a .bc is generated by llvm-ld after linking in several .bc files.

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

14 years agolets not forget about c++!
Torok Edwin [Wed, 3 Jun 2009 15:42:26 +0000 (15:42 +0000)]
lets not forget about c++!

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

14 years agoFrameIndex could be used as a value (addressof (arg)) or as an address.
Sanjiv Gupta [Wed, 3 Jun 2009 15:31:12 +0000 (15:31 +0000)]
FrameIndex could be used as a value (addressof (arg)) or as an address.
Expand it exactly like GlobalAddress.
Fix some more crashes (InsertBranch() not being implemented) for compiling hitec libs.

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

14 years agoCMake: Added missing source file to lib/CodeGen/CMakeLists.txt.
Oscar Fuentes [Wed, 3 Jun 2009 15:29:09 +0000 (15:29 +0000)]
CMake: Added missing source file to lib/CodeGen/CMakeLists.txt.

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

14 years agoCMake: Implements and documents option LLVM_ENABLE_ASSERTS.
Oscar Fuentes [Wed, 3 Jun 2009 15:11:25 +0000 (15:11 +0000)]
CMake: Implements and documents option LLVM_ENABLE_ASSERTS.

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

14 years agoDocument how easy it is to use the gold plugin and have LTO with autotooled projects.
Torok Edwin [Wed, 3 Jun 2009 15:06:19 +0000 (15:06 +0000)]
Document how easy it is to use the gold plugin and have LTO with autotooled projects.
Please correct the documentation if I missed anything.

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

14 years agoFixed a bug in which signed comparisons were being used instead of unsigned comparisons.
Sanjiv Gupta [Wed, 3 Jun 2009 13:36:44 +0000 (13:36 +0000)]
Fixed a bug in which signed comparisons were being used instead of unsigned comparisons.

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

14 years agoAvoid a warning "'U' might be used uninitialized in
Duncan Sands [Wed, 3 Jun 2009 12:05:18 +0000 (12:05 +0000)]
Avoid a warning "'U' might be used uninitialized in
this function" when using a not-too-smart compiler.

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

14 years agoAt a newline at the end of this file.
Duncan Sands [Wed, 3 Jun 2009 11:54:28 +0000 (11:54 +0000)]
At a newline at the end of this file.

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

14 years agoDocument how phi and invoke instructions interact with SSA form.
Jay Foad [Wed, 3 Jun 2009 10:20:10 +0000 (10:20 +0000)]
Document how phi and invoke instructions interact with SSA form.

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

14 years agoFix for PR4225: When rewriter reuse a value in a physical register , it clear the...
Evan Cheng [Wed, 3 Jun 2009 09:00:27 +0000 (09:00 +0000)]
Fix for PR4225: When rewriter reuse a value in a physical register , it clear the register kill operand marker and its kill ops information. However, the cleared operand may be a def of a super-register. Clear the kill ops info for the super-register's sub-registers as well.

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

14 years agoTemporarily revert 72756 for now.
Evan Cheng [Wed, 3 Jun 2009 07:40:47 +0000 (07:40 +0000)]
Temporarily revert 72756 for now.

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

14 years agoFold preceding / trailing base inc / dec into the single load / store as well.
Evan Cheng [Wed, 3 Jun 2009 06:14:58 +0000 (06:14 +0000)]
Fold preceding / trailing base inc / dec into the single load / store as well.

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

14 years agoIf there is a def of a super-register followed by a use of a sub-register, do *not...
Evan Cheng [Wed, 3 Jun 2009 05:15:46 +0000 (05:15 +0000)]
If there is a def of a super-register followed by a use of a sub-register, do *not* add an implicit def of the sub-register. e.g.
EAX = ..., AX<imp-def>
...
    = AX

This creates a double-def. Apparently this used to be necessary but is no longer needed.

Thanks to Anton for pointing this out. Anton, I cannot create a test case without your uncommitted ARM patches. Please check in a test case for me.

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

14 years agoMove structures and classes into header files, providing two new headers and
Bruno Cardoso Lopes [Wed, 3 Jun 2009 03:43:31 +0000 (03:43 +0000)]
Move structures and classes into header files, providing two new headers and
one new .cpp file, in preparation for merging in the Direct Object Emission
changes we're working on. No functional changes.
Fixed coding style issues on the original patch. Patch by Aaron Gray

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

14 years agoRevert r72734. The Darwin assembler doesn't support the static
Dan Gohman [Wed, 3 Jun 2009 00:37:20 +0000 (00:37 +0000)]
Revert r72734. The Darwin assembler doesn't support the static
relocation model on x86-64. Higher level logic should override
the relocation model to PIC on x86_64-apple-darwin.

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

14 years agoChange TargetFolder's TD member from a reference to a
Dan Gohman [Wed, 3 Jun 2009 00:13:48 +0000 (00:13 +0000)]
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

14 years agoChange ConstantFoldConstantExpression to accept a null
Dan Gohman [Tue, 2 Jun 2009 21:48:15 +0000 (21:48 +0000)]
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

14 years agoDelete an unnecessary forward declaration.
Dan Gohman [Tue, 2 Jun 2009 21:37:43 +0000 (21:37 +0000)]
Delete an unnecessary forward declaration.

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

14 years agoFix CodeGenPrepare's address-mode sinking to handle unusual
Dan Gohman [Tue, 2 Jun 2009 21:29:13 +0000 (21:29 +0000)]
Fix CodeGenPrepare's address-mode sinking to handle unusual
addresses, involving Base values which do not have Pointer type.
This fixes PR4297.

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

14 years agoNightlyTest: Stop running a separate Olden pass during nightly test.
Daniel Dunbar [Tue, 2 Jun 2009 21:14:15 +0000 (21:14 +0000)]
NightlyTest: Stop running a separate Olden pass during nightly test.
 - Unless I'm mistaken, these results weren't even being reported and just
   served to clobber the previous build products and waste cycles.

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

14 years agofix build on VC++2k8.
Torok Edwin [Tue, 2 Jun 2009 20:32:59 +0000 (20:32 +0000)]
fix build on VC++2k8.

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

14 years agoFixed warning, removed some temporary validation code that snuck in during my last...
Lang Hames [Tue, 2 Jun 2009 20:30:03 +0000 (20:30 +0000)]
Fixed warning, removed some temporary validation code that snuck in during my last commit.

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

14 years agoOn Darwin x86_64 small code model doesn't guarantee code address fits in 32-bit.
Evan Cheng [Tue, 2 Jun 2009 20:09:31 +0000 (20:09 +0000)]
On Darwin x86_64 small code model doesn't guarantee code address fits in 32-bit.

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

14 years agoUndef MemoryFence when compiling on MSVC.
Owen Anderson [Tue, 2 Jun 2009 17:35:55 +0000 (17:35 +0000)]
Undef MemoryFence when compiling on MSVC.

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

14 years agoSimplify assertion message to avoid confusion.
Devang Patel [Tue, 2 Jun 2009 17:26:29 +0000 (17:26 +0000)]
Simplify assertion message to avoid confusion.

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

14 years agoUpdate to in-place spilling framework. Includes live interval scaling and trivial...
Lang Hames [Tue, 2 Jun 2009 16:53:25 +0000 (16:53 +0000)]
Update to in-place spilling framework. Includes live interval scaling and trivial rewriter.

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

14 years agoRevert 72707 and 72709, for the moment.
Dale Johannesen [Tue, 2 Jun 2009 03:12:52 +0000 (03:12 +0000)]
Revert 72707 and 72709, for the moment.

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

14 years agoAvoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This can happen...
Evan Cheng [Tue, 2 Jun 2009 00:56:07 +0000 (00:56 +0000)]
Avoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This can happen when PHI uses are recursively dependent on each other.

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

14 years agoAdd missing file.
Dale Johannesen [Mon, 1 Jun 2009 23:48:58 +0000 (23:48 +0000)]
Add missing file.

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

14 years agoupdate comments about .objc_ symbols being generated
Nick Kledzik [Mon, 1 Jun 2009 23:41:09 +0000 (23:41 +0000)]
update comments about .objc_ symbols being generated

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

14 years agoMake the implicit inputs and outputs of target-independent
Dale Johannesen [Mon, 1 Jun 2009 23:27:20 +0000 (23:27 +0000)]
Make the implicit inputs and outputs of target-independent
ADDC/ADDE use MVT::i1 (later, whatever it gets legalized to)
instead of MVT::Flag.  Remove CARRY_FALSE in favor of 0; adjust
all target-independent code to use this format.

Most targets will still produce a Flag-setting target-dependent
version when selection is done.  X86 is converted to use i32
instead, which means TableGen needs to produce different code
in xxxGenDAGISel.inc.  This keys off the new supportsHasI1 bit
in xxxInstrInfo, currently set only for X86; in principle this
is temporary and should go away when all other targets have
been converted.  All relevant X86 instruction patterns are
modified to represent setting and using EFLAGS explicitly.  The
same can be done on other targets.

The immediate behavior change is that an ADC/ADD pair are no
longer tightly coupled in the X86 scheduler; they can be
separated by instructions that don't clobber the flags (MOV).
I will soon add some peephole optimizations based on using
other instructions that set the flags to feed into ADC.

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

14 years agoComment grammaro/clarification.
Dale Johannesen [Mon, 1 Jun 2009 23:13:42 +0000 (23:13 +0000)]
Comment grammaro/clarification.

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

14 years agoTrailing whitespace.
Dale Johannesen [Mon, 1 Jun 2009 23:12:52 +0000 (23:12 +0000)]
Trailing whitespace.

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