oota-llvm.git
14 years agoChanged REG_* to MODRM_REG_* to avoid conflicts
Sean Callanan [Tue, 22 Dec 2009 02:07:42 +0000 (02:07 +0000)]
Changed REG_* to MODRM_REG_* to avoid conflicts
with symbols in AuroraUX's global namespace.

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

14 years agoFix some may-be-uninitialized var warnings.
Daniel Dunbar [Tue, 22 Dec 2009 01:41:37 +0000 (01:41 +0000)]
Fix some may-be-uninitialized var warnings.

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

14 years agofix unit test that I broke.
Chris Lattner [Tue, 22 Dec 2009 01:38:23 +0000 (01:38 +0000)]
fix unit test that I broke.

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

14 years agoAdd SDNode ordering to inlined asm and VA functions.
Bill Wendling [Tue, 22 Dec 2009 01:25:10 +0000 (01:25 +0000)]
Add SDNode ordering to inlined asm and VA functions.

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

14 years agoWhitespace fixes.
Eric Christopher [Tue, 22 Dec 2009 01:23:51 +0000 (01:23 +0000)]
Whitespace fixes.

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

14 years agotypes don't need atomic inc/dec, they are local to an llvmcontext.
Chris Lattner [Tue, 22 Dec 2009 01:17:43 +0000 (01:17 +0000)]
types don't need atomic inc/dec, they are local to an llvmcontext.

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

14 years agoAdding more assignment of ordering to SDNodes. This time in the "call" and
Bill Wendling [Tue, 22 Dec 2009 01:11:43 +0000 (01:11 +0000)]
Adding more assignment of ordering to SDNodes. This time in the "call" and
generic copy functions.

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

14 years agoFixed library dependencies between the X86 disassembler and
Sean Callanan [Tue, 22 Dec 2009 01:11:26 +0000 (01:11 +0000)]
Fixed library dependencies between the X86 disassembler and
X86 codegen that were causing circular symbol dependencies.

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

14 years agoavoid calling extractMallocCall when it's obvious we don't have
Chris Lattner [Tue, 22 Dec 2009 01:00:32 +0000 (01:00 +0000)]
avoid calling extractMallocCall when it's obvious we don't have
a call.  This speeds up memdep ~1.5%

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

14 years agocomment fix: weakvh -> tracking vh
Chris Lattner [Tue, 22 Dec 2009 00:51:57 +0000 (00:51 +0000)]
comment fix: weakvh -> tracking vh

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

14 years agoAdd ordering of SDNodes to LowerCallTo.
Bill Wendling [Tue, 22 Dec 2009 00:50:32 +0000 (00:50 +0000)]
Add ordering of SDNodes to LowerCallTo.

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

14 years agoprint pcrel immediates as signed values instead of unsigned so that we
Chris Lattner [Tue, 22 Dec 2009 00:44:05 +0000 (00:44 +0000)]
print pcrel immediates as signed values instead of unsigned so that we
get things like this out of the disassembler:

0x100000ecb: callq -96

instead of:

0x100000ecb: callq 4294967200

rdar://7491123

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

14 years agoNow add ordering to SDNodes created by the massive intrinsic lowering function.
Bill Wendling [Tue, 22 Dec 2009 00:40:51 +0000 (00:40 +0000)]
Now add ordering to SDNodes created by the massive intrinsic lowering function.

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

14 years agoTo make things interesting, I added MORE code to set the ordering of
Bill Wendling [Tue, 22 Dec 2009 00:12:37 +0000 (00:12 +0000)]
To make things interesting, I added MORE code to set the ordering of
SDNodes. This time in the load/store and limited-precision code.

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

14 years agoChanged slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
Lang Hames [Tue, 22 Dec 2009 00:11:50 +0000 (00:11 +0000)]
Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals.

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

14 years agoAdd more plumbing to assign ordering to SDNodes. Have the "getValue" method
Bill Wendling [Mon, 21 Dec 2009 23:47:40 +0000 (23:47 +0000)]
Add more plumbing to assign ordering to SDNodes. Have the "getValue" method
assign the ordering when called. Combine some of the ordering assignments to
keep things simple.

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

14 years agoAdd suggested parentheses.
Daniel Dunbar [Mon, 21 Dec 2009 23:27:57 +0000 (23:27 +0000)]
Add suggested parentheses.

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

14 years agoAdd a fastpath to Load GVN to special case when we have exactly one dominating
Chris Lattner [Mon, 21 Dec 2009 23:15:48 +0000 (23:15 +0000)]
Add a fastpath to Load GVN to special case when we have exactly one dominating
load to avoid even messing around with SSAUpdate at all.  In this case (which
is very common, we can just use the input value directly).

This speeds up GVN time on gcc.c-torture/20001226-1.c from 36.4s to 16.3s,
which still isn't great, but substantially better and this is a simple speedup
that applies to lots of different cases.

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

14 years agoMore ordering plumbing. This time for GEP. I need to remember to assign
Bill Wendling [Mon, 21 Dec 2009 23:10:19 +0000 (23:10 +0000)]
More ordering plumbing. This time for GEP. I need to remember to assign
orderings to values returned by getValue().

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

14 years agorefactor some code out to a new helper method.
Chris Lattner [Mon, 21 Dec 2009 23:04:33 +0000 (23:04 +0000)]
refactor some code out to a new helper method.

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

14 years agoimprove indentation avoid a pointless conversion from weakvh to trackingvh,
Chris Lattner [Mon, 21 Dec 2009 22:43:03 +0000 (22:43 +0000)]
improve indentation avoid a pointless conversion from weakvh to trackingvh,
no functionality change.

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

14 years agoAnother incremental check-in for assigning ordering to SDNodes. This time for
Bill Wendling [Mon, 21 Dec 2009 22:42:14 +0000 (22:42 +0000)]
Another incremental check-in for assigning ordering to SDNodes. This time for
shuffle and insert vector.

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

14 years agoAssign ordering to more instructions. Incremental check-in.
Bill Wendling [Mon, 21 Dec 2009 22:30:11 +0000 (22:30 +0000)]
Assign ordering to more instructions. Incremental check-in.

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

14 years ago- Add a bit more plumbing assigning an order to SDNodes.
Bill Wendling [Mon, 21 Dec 2009 21:59:52 +0000 (21:59 +0000)]
- Add a bit more plumbing assigning an order to SDNodes.
- Modify the "dump" method to emit the order of an SDNode.

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

14 years agoFix a bug in !subst where TableGen would go and resubstitute text it had
David Greene [Mon, 21 Dec 2009 21:21:34 +0000 (21:21 +0000)]
Fix a bug in !subst where TableGen would go and resubstitute text it had
just substituted.  This could cause infinite looping in certain
pathological cases.

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

14 years agoRemove uber-gross hack. The define _snprintf to snprintf is invalid due to two reason...
Anton Korobeynikov [Mon, 21 Dec 2009 20:19:37 +0000 (20:19 +0000)]
Remove uber-gross hack. The define _snprintf to snprintf is invalid due to two reasons: 1. Accroding to C++ standard snprintf should be available in std namespace (and __gnu_cxx in case of GCC to). Such ifdef will change all snprintf's to _snprintf's, but won't bring snprintf to all necessary namespaces. Thus e.g. any locale-using code on mingw will yield an error (include this file + string to see the result) 2. MSVCRT's _snprintf does not comply with C99 standard. Standard one is snprintf.

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

14 years agoMark FPW as allocable when frame address is taken.
Anton Korobeynikov [Mon, 21 Dec 2009 20:18:49 +0000 (20:18 +0000)]
Mark FPW as allocable when frame address is taken.

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

14 years agoFirst wave of plumbing for assigning an ordering to SDNodes. This takes care of
Bill Wendling [Mon, 21 Dec 2009 19:59:38 +0000 (19:59 +0000)]
First wave of plumbing for assigning an ordering to SDNodes. This takes care of
a lot of the branching instructions.

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

14 years agoDelete the instruction just before the function terminates for consistency sake.
Evan Cheng [Mon, 21 Dec 2009 19:53:39 +0000 (19:53 +0000)]
Delete the instruction just before the function terminates for consistency sake.

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

14 years agoPlace SDNodeOrdering.h in the directory it's used.
Bill Wendling [Mon, 21 Dec 2009 19:34:59 +0000 (19:34 +0000)]
Place SDNodeOrdering.h in the directory it's used.

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

14 years agoRemove special-case SROA optimization of variable indexes to one-element and
Bob Wilson [Mon, 21 Dec 2009 18:39:47 +0000 (18:39 +0000)]
Remove special-case SROA optimization of variable indexes to one-element and
two-element arrays.  After restructuring the SROA code, it was not safe to
do this without adding more checking.  It is not clear that this special-case
has really been useful, and removing this simplifies the code quite a bit.

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

14 years agoXFAIL these tests on powerpc, under the assumption that no one cares. If you care...
Daniel Dunbar [Mon, 21 Dec 2009 17:31:59 +0000 (17:31 +0000)]
XFAIL these tests on powerpc, under the assumption that no one cares. If you care, feel free to fix.

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

14 years agoFix setting and default setting of code model for jit. Do this
Eric Christopher [Mon, 21 Dec 2009 08:15:29 +0000 (08:15 +0000)]
Fix setting and default setting of code model for jit. Do this
by allowing backends to override routines that will default
the JIT and Static code generation to an appropriate code model
for the architecture.

Should fix PR 5773.

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

14 years agoA couple minor README updates.
Eli Friedman [Mon, 21 Dec 2009 08:03:16 +0000 (08:03 +0000)]
A couple minor README updates.

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

14 years agoimprove compatibility with SWIG, patch by James Knight!
Chris Lattner [Mon, 21 Dec 2009 07:52:40 +0000 (07:52 +0000)]
improve compatibility with SWIG, patch by James Knight!

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

14 years agorevert r89298, which was committed without a testcase. I think
Chris Lattner [Mon, 21 Dec 2009 07:45:57 +0000 (07:45 +0000)]
revert r89298, which was committed without a testcase.  I think
the underlying PHI node insertion issue in SSAUpdate is fixed.

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

14 years agofix PR5837 by having SSAUpdate reuse phi nodes for the
Chris Lattner [Mon, 21 Dec 2009 07:16:11 +0000 (07:16 +0000)]
fix PR5837 by having SSAUpdate reuse phi nodes for the
'GetValueInMiddleOfBlock' case, instead of inserting
duplicates.

A similar fix is almost certainly needed by the machine-level
SSAUpdate implementation.

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

14 years agoadd a helper ctor.
Chris Lattner [Mon, 21 Dec 2009 07:15:15 +0000 (07:15 +0000)]
add a helper ctor.

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

14 years agoChange StringRef::startswith and StringRef::endswith to versions which are a
Eli Friedman [Mon, 21 Dec 2009 06:49:24 +0000 (06:49 +0000)]
Change StringRef::startswith and StringRef::endswith to versions which are a
bit more verbose, but optimize to much shorter code.

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

14 years agoadd check lines for min/max tests.
Chris Lattner [Mon, 21 Dec 2009 06:08:50 +0000 (06:08 +0000)]
add check lines for min/max tests.

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

14 years agoreally convert this to filecheck.
Chris Lattner [Mon, 21 Dec 2009 06:06:10 +0000 (06:06 +0000)]
really convert this to filecheck.

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

14 years agogive instcombine some helper functions for matching MIN and MAX, and
Chris Lattner [Mon, 21 Dec 2009 06:03:05 +0000 (06:03 +0000)]
give instcombine some helper functions for matching MIN and MAX, and
implement some optimizations for MIN(MIN()) and MAX(MAX()) and
MIN(MAX()) etc.  This substantially improves the code in PR5822 but
doesn't kick in much elsewhere.  2 max's were optimized in
pairlocalalign and one in smg2000.

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

14 years agofilecheckize
Chris Lattner [Mon, 21 Dec 2009 05:53:13 +0000 (05:53 +0000)]
filecheckize

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

14 years agoenhance x-(-A) -> x+A to preserve NUW/NSW.
Chris Lattner [Mon, 21 Dec 2009 04:04:05 +0000 (04:04 +0000)]
enhance x-(-A) -> x+A to preserve NUW/NSW.

Use the presence of NSW/NUW to fold "icmp (x+cst), x" to a constant in
cases where it would otherwise be undefined behavior.

Surprisingly (to me at least), this triggers hundreds of the times in
a few benchmarks: lencode, ldecode, and 466.h264ref seem to *really*
like this.

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

14 years agoOptimize all cases of "icmp (X+Cst), X" to something simpler. This triggers
Chris Lattner [Mon, 21 Dec 2009 03:19:28 +0000 (03:19 +0000)]
Optimize all cases of "icmp (X+Cst), X" to something simpler.  This triggers
a bunch in lencode, ldecod, spass, 176.gcc, 252.eon, among others.  It is
also the first part of PR5822

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

14 years agoconvert to filecheck
Chris Lattner [Mon, 21 Dec 2009 03:11:05 +0000 (03:11 +0000)]
convert to filecheck

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

14 years agoFixed use of phi param in SlotIndex constructors.
Lang Hames [Sat, 19 Dec 2009 23:32:32 +0000 (23:32 +0000)]
Fixed use of phi param in SlotIndex constructors.

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

14 years agofix an overly conservative caching issue that caused memdep to
Chris Lattner [Sat, 19 Dec 2009 21:29:22 +0000 (21:29 +0000)]
fix an overly conservative caching issue that caused memdep to
cache a pointer as being unavailable due to phi trans in the
wrong place.  This would cause later queries to fail even when
they didn't involve phi trans.

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

14 years agoCMake: Update lib deps.
Daniel Dunbar [Sat, 19 Dec 2009 21:27:30 +0000 (21:27 +0000)]
CMake: Update lib deps.

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

14 years ago.llx is no more.
Chris Lattner [Sat, 19 Dec 2009 20:56:53 +0000 (20:56 +0000)]
.llx is no more.

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

14 years agofix inconsistent use of tabs
Chris Lattner [Sat, 19 Dec 2009 20:44:43 +0000 (20:44 +0000)]
fix inconsistent use of tabs

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

14 years agoRemove unused variable (noticed by clang++).
Daniel Dunbar [Sat, 19 Dec 2009 18:58:49 +0000 (18:58 +0000)]
Remove unused variable (noticed by clang++).

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

14 years ago#if 0 out X86 disassembler for now, it is breaking the build in multiple places.
Daniel Dunbar [Sat, 19 Dec 2009 17:11:53 +0000 (17:11 +0000)]
#if 0 out X86 disassembler for now, it is breaking the build in multiple places.

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

14 years agoEmit direction operand in binary insns that stores in memory.
Sanjiv Gupta [Sat, 19 Dec 2009 13:52:01 +0000 (13:52 +0000)]
Emit direction operand in binary insns that stores in memory.

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

14 years agoAdding a bunch of options to the mcc16 driver.
Sanjiv Gupta [Sat, 19 Dec 2009 13:13:29 +0000 (13:13 +0000)]
Adding a bunch of options to the mcc16 driver.

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

14 years agorename dprintf to dbgpritnf, in order to fix build with glibc (which already defines...
Nuno Lopes [Sat, 19 Dec 2009 12:07:00 +0000 (12:07 +0000)]
rename dprintf to dbgpritnf, in order to fix build with glibc (which already defines dprintf in stdio.h

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

14 years agofix build and while at it remove a redudant include
Nuno Lopes [Sat, 19 Dec 2009 11:52:18 +0000 (11:52 +0000)]
fix build and while at it remove a redudant include

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

14 years agoTest cases for changes done in 91768.
Sanjiv Gupta [Sat, 19 Dec 2009 11:38:14 +0000 (11:38 +0000)]
Test cases for changes done in 91768.

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

14 years ago1. In indirect load/store insns , the name of fsr should be emitted as INDF.
Sanjiv Gupta [Sat, 19 Dec 2009 08:26:25 +0000 (08:26 +0000)]
1. In indirect load/store insns , the name of fsr should be emitted as INDF.
2. include standard asmbly headers in generated asmbly.

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

14 years agoFix a bunch of little errors that Clang complains about when its being pedantic
Douglas Gregor [Sat, 19 Dec 2009 07:05:23 +0000 (07:05 +0000)]
Fix a bunch of little errors that Clang complains about when its being pedantic

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

14 years agofix PR5827 by disabling the phi slicing transformation in a case
Chris Lattner [Sat, 19 Dec 2009 07:01:15 +0000 (07:01 +0000)]
fix PR5827 by disabling the phi slicing transformation in a case
where instcombine would have to split a critical edge due to a
phi node of an invoke.  Since instcombine can't change the CFG,
it has to bail out from doing the transformation.

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

14 years agoUpdate my SROA changes in response to review.
Bob Wilson [Sat, 19 Dec 2009 06:53:17 +0000 (06:53 +0000)]
Update my SROA changes in response to review.
* change FindElementAndOffset to return a uint64_t instead of unsigned, and
  to identify the type to be used for that result in a GEP instruction.
* move "isa<ConstantInt>" to be first in conditional.
* replace some dyn_casts with casts.
* add a comment about handling mem intrinsics.

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

14 years agoMore bzero -> memset that I missed.
Daniel Dunbar [Sat, 19 Dec 2009 04:16:57 +0000 (04:16 +0000)]
More bzero -> memset that I missed.

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

14 years agoAdd missing newlines at EOF (for clang++).
Daniel Dunbar [Sat, 19 Dec 2009 04:16:48 +0000 (04:16 +0000)]
Add missing newlines at EOF (for clang++).

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

14 years agoUse memset instead of bzero, its more portable.
Daniel Dunbar [Sat, 19 Dec 2009 03:31:50 +0000 (03:31 +0000)]
Use memset instead of bzero, its more portable.

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

14 years agoRemove spurious semicolon. Thanks, Clang
Douglas Gregor [Sat, 19 Dec 2009 03:21:36 +0000 (03:21 +0000)]
Remove spurious semicolon. Thanks, Clang

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

14 years agoTable-driven disassembler for the X86 architecture (16-, 32-, and 64-bit
Sean Callanan [Sat, 19 Dec 2009 02:59:52 +0000 (02:59 +0000)]
Table-driven disassembler for the X86 architecture (16-, 32-, and 64-bit
incarnations), integrated into the MC framework.

The disassembler is table-driven, using a custom TableGen backend to
generate hierarchical tables optimized for fast decode.  The disassembler
consumes MemoryObjects and produces arrays of MCInsts, adhering to the
abstract base class MCDisassembler (llvm/MC/MCDisassembler.h).

The disassembler is documented in detail in

- lib/Target/X86/Disassembler/X86Disassembler.cpp (disassembler runtime)
- utils/TableGen/DisassemblerEmitter.cpp (table emitter)

You can test the disassembler by running llvm-mc -disassemble for i386
or x86_64 targets.  Please let me know if you encounter any problems
with it.

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

14 years agoBump alignment requirements for windows targets to achieve compartibility with vcpp.
Anton Korobeynikov [Sat, 19 Dec 2009 02:04:23 +0000 (02:04 +0000)]
Bump alignment requirements for windows targets to achieve compartibility with vcpp.
Based on patch by Michael Beck!

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

14 years agoUse 4-arg getVTList) variant instead of generic one, when possible
Anton Korobeynikov [Sat, 19 Dec 2009 02:04:00 +0000 (02:04 +0000)]
Use 4-arg getVTList) variant instead of generic one, when possible

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

14 years agoDelete unused code.
Dan Gohman [Sat, 19 Dec 2009 01:47:13 +0000 (01:47 +0000)]
Delete unused code.

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

14 years agoFix a spello in a comment that Nick spotted.
Dan Gohman [Sat, 19 Dec 2009 01:46:34 +0000 (01:46 +0000)]
Fix a spello in a comment that Nick spotted.

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

14 years agoFix a comment.
Dan Gohman [Sat, 19 Dec 2009 01:46:09 +0000 (01:46 +0000)]
Fix a comment.

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

14 years agoMake some methods const. The only interesting change here is that
Chris Lattner [Sat, 19 Dec 2009 01:38:42 +0000 (01:38 +0000)]
Make some methods const.  The only interesting change here is that
it changes raw_fd_ostream::preferred_buffer_size to return zero on
a scary stat failure instead of setting the stream to an error state.
This method really should not mutate the stream.

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

14 years agoQualify a bunch of explicit template instantiations to satisfy clang++.
John McCall [Sat, 19 Dec 2009 00:55:12 +0000 (00:55 +0000)]
Qualify a bunch of explicit template instantiations to satisfy clang++.

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

14 years agoPut TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
John McCall [Sat, 19 Dec 2009 00:51:42 +0000 (00:51 +0000)]
Put TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
the templates in TypesContext.h can find them.  Caught by clang++.

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

14 years agoForgot forward declaration.
Bill Wendling [Sat, 19 Dec 2009 00:05:07 +0000 (00:05 +0000)]
Forgot forward declaration.

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

14 years agoEliminate unnecessary LLVMContexts.
Dan Gohman [Fri, 18 Dec 2009 23:42:08 +0000 (23:42 +0000)]
Eliminate unnecessary LLVMContexts.

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

14 years agoChanges from review:
Bill Wendling [Fri, 18 Dec 2009 23:32:53 +0000 (23:32 +0000)]
Changes from review:

- Move DisableScheduling flag into TargetOption.h
- Move SDNodeOrdering into its own header file. Give it a minimal interface that
  doesn't conflate construction with storage.
- Move assigning the ordering into the SelectionDAGBuilder.

This isn't used yet, so there should be no functional changes.

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

14 years agoMake this comment more precise.
Dan Gohman [Fri, 18 Dec 2009 23:18:03 +0000 (23:18 +0000)]
Make this comment more precise.

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

14 years agoFix an issue in googletest where a name was used before it was defined.
Eli Friedman [Fri, 18 Dec 2009 21:38:44 +0000 (21:38 +0000)]
Fix an issue in googletest where a name was used before it was defined.

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

14 years agoIncrease opportunities to optimize (brcond (srl (and c1), c2)).
Evan Cheng [Fri, 18 Dec 2009 21:31:31 +0000 (21:31 +0000)]
Increase opportunities to optimize (brcond (srl (and c1), c2)).

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

14 years agoFix gcc warning.
Eli Friedman [Fri, 18 Dec 2009 21:07:18 +0000 (21:07 +0000)]
Fix gcc warning.

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

14 years agoCatch more cases of a pointer being marked garbage twice. This helps when
Rafael Espindola [Fri, 18 Dec 2009 20:35:38 +0000 (20:35 +0000)]
Catch more cases of a pointer being marked garbage twice. This helps when
debugging some leaks (PR5770 in particular).

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

14 years agoReapply 91459 with a simple fix for the problem that broke the x86_64-darwin
Bob Wilson [Fri, 18 Dec 2009 20:14:40 +0000 (20:14 +0000)]
Reapply 91459 with a simple fix for the problem that broke the x86_64-darwin
bootstrap.  This also replaces the WeakVH references that Chris objected to
with normal Value references.

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

14 years agoFix another parallel make race condition.
Bob Wilson [Fri, 18 Dec 2009 20:12:14 +0000 (20:12 +0000)]
Fix another parallel make race condition.

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

14 years agoFormalize MDNode's function-localness:
Victor Hernandez [Fri, 18 Dec 2009 20:09:14 +0000 (20:09 +0000)]
Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().

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

14 years agoFix Win32 Path.inc for API update.
Daniel Dunbar [Fri, 18 Dec 2009 19:59:48 +0000 (19:59 +0000)]
Fix Win32 Path.inc for API update.

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

14 years agoRevert this use of NUW/NSW also. Overflow-undefined multiplication isn't
Dan Gohman [Fri, 18 Dec 2009 18:45:31 +0000 (18:45 +0000)]
Revert this use of NUW/NSW also. Overflow-undefined multiplication isn't
associative either.

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

14 years agoFix libstdc++ build on ARM linux and part of PR5770.
Rafael Espindola [Fri, 18 Dec 2009 16:59:39 +0000 (16:59 +0000)]
Fix libstdc++ build on ARM linux and part of PR5770.

MI was not being used but it was also not being deleted, so it was kept in the garbage list. The memory itself was freed once the function code gen was done.

Once in a while the codegen of another function would create an instruction on the same address. Adding it to the garbage group would work once, but when another pointer was added it would cause an assert as "Cache" was about to be pushed to Ts.

For a patch that make us detect problems like this earlier, take a look at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092758.html

With that patch we assert as soon and the new instruction is added to the garbage set.

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

14 years agoFix wrong frame pointer save offset in the 64-bit PowerPC SVR4 ABI.
Tilmann Scheller [Fri, 18 Dec 2009 13:00:34 +0000 (13:00 +0000)]
Fix wrong frame pointer save offset in the 64-bit PowerPC SVR4 ABI.

Patch contributed by Ken Werner of IBM!

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

14 years agoAdd support for calls through function pointers in the 64-bit PowerPC SVR4 ABI.
Tilmann Scheller [Fri, 18 Dec 2009 13:00:15 +0000 (13:00 +0000)]
Add support for calls through function pointers in the 64-bit PowerPC SVR4 ABI.

Patch contributed by Ken Werner of IBM!

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

14 years agoMake 'set_option' work with list options.
Mikhail Glushenkov [Fri, 18 Dec 2009 11:27:26 +0000 (11:27 +0000)]
Make 'set_option' work with list options.

This works now: (set_option "list_opt", ["val_1", "val_2", "val_3"])

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

14 years agoOptimize icmp of null and select of two constants even if the select has
Eli Friedman [Fri, 18 Dec 2009 08:22:35 +0000 (08:22 +0000)]
Optimize icmp of null and select of two constants even if the select has
multiple uses.  (The construct in question was found in gcc.)

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

14 years agoOn recent Intel u-arch's, folding loads into some unary SSE instructions can
Evan Cheng [Fri, 18 Dec 2009 07:40:29 +0000 (07:40 +0000)]
On recent Intel u-arch's, folding loads into some unary SSE instructions can
be non-optimal. To be precise, we should avoid folding loads if the instructions
only update part of the destination register, and the non-updated part is not
needed. e.g. cvtss2sd, sqrtss. Unfolding the load from these instructions breaks
the partial register dependency and it can improve performance. e.g.

movss (%rdi), %xmm0
cvtss2sd %xmm0, %xmm0

instead of
cvtss2sd (%rdi), %xmm0

An alternative method to break dependency is to clear the register first. e.g.
xorps %xmm0, %xmm0
cvtss2sd (%rdi), %xmm0

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

14 years agoRevert this use of NSW; this one isn't actually safe. NSW addition
Dan Gohman [Fri, 18 Dec 2009 03:57:04 +0000 (03:57 +0000)]
Revert this use of NSW; this one isn't actually safe. NSW addition
is not reassociative.

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

14 years agoEliminte unnecessary uses of <cstdio>.
Dan Gohman [Fri, 18 Dec 2009 03:25:51 +0000 (03:25 +0000)]
Eliminte unnecessary uses of <cstdio>.

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

14 years agoAdd utility routines for NSW multiply.
Dan Gohman [Fri, 18 Dec 2009 03:10:26 +0000 (03:10 +0000)]
Add utility routines for NSW multiply.

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

14 years agoAdd utility routines for creating integer negation operators with NSW set.
Dan Gohman [Fri, 18 Dec 2009 02:58:50 +0000 (02:58 +0000)]
Add utility routines for creating integer negation operators with NSW set.
Integer negation only overflows with INT_MIN, but that's an important case.

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

14 years agoDelete an unused variable.
Dan Gohman [Fri, 18 Dec 2009 02:14:37 +0000 (02:14 +0000)]
Delete an unused variable.

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

14 years agoFix typo.
Eric Christopher [Fri, 18 Dec 2009 02:12:53 +0000 (02:12 +0000)]
Fix typo.

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