oota-llvm.git
14 years agoChange 'make install' to install tblgen, for better support of out-of-tree targets,
Chris Lattner [Fri, 8 May 2009 17:32:47 +0000 (17:32 +0000)]
Change 'make install' to install tblgen, for better support of out-of-tree targets,
patch by Mikael Lepistö!

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

14 years agofix RewriteStoreUserOfWholeAlloca to use the correct type size
Chris Lattner [Fri, 8 May 2009 15:54:41 +0000 (15:54 +0000)]
fix RewriteStoreUserOfWholeAlloca to use the correct type size
method, fixing a crash on PR4146.  While the store will
ultimately overwrite the "padded size" number of bits in memory,
the stored value may be a subset of this size.  This function
only wants to handle the case where all bits are stored.

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

14 years agoReverse branch condition only when there is a conditional branch.
Evan Cheng [Fri, 8 May 2009 09:35:53 +0000 (09:35 +0000)]
Reverse branch condition only when there is a conditional branch.

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

14 years agoAdd explicit braces to disambiguate nested if/else. Removes a warning.
Nick Lewycky [Fri, 8 May 2009 06:57:41 +0000 (06:57 +0000)]
Add explicit braces to disambiguate nested if/else. Removes a warning.

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

14 years agoThis transform requires valid TargetData info. Wrap it in 'if (TD)' in
Nick Lewycky [Fri, 8 May 2009 06:47:37 +0000 (06:47 +0000)]
This transform requires valid TargetData info. Wrap it in 'if (TD)' in
preparation for the day we use null TargetData when no target is specified.

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

14 years agoOptimize code placement in loop to eliminate unconditional branches or move unconditi...
Evan Cheng [Fri, 8 May 2009 06:34:09 +0000 (06:34 +0000)]
Optimize code placement in loop to eliminate unconditional branches or move unconditional branch to the outside of the loop. e.g.

///       A:
///       ...
///       <fallthrough to B>
///
///       B:  --> loop header
///       ...
///       jcc <cond> C, [exit]
///
///       C:
///       ...
///       jmp B
///
/// ==>
///
///       A:
///       ...
///       jmp B
///
///       C:  --> new loop header
///       ...
///       <fallthough to B>
///
///       B:
///       ...
///       jcc <cond> C, [exit]

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

14 years agoAdd missing #include for "strlen" which is used inline in this header. Fixes
Nick Lewycky [Fri, 8 May 2009 06:22:25 +0000 (06:22 +0000)]
Add missing #include for "strlen" which is used inline in this header. Fixes
build under gcc 4.3.

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

14 years agoMoved pic16 naming functions to correct place.
Sanjiv Gupta [Fri, 8 May 2009 04:50:14 +0000 (04:50 +0000)]
Moved pic16 naming functions to correct place.
No functionality change.

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

14 years agoPR4123: don't crash when inlining a call which uses its own result.
Eli Friedman [Fri, 8 May 2009 00:22:04 +0000 (00:22 +0000)]
PR4123: don't crash when inlining a call which uses its own result.

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

14 years agoFix pr4100. Do not remove no-op copies when they are dead. The register
Bob Wilson [Thu, 7 May 2009 23:47:03 +0000 (23:47 +0000)]
Fix pr4100.  Do not remove no-op copies when they are dead.  The register
scavenger gets confused about register liveness if it doesn't see them.
I'm not thrilled with this solution, but it only comes up when there are dead
copies in the code, which is something that hopefully doesn't happen much.

Here is what happens in pr4100: As shown in the following excerpt from the
debug output of llc, the source of a move gets reloaded from the stack,
inserting a new load instruction before the move.  Since that source operand
is a kill, the physical register is free to be reused for the destination
of the move.  The move ends up being a no-op, copying R3 to R3, so it is
deleted.  But, it leaves behind the load to reload %reg1028 into R3, and
that load is not updated to show that it's destination operand (R3) is dead.
The scavenger gets confused by that load because it thinks that R3 is live.

Starting RegAlloc of: %reg1025<def,dead> = MOVr %reg1028<kill>, 14, %reg0, %reg0
  Regs have values:
  Reloading %reg1028 into R3
  Last use of R3[%reg1028], removing it from live set
  Assigning R3 to %reg1025
  Register R3 [%reg1025] is never used, removing it from live set

Alternative solutions might be either marking the load as dead, or zapping
the load along with the no-op copy.  I couldn't see an easy way to do
either of those, though.

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

14 years agoFix a comment (again).
Bob Wilson [Thu, 7 May 2009 21:20:42 +0000 (21:20 +0000)]
Fix a comment (again).

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

14 years agoFix a comment.
Bob Wilson [Thu, 7 May 2009 21:19:45 +0000 (21:19 +0000)]
Fix a comment.

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

14 years agoRevert 71165. It did more than just revert 71158 and it introduced
Dan Gohman [Thu, 7 May 2009 19:46:24 +0000 (19:46 +0000)]
Revert 71165. It did more than just revert 71158 and it introduced
several regressions. The problem due to 71158 is now fixed.

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

14 years agoPerform constant folding on operands of instructions with non-void
Dan Gohman [Thu, 7 May 2009 19:43:39 +0000 (19:43 +0000)]
Perform constant folding on operands of instructions with non-void
types, such as loads and calls.

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

14 years agoSCEVComplexityCompare's new code was missing SCEVUDivExpr. Implement
Dan Gohman [Thu, 7 May 2009 19:23:21 +0000 (19:23 +0000)]
SCEVComplexityCompare's new code was missing SCEVUDivExpr. Implement
the SCEVUDivExpr case.

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

14 years agoRevert r70876 and add a testcase (@c7) showing the problem:
Duncan Sands [Thu, 7 May 2009 18:08:34 +0000 (18:08 +0000)]
Revert r70876 and add a testcase (@c7) showing the problem:
bits captured, but the pointer marked nocapture.  In fact
I now recall that this problem is why only readnone functions
returning void were considered before!  However keep a small
fix that was also in r70876: a readnone function returning
void can result in bits being captured if it unwinds, so
test for this.

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

14 years agoTemporarily revert r71158. It was causing a failure during a full bootstrap:
Bill Wendling [Thu, 7 May 2009 17:26:14 +0000 (17:26 +0000)]
Temporarily revert r71158. It was causing a failure during a full bootstrap:

checking for bcopy... no
checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decUtility.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decNumber.o] Error 1
make[3]: *** [all-stage2-libdecnumber] Error 2
make[3]: *** Waiting for unfinished jobs....

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

14 years agoMake ScalarEvolution's GroupByComplexity more thorough. In addition
Dan Gohman [Thu, 7 May 2009 14:39:04 +0000 (14:39 +0000)]
Make ScalarEvolution's GroupByComplexity more thorough. In addition
to sorting SCEVs by their kind, sort SCEVs of the same kind according
to their operands. This helps avoid things like (a+b) being a distinct
expression from (b+a).

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

14 years agoTrim unnecessary headers. Code in Analysis shouldn't use Transforms
Dan Gohman [Thu, 7 May 2009 14:30:26 +0000 (14:30 +0000)]
Trim unnecessary headers. Code in Analysis shouldn't use Transforms
headers due to library dependencies.

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

14 years agoConstant-fold ptrtoint+add+inttoptr to gep when the pointer is an
Dan Gohman [Thu, 7 May 2009 14:24:56 +0000 (14:24 +0000)]
Constant-fold ptrtoint+add+inttoptr to gep when the pointer is an
array and the add is within range. This helps simplify expressions
expanded by ScalarEvolutionExpander.

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

14 years agoFactor out a common base class between SCEVCommutativeExpr and
Dan Gohman [Thu, 7 May 2009 14:00:19 +0000 (14:00 +0000)]
Factor out a common base class between SCEVCommutativeExpr and
SCEVAddRecExpr. This eliminates redundant code for visiting
all the operands of an expression.

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

14 years agoMove the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
Argyrios Kyrtzidis [Thu, 7 May 2009 13:55:51 +0000 (13:55 +0000)]
Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.

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

14 years agoCode refactoring.
Evan Cheng [Thu, 7 May 2009 05:49:39 +0000 (05:49 +0000)]
Code refactoring.

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

14 years agoRename "loop aligner" pass to "code placement optimization" pass.
Evan Cheng [Thu, 7 May 2009 05:42:24 +0000 (05:42 +0000)]
Rename "loop aligner" pass to "code placement optimization" pass.

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

14 years agoEliminate compiler warnings.
Evan Cheng [Thu, 7 May 2009 05:31:56 +0000 (05:31 +0000)]
Eliminate compiler warnings.

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

14 years agoAdd const modifiers.
Jakob Stoklund Olesen [Thu, 7 May 2009 04:41:26 +0000 (04:41 +0000)]
Add const modifiers.

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

14 years agoTHis doesn't fail.
Bill Wendling [Thu, 7 May 2009 01:41:42 +0000 (01:41 +0000)]
THis doesn't fail.

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

14 years agoJust turn aggressive stack coloring off at -O3.
Bill Wendling [Thu, 7 May 2009 01:33:38 +0000 (01:33 +0000)]
Just turn aggressive stack coloring off at -O3.

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

14 years agoTemporarily revert r71010. It was causing massive failures during self-hosting.
Bill Wendling [Thu, 7 May 2009 01:27:25 +0000 (01:27 +0000)]
Temporarily revert r71010. It was causing massive failures during self-hosting.

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

14 years agoMake DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
Argyrios Kyrtzidis [Thu, 7 May 2009 00:16:31 +0000 (00:16 +0000)]
Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.

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

14 years agoUse stable_sort instead of plain sort to avoid the risk of generating
Dan Gohman [Wed, 6 May 2009 22:54:33 +0000 (22:54 +0000)]
Use stable_sort instead of plain sort to avoid the risk of generating
trivially different code on different hosts (due to differing
std::sort implementations).

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

14 years ago- Move some debug fields to coincide with how GCC emits them. No functionality
Bill Wendling [Wed, 6 May 2009 21:21:34 +0000 (21:21 +0000)]
- Move some debug fields to coincide with how GCC emits them. No functionality
  change.
- Reformatting.

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

14 years agoCMake: Use pthread library when requested and available.
Oscar Fuentes [Wed, 6 May 2009 20:42:04 +0000 (20:42 +0000)]
CMake: Use pthread library when requested and available.

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

14 years agoCMake: Updated lib/Target/PIC16/CMakeLists.txt.
Oscar Fuentes [Wed, 6 May 2009 20:40:05 +0000 (20:40 +0000)]
CMake: Updated lib/Target/PIC16/CMakeLists.txt.

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

14 years agoUse X86AddrNumOperands instead of magic constant one
Dale Johannesen [Wed, 6 May 2009 19:04:30 +0000 (19:04 +0000)]
Use X86AddrNumOperands instead of magic constant one
more place.  This fixes a bunch of x86-64 JIT regressions.
(Introduced when the value of the magic constant changed
in 68645.  At the time apparently nobody noticed; failures
were hidden in 70343-70439 by an unrelated bug, so showed
up again as "new" failures in 70440.)

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

14 years agoDo not use register as base ptr of pre- and post- inc/dec load / store nodes.
Evan Cheng [Wed, 6 May 2009 18:25:01 +0000 (18:25 +0000)]
Do not use register as base ptr of pre- and post- inc/dec load / store nodes.

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

14 years agoUnbreak the build.
Evan Cheng [Wed, 6 May 2009 18:00:56 +0000 (18:00 +0000)]
Unbreak the build.

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

14 years agoMake sure to use signed arithmetic in APInt to fix a regression.
David Greene [Wed, 6 May 2009 17:39:26 +0000 (17:39 +0000)]
Make sure to use signed arithmetic in APInt to fix a regression.

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

14 years agoSimplify code by using SmallVector's pop_back_val() instead of
Dan Gohman [Wed, 6 May 2009 17:22:41 +0000 (17:22 +0000)]
Simplify code by using SmallVector's pop_back_val() instead of
separate back() and pop_back() calls.

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

14 years agoAdd simplify_type specializations to allow WeakVH, AssertingVH, and
Dan Gohman [Wed, 6 May 2009 17:12:48 +0000 (17:12 +0000)]
Add simplify_type specializations to allow WeakVH, AssertingVH, and
CallbackVH to participate in dyn_cast, isa, etc. without needing
an explicit conversion.

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

14 years agoCMake: Updated lib/CodeGen/CMakeLists.txt.
Oscar Fuentes [Wed, 6 May 2009 14:56:40 +0000 (14:56 +0000)]
CMake: Updated lib/CodeGen/CMakeLists.txt.

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

14 years agoCMake: Detects libpthread and sets HAVE_LIBPTHREAD.
Oscar Fuentes [Wed, 6 May 2009 14:40:37 +0000 (14:40 +0000)]
CMake: Detects libpthread and sets HAVE_LIBPTHREAD.

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

14 years agoCMake: Added cmakedefine for HAVE_PTHREAD_H.
Oscar Fuentes [Wed, 6 May 2009 14:27:59 +0000 (14:27 +0000)]
CMake: Added cmakedefine for HAVE_PTHREAD_H.

Patch by Robert Schuster!

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

14 years agoNounwind is not valid for function return values.
Duncan Sands [Wed, 6 May 2009 13:51:18 +0000 (13:51 +0000)]
Nounwind is not valid for function return values.

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

14 years agoOCaml parameter attribute bindings from PR2752.
Duncan Sands [Wed, 6 May 2009 12:21:17 +0000 (12:21 +0000)]
OCaml parameter attribute bindings from PR2752.
Incomplete, but better than nothing.

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

14 years agoAdd generic expansion of SUB when ADD and XOR
Duncan Sands [Wed, 6 May 2009 11:29:50 +0000 (11:29 +0000)]
Add generic expansion of SUB when ADD and XOR
are legal.  Based on a patch by Micah Villmow.

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

14 years agoFix PR3754: don't mark functions that wrap MallocInst with
Duncan Sands [Wed, 6 May 2009 08:42:00 +0000 (08:42 +0000)]
Fix PR3754: don't mark functions that wrap MallocInst with
the readnone.  Since MallocInst is scheduled for deletion
it doesn't seem worth doing anything more subtle, such as
having mayWriteToMemory return true for MallocInst.

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

14 years agoEmit banksel and movlp instructions.
Sanjiv Gupta [Wed, 6 May 2009 08:02:01 +0000 (08:02 +0000)]
Emit banksel and movlp instructions.
Split large global data (both initialized and un-initialized) into multiple sections of <= 80 bytes.
Provide routines to manage PIC16 ABI naming conventions.

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

14 years agoAllow readonly functions to unwind exceptions. Teach
Duncan Sands [Wed, 6 May 2009 06:49:50 +0000 (06:49 +0000)]
Allow readonly functions to unwind exceptions.  Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.

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

14 years agoA better error message.
Mikhail Glushenkov [Wed, 6 May 2009 04:54:23 +0000 (04:54 +0000)]
A better error message.

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

14 years agoRenamed Spiller classes (plus uses and related files) to VirtRegRewriter.
Lang Hames [Wed, 6 May 2009 02:36:21 +0000 (02:36 +0000)]
Renamed Spiller classes (plus uses and related files) to VirtRegRewriter.

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

14 years agoRegenerate documentation.
Mikhail Glushenkov [Wed, 6 May 2009 01:41:47 +0000 (01:41 +0000)]
Regenerate documentation.

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

14 years agoThe 'forward_as' property did not use its second argument.
Mikhail Glushenkov [Wed, 6 May 2009 01:41:19 +0000 (01:41 +0000)]
The 'forward_as' property did not use its second argument.

See PR4159 for details. Patch by Martin Nowack!

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

14 years agoFix a copy+pasto in a comment.
Dan Gohman [Tue, 5 May 2009 23:02:38 +0000 (23:02 +0000)]
Fix a copy+pasto in a comment.

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

14 years agoDelete a FIXME which is no longer relevant, and add a FIXME that is.
Dan Gohman [Tue, 5 May 2009 22:59:55 +0000 (22:59 +0000)]
Delete a FIXME which is no longer relevant, and add a FIXME that is.

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

14 years agoQuotes should be printed before private prefix; some code clean up.
Evan Cheng [Tue, 5 May 2009 22:50:29 +0000 (22:50 +0000)]
Quotes should be printed before private prefix; some code clean up.

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

14 years agoAdd dump method to DIDescriptor.
Bill Wendling [Tue, 5 May 2009 22:19:25 +0000 (22:19 +0000)]
Add dump method to DIDescriptor.

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

14 years agoAdd an explicit keyword.
Dan Gohman [Tue, 5 May 2009 21:23:20 +0000 (21:23 +0000)]
Add an explicit keyword.

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

14 years agoIf a MachineBasicBlock has multiple ways of reaching another block,
Dan Gohman [Tue, 5 May 2009 21:10:19 +0000 (21:10 +0000)]
If a MachineBasicBlock has multiple ways of reaching another block,
allow it to have multiple CFG edges to that block. This is needed
to allow MachineBasicBlock::isOnlyReachableByFallthrough to work
correctly. This fixes PR4126.

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

14 years agoForgot this in the last commit.
Evan Cheng [Tue, 5 May 2009 20:54:11 +0000 (20:54 +0000)]
Forgot this in the last commit.

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

14 years agoTemporarily reverting r71008. It was causing this failure:
Bill Wendling [Tue, 5 May 2009 20:49:46 +0000 (20:49 +0000)]
Temporarily reverting r71008. It was causing this failure:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/
CodeGen/X86/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/
CodeGen/X86/change-compare-stride-1.ll
Failed with exit(1) at line 2
while running: grep {cmpq       $-478,} change-compare-stride-1.ll.tmp
child process exited abnormally

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

14 years agoAdd some more documentation for x86 special address spaces.
Dan Gohman [Tue, 5 May 2009 20:48:47 +0000 (20:48 +0000)]
Add some more documentation for x86 special address spaces.

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

14 years agoEnable stack coloring with regs at -O3.
Evan Cheng [Tue, 5 May 2009 20:30:36 +0000 (20:30 +0000)]
Enable stack coloring with regs at -O3.

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

14 years agoHandle overflow of 64-bit loop conditions.
David Greene [Tue, 5 May 2009 20:22:36 +0000 (20:22 +0000)]
Handle overflow of 64-bit loop conditions.

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

14 years agoAdd basic support for code generation of
Chris Lattner [Tue, 5 May 2009 18:52:19 +0000 (18:52 +0000)]
Add basic support for code generation of
addrspace(257) -> FS relative on x86.  Patch by Zoltan Varga!

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

14 years agobugpoint for jit should just ignore GCC arguments.
Evan Cheng [Tue, 5 May 2009 18:35:36 +0000 (18:35 +0000)]
bugpoint for jit should just ignore GCC arguments.

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

14 years agoRevert part of 70929 that has to do with determining whether a SIB byte is needed...
Evan Cheng [Tue, 5 May 2009 18:18:57 +0000 (18:18 +0000)]
Revert part of 70929 that has to do with determining whether a SIB byte is needed. It causes a lot of x86_64 JIT failures.

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

14 years agoAllow multiclass def names to contain "#NAME"" where TableGen replaces
David Greene [Tue, 5 May 2009 16:28:25 +0000 (16:28 +0000)]
Allow multiclass def names to contain "#NAME"" where TableGen replaces
#NAME# with the name of the defm instantiating the multiclass.  This is
useful for AVX instruction naming where a "V" prefix is standard
throughout the ISA.  For example:

multiclass SSE_AVX_Inst<...> {
   def SS : Instr<...>;
   def SD : Instr<...>;
   def PS : Instr<...>;
   def PD : Instr<...>;

   def V#NAME#SS : Instr<...>;
   def V#NAME#SD : Instr<...>;
   def V#NAME#PS : Instr<...>;
   def V#NAME#PD : Instr<...>;
}

defm ADD : SSE_AVX_Inst<...>;

Results in

ADDSS
ADDSD
ADDPS
ADDPD

VADDSS
VADDSD
VADDPS
VADDPD

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

14 years agoFix incorrect code generation with ENV.
Mikhail Glushenkov [Tue, 5 May 2009 12:34:34 +0000 (12:34 +0000)]
Fix incorrect code generation with ENV.

See PR4157 for details. Patch by Martin Nowack!

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

14 years agoDo not require variable debug info nodes to have a compile unit.
Chris Lattner [Tue, 5 May 2009 04:55:56 +0000 (04:55 +0000)]
Do not require variable debug info nodes to have a compile unit.
For implicit decls like "self" and "_cmd" in ObjC, these decls
should not have a location.

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

14 years agoDo not substitute if the new register isn't in the register class of the operand...
Evan Cheng [Tue, 5 May 2009 00:46:16 +0000 (00:46 +0000)]
Do not substitute if the new register isn't in the register class of the operand being updated.

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

14 years agoMove getInstrOperandRegClass from the scheduler to TargetInstrInfo.
Evan Cheng [Tue, 5 May 2009 00:30:09 +0000 (00:30 +0000)]
Move getInstrOperandRegClass from the scheduler to TargetInstrInfo.

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

14 years agoDo forward and backward substitution to eliminate loads and stores when possible.
Evan Cheng [Mon, 4 May 2009 23:13:13 +0000 (23:13 +0000)]
Do forward and backward substitution to eliminate loads and stores when possible.

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

14 years agoDefault llc / lli optimization to "Default", which corresponds to -O1 / -O2.
Evan Cheng [Mon, 4 May 2009 23:05:19 +0000 (23:05 +0000)]
Default llc / lli optimization to "Default", which corresponds to -O1 / -O2.

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

14 years ago- Avoid the longer SIB encoding on x86_64 when it's not needed.
Evan Cheng [Mon, 4 May 2009 22:49:16 +0000 (22:49 +0000)]
- Avoid the longer SIB encoding on x86_64 when it's not needed.
- Synchronize instruction length computation code in X86InstrInfo with code in X86CodeEmitter.cpp
Patch by Zoltan Varga.

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

14 years agoRe-apply 70645, converting ScalarEvolution to use
Dan Gohman [Mon, 4 May 2009 22:30:44 +0000 (22:30 +0000)]
Re-apply 70645, converting ScalarEvolution to use
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.

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

14 years agoFix an 80-column violation.
Dan Gohman [Mon, 4 May 2009 22:23:18 +0000 (22:23 +0000)]
Fix an 80-column violation.

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

14 years agoFix doxygen comment syntax.
Dan Gohman [Mon, 4 May 2009 22:20:30 +0000 (22:20 +0000)]
Fix doxygen comment syntax.

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

14 years agoMake DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so that it
Chris Lattner [Mon, 4 May 2009 22:10:05 +0000 (22:10 +0000)]
Make DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so that it
shows up in -print-machineinstrs.  This doesn't appear to affect anything, but it was
weird for some DBG_LABELs to have DebugLocs but not all of them.

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

14 years agoConstify a bunch of SCEV-using code.
Dan Gohman [Mon, 4 May 2009 22:02:23 +0000 (22:02 +0000)]
Constify a bunch of SCEV-using code.

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

14 years agoX86FastISel doesn't support the -tailcallopt ABI.
Dan Gohman [Mon, 4 May 2009 19:50:33 +0000 (19:50 +0000)]
X86FastISel doesn't support the -tailcallopt ABI.

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

14 years agoRestore a comment.
Argyrios Kyrtzidis [Mon, 4 May 2009 19:23:45 +0000 (19:23 +0000)]
Restore a comment.

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

14 years agoFix code emission for conditional branches.
Anton Korobeynikov [Mon, 4 May 2009 19:10:38 +0000 (19:10 +0000)]
Fix code emission for conditional branches.
Patch by Collin Winter!

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

14 years agoRestore minor deletion.
Mike Stump [Mon, 4 May 2009 18:40:41 +0000 (18:40 +0000)]
Restore minor deletion.

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

14 years agoTypo.
Evan Cheng [Sun, 3 May 2009 19:10:11 +0000 (19:10 +0000)]
Typo.

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

14 years agoRemove obsolete wording, the only exception a readnone function can throw
Chris Lattner [Sun, 3 May 2009 19:06:00 +0000 (19:06 +0000)]
Remove obsolete wording, the only exception a readnone function can throw
is the empty set. :)  Thanks to Fritz for pointing this out.

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

14 years agobe very explicit that readnone/readonly functions can't
Chris Lattner [Sun, 3 May 2009 18:49:37 +0000 (18:49 +0000)]
be very explicit that readnone/readonly functions can't
throw exceptions.

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

14 years agoIn some rare cases, the register allocator can spill registers but end up not utilizi...
Evan Cheng [Sun, 3 May 2009 18:32:42 +0000 (18:32 +0000)]
In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However,  reloads and restores might be folded into uses / defs and freed registers might not be used at all.

VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.

Not yet enabled. This is part 1. More coming.

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

14 years agoHandle implicit zext in a better way. Shamelessly stolen from x86 backend.
Anton Korobeynikov [Sun, 3 May 2009 15:50:18 +0000 (15:50 +0000)]
Handle implicit zext in a better way. Shamelessly stolen from x86 backend.
Thanks for Dan Gohman for suggestion!

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

14 years agoRegenerate
Anton Korobeynikov [Sun, 3 May 2009 13:42:23 +0000 (13:42 +0000)]
Regenerate

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

14 years agoFix typo
Anton Korobeynikov [Sun, 3 May 2009 13:19:57 +0000 (13:19 +0000)]
Fix typo

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

14 years agoUpdate due to mainline API change
Anton Korobeynikov [Sun, 3 May 2009 13:19:42 +0000 (13:19 +0000)]
Update due to mainline API change

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

14 years agoAdd TODO list :)
Anton Korobeynikov [Sun, 3 May 2009 13:19:24 +0000 (13:19 +0000)]
Add TODO list :)

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

14 years agoMake handling of conditional stuff much more straightforward
Anton Korobeynikov [Sun, 3 May 2009 13:19:09 +0000 (13:19 +0000)]
Make handling of conditional stuff much more straightforward

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

14 years agoTemporary disable imm patterns for cmp. Actually, all cmp-related stuff (select_cc...
Anton Korobeynikov [Sun, 3 May 2009 13:18:50 +0000 (13:18 +0000)]
Temporary disable imm patterns for cmp. Actually, all cmp-related stuff (select_cc, setcc, br_cc). needs to be rethought

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

14 years agoExpand divisions into libcalls
Anton Korobeynikov [Sun, 3 May 2009 13:18:33 +0000 (13:18 +0000)]
Expand divisions into libcalls

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

14 years agoProperly handle sdiv / udiv / srem / urem libcalls
Anton Korobeynikov [Sun, 3 May 2009 13:18:16 +0000 (13:18 +0000)]
Properly handle sdiv / udiv / srem / urem libcalls

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

14 years agoCustom lower SIGN_EXTEND
Anton Korobeynikov [Sun, 3 May 2009 13:17:49 +0000 (13:17 +0000)]
Custom lower SIGN_EXTEND

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

14 years agoSome eye-candy
Anton Korobeynikov [Sun, 3 May 2009 13:17:31 +0000 (13:17 +0000)]
Some eye-candy

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

14 years agoPrint function header / footer
Anton Korobeynikov [Sun, 3 May 2009 13:17:11 +0000 (13:17 +0000)]
Print function header / footer

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