oota-llvm.git
14 years agoFix a bunch of ambiguous patterns which tblgen happens to infer types
Chris Lattner [Mon, 8 Mar 2010 18:44:04 +0000 (18:44 +0000)]
Fix a bunch of ambiguous patterns which tblgen happens to infer types
for, due to a bug.

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

14 years agoNode arguments to type casts can have names too. This code
Chris Lattner [Mon, 8 Mar 2010 18:36:19 +0000 (18:36 +0000)]
Node arguments to type casts can have names too.  This code
needs to be majorly refactored, but this spot bugfix allows
things like:

 def vmrghw_shuffle : PatFrag<(ops node:$lhs, node:$rhs),
                             (vector_shuffle (v4i32 node:$lhs), node:$rhs), [{
...

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

14 years agotidy up
Chris Lattner [Mon, 8 Mar 2010 18:29:38 +0000 (18:29 +0000)]
tidy up

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

14 years agoAvoid using DIDescriptor.isNull().
Devang Patel [Mon, 8 Mar 2010 18:25:48 +0000 (18:25 +0000)]
Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.

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

14 years agoAdd Order to SDDbgValue
Dale Johannesen [Mon, 8 Mar 2010 05:39:50 +0000 (05:39 +0000)]
Add Order to SDDbgValue

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

14 years agoFix dbg value handling in tail merging.
Dale Johannesen [Mon, 8 Mar 2010 05:38:13 +0000 (05:38 +0000)]
Fix dbg value handling in tail merging.

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

14 years agoremove a non-temporal store pattern which is not tested and
Chris Lattner [Mon, 8 Mar 2010 03:18:28 +0000 (03:18 +0000)]
remove a non-temporal store pattern which is not tested and
could never have matched because the operand list was backwards.

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

14 years agoRevert r97917, which was causing Clang Debug self-host failures.
Douglas Gregor [Mon, 8 Mar 2010 02:58:37 +0000 (02:58 +0000)]
Revert r97917, which was causing Clang Debug self-host failures.

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

14 years agoRoll back r97918 again. Just configuring against llvm-gcc wasn't enough to run
Jeffrey Yasskin [Sun, 7 Mar 2010 19:26:40 +0000 (19:26 +0000)]
Roll back r97918 again.  Just configuring against llvm-gcc wasn't enough to run
the FrontendC* tests. :(

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

14 years agoReapply r97788 to free MDNodes when the LLVMContext is destroyed. It
Jeffrey Yasskin [Sun, 7 Mar 2010 18:46:57 +0000 (18:46 +0000)]
Reapply r97788 to free MDNodes when the LLVMContext is destroyed.  It
bootstraps llvm-gcc this time.

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

14 years agoRoll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.
Jeffrey Yasskin [Sun, 7 Mar 2010 17:10:13 +0000 (17:10 +0000)]
Roll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.

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

14 years agoAdd findNearestCommonDominator() for PostDominators.
Tobias Grosser [Sun, 7 Mar 2010 11:15:04 +0000 (11:15 +0000)]
Add findNearestCommonDominator() for PostDominators.

Add a missing interface to be able to call findNearestCommonDominator
for a PostDominanceTree. The function itself is already implemented in
DominatorTreeBase. The interface however was only added to the
DominatorTree class, but not the PostDominatorClass.

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

14 years agoUse Other as a sentinel instead of iAny.
Chris Lattner [Sun, 7 Mar 2010 07:45:08 +0000 (07:45 +0000)]
Use Other as a sentinel instead of iAny.

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

14 years agoturn off debug spew
Chris Lattner [Sun, 7 Mar 2010 07:21:24 +0000 (07:21 +0000)]
turn off debug spew

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

14 years agomore factoring.
Chris Lattner [Sun, 7 Mar 2010 07:20:49 +0000 (07:20 +0000)]
more factoring.

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

14 years ago_2_ gcc crashes, ah, ah, ah...
Jeffrey Yasskin [Sun, 7 Mar 2010 07:16:49 +0000 (07:16 +0000)]
_2_ gcc crashes, ah, ah, ah...

(Rolling back r97906.)

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

14 years agoteach tblgen to be more aggressive when factoring CheckType nodes.
Chris Lattner [Sun, 7 Mar 2010 07:01:28 +0000 (07:01 +0000)]
teach tblgen to be more aggressive when factoring CheckType nodes.
Now it will factor things like this:

CheckType i32
  ...
CheckOpcode ISD::AND
  CheckType i64
  ...

into:

SwitchType:
  i32: ...
  i64:
    CheckOpcode ISD::AND
    ...

This shrinks hte table by a few bytes, nothing spectacular.

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

14 years agoAvoid leaking CompileUnits and DbgScopes from DwarfDebug. Leaks found by Valgrind!
Jeffrey Yasskin [Sun, 7 Mar 2010 06:55:35 +0000 (06:55 +0000)]
Avoid leaking CompileUnits and DbgScopes from DwarfDebug.  Leaks found by Valgrind!

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

14 years agoadd some helper functions and implement isContradictory
Chris Lattner [Sun, 7 Mar 2010 06:29:26 +0000 (06:29 +0000)]
add some helper functions and implement isContradictory
for CheckValueTypeMatcher.  The isContradictory implementation
helps us factor better, shrinking x86 table from 79144 -> 78896
bytes.

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

14 years agotidy up
Chris Lattner [Sun, 7 Mar 2010 04:28:09 +0000 (04:28 +0000)]
tidy up

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

14 years agoRe-committing the failed r97807 commit with changes to eliminate warnings.
Wesley Peck [Sat, 6 Mar 2010 23:23:12 +0000 (23:23 +0000)]
Re-committing the failed r97807 commit with changes to eliminate warnings.

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

14 years agoAdd verification of union types.
Nick Lewycky [Sat, 6 Mar 2010 20:26:48 +0000 (20:26 +0000)]
Add verification of union types.

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

14 years agoDescribe what's going on with mingw alloca and why do we need separate instruction.
Anton Korobeynikov [Sat, 6 Mar 2010 20:07:32 +0000 (20:07 +0000)]
Describe what's going on with mingw alloca and why do we need separate instruction.

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

14 years agoInitial bits of ARMv4-only support.
Anton Korobeynikov [Sat, 6 Mar 2010 19:39:36 +0000 (19:39 +0000)]
Initial bits of ARMv4-only support.
Patch by John Tytgat!

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

14 years agoLower dynamic stack allocation on mingw32 to separate instruction.
Anton Korobeynikov [Sat, 6 Mar 2010 19:32:29 +0000 (19:32 +0000)]
Lower dynamic stack allocation on mingw32 to separate instruction.
We cannot use a normal call here since it has extra unmodelled side
effects (it changes stack pointer). This should fix PR5292.

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

14 years agomake APFloat::toString be const.
Chris Lattner [Sat, 6 Mar 2010 19:20:13 +0000 (19:20 +0000)]
make APFloat::toString be const.

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

14 years agodisable this for mingw as well, we really need a 'has no dynamic linking' predicate.
Chris Lattner [Sat, 6 Mar 2010 18:54:37 +0000 (18:54 +0000)]
disable this for mingw as well, we really need a 'has no dynamic linking' predicate.

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

14 years agoDo not use '&' prefix for globals when register base field is non-zero, otherwise...
Anton Korobeynikov [Sat, 6 Mar 2010 11:41:12 +0000 (11:41 +0000)]
Do not use '&' prefix for globals when register base field is non-zero, otherwise msp430-as will silently miscompile the code (TI's assembler report an error though).

This fixes PR6349

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

14 years agoLet the fallthrough handle whether or not we've changed anything
Eric Christopher [Sat, 6 Mar 2010 10:59:25 +0000 (10:59 +0000)]
Let the fallthrough handle whether or not we've changed anything
before we try to optimize.

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

14 years agoMigrate _chk call lowering from SimplifyLibCalls to InstCombine. Stub
Eric Christopher [Sat, 6 Mar 2010 10:50:38 +0000 (10:50 +0000)]
Migrate _chk call lowering from SimplifyLibCalls to InstCombine. Stub
out the remainder of the calls that we should lower in some way and
move the tests to the new correct directory. Fix up tests that are now
optimized more than they were before by -instcombine.

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

14 years agoAdd static methods to handle Linkage Types.
Rafael Espindola [Sat, 6 Mar 2010 07:22:39 +0000 (07:22 +0000)]
Add static methods to handle Linkage Types.

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

14 years agoclean this up.
Chris Lattner [Sat, 6 Mar 2010 07:02:28 +0000 (07:02 +0000)]
clean this up.

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

14 years agorevert r97807, it introduced build warnings.
Chris Lattner [Sat, 6 Mar 2010 04:32:46 +0000 (04:32 +0000)]
revert r97807, it introduced build warnings.

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

14 years agoThumb1 epilogue code generation needs to take into account that callee-saved
Jim Grosbach [Sat, 6 Mar 2010 03:28:39 +0000 (03:28 +0000)]
Thumb1 epilogue code generation needs to take into account that callee-saved
registers may be restored via a pop instruction, not just a tRestore.
This fixes nightly test 471.omnetep for Thumb1.

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

14 years agoTemporarily revert:
Eric Christopher [Sat, 6 Mar 2010 03:11:35 +0000 (03:11 +0000)]
Temporarily revert:

Log:
Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.

Modified:
   llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
   llvm/trunk/test/Transforms/InstCombine/objsize.ll

It appears to be causing swb and nightly test failures.

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

14 years agoFix another case where LSR was affected by debug info.
Dale Johannesen [Sat, 6 Mar 2010 02:45:26 +0000 (02:45 +0000)]
Fix another case where LSR was affected by debug info.

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

14 years agoDon't update physical register def.
Evan Cheng [Sat, 6 Mar 2010 01:14:19 +0000 (01:14 +0000)]
Don't update physical register def.

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

14 years agoTransform @llvm.objectsize to integer if the argument is a result of malloc of known...
Evan Cheng [Sat, 6 Mar 2010 01:01:42 +0000 (01:01 +0000)]
Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.

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

14 years agoAdd a LLVMWriteBitcodeToFD that exposes the raw_fd_ostream options.
Erick Tryzelaar [Sat, 6 Mar 2010 00:30:06 +0000 (00:30 +0000)]
Add a LLVMWriteBitcodeToFD that exposes the raw_fd_ostream options.

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

14 years agoWhoops, the old LLVMWriteBitcodeToFileHandle closed the stream.
Erick Tryzelaar [Sat, 6 Mar 2010 00:30:01 +0000 (00:30 +0000)]
Whoops, the old LLVMWriteBitcodeToFileHandle closed the stream.

Luckily this never was released.

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

14 years agoLLVMWriteBitcodeToFileHandle should work on all architectures now.
Erick Tryzelaar [Sat, 6 Mar 2010 00:29:58 +0000 (00:29 +0000)]
LLVMWriteBitcodeToFileHandle should work on all architectures now.

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

14 years agoAdd some new bits of debug info handling. No
Dale Johannesen [Sat, 6 Mar 2010 00:03:23 +0000 (00:03 +0000)]
Add some new bits of debug info handling.  No
functional change yet.

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

14 years agoReapply r97778 and r97779, enabled only for unsigned i64 to f64
Dan Gohman [Sat, 6 Mar 2010 00:00:55 +0000 (00:00 +0000)]
Reapply r97778 and r97779, enabled only for unsigned i64 to f64
conversions.

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

14 years agoTest case for r97851.
Devang Patel [Fri, 5 Mar 2010 23:35:04 +0000 (23:35 +0000)]
Test case for r97851.

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

14 years agoUpdate CMake build.
Ted Kremenek [Fri, 5 Mar 2010 22:34:16 +0000 (22:34 +0000)]
Update CMake build.

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

14 years agoDon't emit global symbols into the (__TEXT,__ustring) section on Darwin. This
Charles Davis [Fri, 5 Mar 2010 22:28:45 +0000 (22:28 +0000)]
Don't emit global symbols into the (__TEXT,__ustring) section on Darwin. This
is a workaround for <rdar://problem/7672401/> (which I filed).

This let's us build Wine on Darwin, and it gets the Qt build there a little bit
further (so Doug says).

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

14 years agoMove SimplifyLibCalls's LibCall builders to a separate file so they
Eric Christopher [Fri, 5 Mar 2010 22:25:30 +0000 (22:25 +0000)]
Move SimplifyLibCalls's LibCall builders to a separate file so they
can be used in more places.  Add an argument for the TargetData that
most of them need. Update for the getInt8PtrTy() change.  Should be
no functionality change.

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

14 years agoAdd support for an i8* type accessor.
Eric Christopher [Fri, 5 Mar 2010 22:21:58 +0000 (22:21 +0000)]
Add support for an i8* type accessor.

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

14 years agoBetter handling of dead super registers in LiveVariables. We used to do this:
Jakob Stoklund Olesen [Fri, 5 Mar 2010 21:49:17 +0000 (21:49 +0000)]
Better handling of dead super registers in LiveVariables. We used to do this:

   CALL ... %RAX<imp-def>
   ... [not using %RAX]
   %EAX = ..., %RAX<imp-use, kill>
   RET %EAX<imp-use,kill>

Now we do this:

   CALL ... %RAX<imp-def, dead>
   ... [not using %RAX]
   %EAX = ...
   RET %EAX<imp-use,kill>

By not artificially keeping %RAX alive, we lower register pressure a bit.

The correct number of instructions for 2008-08-05-SpillerBug.ll is obviously
55, anybody can see that. Sheesh.

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

14 years agoWe don't really care about correct register liveness information after the
Jakob Stoklund Olesen [Fri, 5 Mar 2010 21:49:13 +0000 (21:49 +0000)]
We don't really care about correct register liveness information after the
post-ra scheduler has run. Disable the verifier checks that late in the game.

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

14 years agoAvoid creating bad PHI instructions when BR is being const-folded.
Jakob Stoklund Olesen [Fri, 5 Mar 2010 21:49:10 +0000 (21:49 +0000)]
Avoid creating bad PHI instructions when BR is being const-folded.

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

14 years agoFix a case where LSR is sensitive to debug info.
Dale Johannesen [Fri, 5 Mar 2010 21:12:40 +0000 (21:12 +0000)]
Fix a case where LSR is sensitive to debug info.

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

14 years agoSafely turn memset_chk etc. to non-chk variant if the known object size is >= memset...
Evan Cheng [Fri, 5 Mar 2010 20:59:47 +0000 (20:59 +0000)]
Safely turn memset_chk etc. to non-chk variant if the known object size is >= memset / memcpy / memmove size.

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

14 years agoInstcombine should turn llvm.objectsize of a alloca with static size to an integer.
Evan Cheng [Fri, 5 Mar 2010 20:47:23 +0000 (20:47 +0000)]
Instcombine should turn llvm.objectsize of a alloca with static size to an integer.

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

14 years agoFix typo.
Evan Cheng [Fri, 5 Mar 2010 19:55:55 +0000 (19:55 +0000)]
Fix typo.

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

14 years agofix bss section printing for cell, patch by Kalle Raiskila!
Chris Lattner [Fri, 5 Mar 2010 18:55:36 +0000 (18:55 +0000)]
fix bss section printing for cell, patch by Kalle Raiskila!

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

14 years agofix PR6512, a case where instcombine would incorrectly merge loads
Chris Lattner [Fri, 5 Mar 2010 18:53:28 +0000 (18:53 +0000)]
fix PR6512, a case where instcombine would incorrectly merge loads
from different addr spaces.

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

14 years agoReworking the stack layout that the MicroBlaze backend generates.
Wesley Peck [Fri, 5 Mar 2010 15:26:02 +0000 (15:26 +0000)]
Reworking the stack layout that the MicroBlaze backend generates.

The MicroBlaze backend was generating stack layouts that did not
conform correctly to the ABI. This update generates stack layouts
which are closer to what GCC does.

Variable arguments support was added as well but the stack layout
for varargs has not been finalized.

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

14 years agoAdding MBlaze to cmake target list.
Wesley Peck [Fri, 5 Mar 2010 15:15:55 +0000 (15:15 +0000)]
Adding MBlaze to cmake target list.

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

14 years agoFix PR6503. This turned into a much more interesting and nasty bug. Various
Chris Lattner [Fri, 5 Mar 2010 08:46:26 +0000 (08:46 +0000)]
Fix PR6503.  This turned into a much more interesting and nasty bug.  Various
parts of the cmp|cmp and cmp&cmp folding logic wasn't prepared for vectors
(unrelated to the bug but noticed while in the code) and the code was
*definitely* not safe to use by the (cast icmp)|(cast icmp) handling logic
that I added in r95855.  Fix all this up by changing the various routines
to more consistently use IRBuilder and not pass in the I which had the wrong
type.

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

14 years agomake these less sensitive to temporary naming.
Chris Lattner [Fri, 5 Mar 2010 08:43:33 +0000 (08:43 +0000)]
make these less sensitive to temporary naming.

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

14 years agoremove this testcase, it isn't clear what it was testing and it is subsumed by or.ll
Chris Lattner [Fri, 5 Mar 2010 08:43:06 +0000 (08:43 +0000)]
remove this testcase, it isn't clear what it was testing and it is subsumed by or.ll

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

14 years agoFix an oops in x86 sibcall optimization. If the ByVal callee argument is itself passe...
Evan Cheng [Fri, 5 Mar 2010 08:38:04 +0000 (08:38 +0000)]
Fix an oops in x86 sibcall optimization. If the ByVal callee argument is itself passed as a pointer, then it's obviously not safe to do a tail call.

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

14 years agoIf LD_LIBRARY_PATH is set in the system environment, use it.
Duncan Sands [Fri, 5 Mar 2010 08:21:02 +0000 (08:21 +0000)]
If LD_LIBRARY_PATH is set in the system environment, use it.

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

14 years agosimplify some functions and make them work with vector
Chris Lattner [Fri, 5 Mar 2010 07:47:57 +0000 (07:47 +0000)]
simplify some functions and make them work with vector
compares, noticed by inspection.

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

14 years agofix a nice subtle reassociate bug which would only occur
Chris Lattner [Fri, 5 Mar 2010 07:18:54 +0000 (07:18 +0000)]
fix a nice subtle reassociate bug which would only occur
in a very specific use pattern embodied in the carefully
reduced testcase.

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

14 years agoMove GetStringLength and helper from SimplifyLibCalls to ValueTracking.
Eric Christopher [Fri, 5 Mar 2010 06:58:57 +0000 (06:58 +0000)]
Move GetStringLength and helper from SimplifyLibCalls to ValueTracking.
No functionality change.

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

14 years agoRevert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.
Jeffrey Yasskin [Fri, 5 Mar 2010 06:43:49 +0000 (06:43 +0000)]
Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.

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

14 years agoFix PR6497, a bug where we'd fold a load into an addc
Chris Lattner [Fri, 5 Mar 2010 06:19:13 +0000 (06:19 +0000)]
Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag.  That flag in turn was used by an
already-selected adde which turned into an ADC32ri8 which
used a selected load which was chained to the load we
folded.  This flag use caused us to form a cycle.  Fix
this by not ignoring chains in IsLegalToFold even in
cases where the isel thinks it can.

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

14 years agocleanup
Chris Lattner [Fri, 5 Mar 2010 06:17:43 +0000 (06:17 +0000)]
cleanup

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

14 years agoinline a small function with one call site.
Chris Lattner [Fri, 5 Mar 2010 05:49:45 +0000 (05:49 +0000)]
inline a small function with one call site.

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

14 years agoFree MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.
Jeffrey Yasskin [Fri, 5 Mar 2010 05:47:09 +0000 (05:47 +0000)]
Free MDNodes when the LLVMContext is destroyed.  Leak found by Valgrind.

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

14 years agoMake it not an error to specify -O* options several times.
Mikhail Glushenkov [Fri, 5 Mar 2010 04:46:39 +0000 (04:46 +0000)]
Make it not an error to specify -O* options several times.

As in 'llvmc -O2 -O2 test.c'.

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

14 years agoUse FindExecutable as a fall-back search method.
Mikhail Glushenkov [Fri, 5 Mar 2010 04:46:28 +0000 (04:46 +0000)]
Use FindExecutable as a fall-back search method.

Allows us to find executables that are in the same directory.

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

14 years agoRever 96389 and 96990. They are causing some miscompilation that I do not fully under...
Evan Cheng [Fri, 5 Mar 2010 03:08:23 +0000 (03:08 +0000)]
Rever 96389 and 96990. They are causing some miscompilation that I do not fully understand.

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

14 years agoRevert r97778 and r97779. They're somehow breaking llvm-gcc builds.
Dan Gohman [Fri, 5 Mar 2010 02:40:23 +0000 (02:40 +0000)]
Revert r97778 and r97779. They're somehow breaking llvm-gcc builds.

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

14 years agoapparently if gold is around lto needs to be part of DIRS.
Chris Lattner [Fri, 5 Mar 2010 02:34:34 +0000 (02:34 +0000)]
apparently if gold is around lto needs to be part of DIRS.

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

14 years agoFix these constants to be more portable.
Dan Gohman [Fri, 5 Mar 2010 02:13:10 +0000 (02:13 +0000)]
Fix these constants to be more portable.

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

14 years agoRewrite i64-to-f64 conversion using an algorithm which handles
Dan Gohman [Fri, 5 Mar 2010 02:00:46 +0000 (02:00 +0000)]
Rewrite i64-to-f64 conversion using an algorithm which handles
rounding correctly. This implementation is a generalization of
the x86_64 code in compiler-rt.

This fixes rdar://7683708.

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

14 years agoTrivial comment change.
Johnny Chen [Fri, 5 Mar 2010 01:45:46 +0000 (01:45 +0000)]
Trivial comment change.

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

14 years agoAdd missing break for Intrinsic::objectsize case. It was falling through to the follo...
Evan Cheng [Fri, 5 Mar 2010 01:22:47 +0000 (01:22 +0000)]
Add missing break for Intrinsic::objectsize case. It was falling through to the following Intrinsic::bswap code. I have no idea why it wasn't breaking stuff.

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

14 years agodisable libprofile on cygwin, patch by Aaron Gray.
Chris Lattner [Fri, 5 Mar 2010 01:00:34 +0000 (01:00 +0000)]
disable libprofile on cygwin, patch by Aaron Gray.

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

14 years agoOnly build libedis if ENABLE_SHARED is specified, just like liblto.
Chris Lattner [Fri, 5 Mar 2010 00:59:18 +0000 (00:59 +0000)]
Only build libedis if ENABLE_SHARED is specified, just like liblto.
Don't build any of the dynamic library stuff on cygwin/mingw.

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

14 years agoliblto and gold don't need to be built in serial
Chris Lattner [Fri, 5 Mar 2010 00:54:45 +0000 (00:54 +0000)]
liblto and gold don't need to be built in serial

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

14 years agoadd an assertion requested on llvmdev.
Chris Lattner [Fri, 5 Mar 2010 00:49:08 +0000 (00:49 +0000)]
add an assertion requested on llvmdev.

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

14 years agoRevert r97766. It's deleting a tag.
Bill Wendling [Fri, 5 Mar 2010 00:33:59 +0000 (00:33 +0000)]
Revert r97766. It's deleting a tag.

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

14 years agoMicro-optimization:
Bill Wendling [Fri, 5 Mar 2010 00:24:26 +0000 (00:24 +0000)]
Micro-optimization:

This code:

float floatingPointComparison(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

produces this:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jne             0x00000004
0000000000000016        jp              0x00000002
0000000000000018        jmp             0x00000008
000000000000001a        addsd           0x00000006(%rip),%xmm0
0000000000000022        cvtsd2ss        %xmm0,%xmm0
0000000000000026        ret

The "jne/jp/jmp" sequence can be reduced to this instead:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jp              0x00000002
0000000000000016        je              0x00000008
0000000000000018        addsd           0x00000006(%rip),%xmm0
0000000000000020        cvtsd2ss        %xmm0,%xmm0
0000000000000024        ret

for a savings of 2 bytes.

This xform can happen when we recognize that jne and jp jump to the same "true"
MBB, the unconditional jump would jump to the "false" MBB, and the "true" branch
is the fall-through MBB.

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

14 years agoFix some more places where dbg_value affected codegen.
Dale Johannesen [Fri, 5 Mar 2010 00:02:59 +0000 (00:02 +0000)]
Fix some more places where dbg_value affected codegen.

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

14 years agoAdd metadata example.
Devang Patel [Thu, 4 Mar 2010 23:44:48 +0000 (23:44 +0000)]
Add metadata example.

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

14 years agoStop leaking MDStrings.
Jeffrey Yasskin [Thu, 4 Mar 2010 23:24:19 +0000 (23:24 +0000)]
Stop leaking MDStrings.

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

14 years agoDrop the ".w" qualifier for t2UXTB16* instructions as there is no 16-bit version
Johnny Chen [Thu, 4 Mar 2010 22:24:41 +0000 (22:24 +0000)]
Drop the ".w" qualifier for t2UXTB16* instructions as there is no 16-bit version
of either sxtb16 or uxtb16, and the unified syntax does not specify ".w".

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

14 years agoFix memcheck-found leaks: one false positive from using new[], and one true
Jeffrey Yasskin [Thu, 4 Mar 2010 22:15:01 +0000 (22:15 +0000)]
Fix memcheck-found leaks: one false positive from using new[], and one true
positive where pointers would be leaked on llvm_shutdown.

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

14 years agoFor SJLJ exception handling, make sure that all calls that are not marked
Jim Grosbach [Thu, 4 Mar 2010 22:07:46 +0000 (22:07 +0000)]
For SJLJ exception handling, make sure that all calls that are not marked
as nounwind are marked with a -1 call-site value. This is necessary to, for
example, correctly process exceptions thrown from within an "unexpected"
execption handler (see SingleSource/Regression/C++/EH/expection_spec_test.cpp).

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

14 years agopr6478: The frame pointer spill frame index is only defined when there is a
Bob Wilson [Thu, 4 Mar 2010 21:42:36 +0000 (21:42 +0000)]
pr6478: The frame pointer spill frame index is only defined when there is a
frame pointer.

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

14 years agoRun machine licm before machine cse to avoid messing up licm opportunities.
Evan Cheng [Thu, 4 Mar 2010 21:28:09 +0000 (21:28 +0000)]
Run machine licm before machine cse to avoid messing up licm opportunities.

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

14 years agoAvoid cse load instructions unless they are known to be invariant loads.
Evan Cheng [Thu, 4 Mar 2010 21:18:08 +0000 (21:18 +0000)]
Avoid cse load instructions unless they are known to be invariant loads.

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

14 years agopr6480: Don't try producing ld/st-multiple instructions when the address is
Bob Wilson [Thu, 4 Mar 2010 21:04:38 +0000 (21:04 +0000)]
pr6480: Don't try producing ld/st-multiple instructions when the address is
an undef value.  This is only going to come up for bugpoint-reduced tests --
correct programs will not access memory at undefined addresses -- so it's not
worth the effort of doing anything more aggressive.

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

14 years agoRewrite makefiles to explicitly reference DESTDIR to fix bug 3153.
Erick Tryzelaar [Thu, 4 Mar 2010 20:56:19 +0000 (20:56 +0000)]
Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153.

We need this so can not bake DESTDIR into the O'Caml symlinks.

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

14 years agoFix the remaining MUL8 and DIV8 to define AX instead of AL,AH.
Jakob Stoklund Olesen [Thu, 4 Mar 2010 20:42:07 +0000 (20:42 +0000)]
Fix the remaining MUL8 and DIV8 to define AX instead of AL,AH.

These instructions technically define AL,AH, but a trick in X86ISelDAGToDAG
reads AX in order to avoid reading AH with a REX instruction.

Fix PR6489.

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

14 years agoFix recognition of 16-bit bswap for C front-ends which emit the
Dan Gohman [Thu, 4 Mar 2010 19:58:08 +0000 (19:58 +0000)]
Fix recognition of 16-bit bswap for C front-ends which emit the
clobber registers in a different order.

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