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

14 years agonot committing what you test = bad.
Chris Lattner [Thu, 4 Mar 2010 19:54:45 +0000 (19:54 +0000)]
not committing what you test = bad.

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

14 years agomake gep matching in fastisel match the base of the gep as a
Chris Lattner [Thu, 4 Mar 2010 19:48:19 +0000 (19:48 +0000)]
make gep matching in fastisel match the base of the gep as a
register if it isn't possible to match the indexes *and* the base.
This fixes some fast isel rejects of load instructions on oggenc.

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

14 years agoadd a statistic for # times fastisel fails.
Chris Lattner [Thu, 4 Mar 2010 19:46:56 +0000 (19:46 +0000)]
add a statistic for # times fastisel fails.

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

14 years agoFix PR6360. It's easy for a stub's address to escape to user code, so we can't
Jeffrey Yasskin [Thu, 4 Mar 2010 19:45:09 +0000 (19:45 +0000)]
Fix PR6360.  It's easy for a stub's address to escape to user code, so we can't
just count references to it from JIT output to decide when to destroy it.  This
patch waits to destroy the JIT's memory of a stub until the Function it refers
to is destroyed.  External function stubs and GVIndirectSyms aren't destroyed
until the JIT itself is.

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

14 years agoFix a typo Duncan noticed.
Dan Gohman [Thu, 4 Mar 2010 19:11:28 +0000 (19:11 +0000)]
Fix a typo Duncan noticed.

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

14 years agoAdded 32-bit Thumb instructions for Preload Data (PLD, PLDW) and Preload
Johnny Chen [Thu, 4 Mar 2010 17:40:44 +0000 (17:40 +0000)]
Added 32-bit Thumb instructions for Preload Data (PLD, PLDW) and Preload
Instruction (PLI) for disassembly only.

According to A8.6.120 PLI (immediate, literal), for example, different
instructions are generated for "pli [pc, #0]" and "pli [pc, #-0"].  The
disassembler solves it by mapping -0 (negative zero) to -1, -1 to -2, ..., etc.

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

14 years agoSimplify the condition-checking logic and hopefully clear up a build failure
John McCall [Thu, 4 Mar 2010 11:48:42 +0000 (11:48 +0000)]
Simplify the condition-checking logic and hopefully clear up a build failure
that somehow got through my testing.

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

14 years agoTeach lit to honor conditional directives. The syntax is:
John McCall [Thu, 4 Mar 2010 09:36:50 +0000 (09:36 +0000)]
Teach lit to honor conditional directives.  The syntax is:
  IF(condition(value)):
If the value satisfies the condition, the line is processed by lit;  otherwise
it is skipped.  A test with no unignored directives is resolved as Unsupported.

The test suite is responsible for defining conditions;  conditions are unary
functions over strings.  I've defined two conditions in the LLVM test suite,
TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values
like those in llvm_bindings).  So for example you can write:
  IF(BINDING(ocaml)): RUN: %blah %s -o -
and the RUN line will only execute if LLVM was configured with the ocaml
bindings.

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

14 years agoMake the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))'
Nick Lewycky [Thu, 4 Mar 2010 06:54:10 +0000 (06:54 +0000)]
Make the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))'
transformation much more careful. Truncating binary '01' to '1' sounds like it's
safe until you realize that it switched from positive to negative under a signed
interpretation, and that depends on the icmp predicate.

Also a few miscellaneous cleanups.

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

14 years agoFix PR5291, in which a SmallPtrSet iterator was held across an insertion into
Jeffrey Yasskin [Thu, 4 Mar 2010 06:50:01 +0000 (06:50 +0000)]
Fix PR5291, in which a SmallPtrSet iterator was held across an insertion into
the set.

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

14 years agoRename -machine-cse to -enable-machine-cse.
Evan Cheng [Thu, 4 Mar 2010 02:08:04 +0000 (02:08 +0000)]
Rename -machine-cse to -enable-machine-cse.

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

14 years agoadd a comment.
Chris Lattner [Thu, 4 Mar 2010 01:43:43 +0000 (01:43 +0000)]
add a comment.

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

14 years agoso hey, it turns out that the histogram was completely wrong, because
Chris Lattner [Thu, 4 Mar 2010 01:34:29 +0000 (01:34 +0000)]
so hey, it turns out that the histogram was completely wrong, because
we sometimes emit nodes multiple times to string buffers to size them.
Compute the histogram correctly.

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

14 years agoLook ahead a bit to determine if a physical register def that is not marked dead...
Evan Cheng [Thu, 4 Mar 2010 01:33:55 +0000 (01:33 +0000)]
Look ahead a bit to determine if a physical register def that is not marked dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86.

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

14 years agozap fixme.
Chris Lattner [Thu, 4 Mar 2010 01:26:00 +0000 (01:26 +0000)]
zap fixme.

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

14 years agonow that complexpatterns are all emitted at the end of the match
Chris Lattner [Thu, 4 Mar 2010 01:25:36 +0000 (01:25 +0000)]
now that  complexpatterns are all emitted at the end of the match
sequence, just emit instruction predicates right before them.  This
exposes yet more factoring opportunitites, shrinking the X86 table
to 79144 bytes.

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

14 years agochange the new isel matcher to emit ComplexPattern matches
Chris Lattner [Thu, 4 Mar 2010 01:23:08 +0000 (01:23 +0000)]
change the new isel matcher to emit ComplexPattern matches
as the very last thing before node emission.  This should
dramatically reduce the number of times we do 'MatchAddress'
on X86, speeding up compile time.  This also improves comments
in the tables and shrinks the table a bit, now down to
80506 bytes for x86.

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

14 years agoMake sure JITResolvers don't leave any stubs behind. When a JITResolver was
Jeffrey Yasskin [Thu, 4 Mar 2010 00:32:33 +0000 (00:32 +0000)]
Make sure JITResolvers don't leave any stubs behind.  When a JITResolver was
destroyed, it could leave stubs in the StubToResolverMap, which would confuse
the lookup for subsequent lazy compilations.

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

14 years agoenhance comment output to specify what recorded slot
Chris Lattner [Thu, 4 Mar 2010 00:28:05 +0000 (00:28 +0000)]
enhance comment output to specify what recorded slot
numbers a ComplexPat will match into.

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

14 years agoFix more code to work properly with vector operands. Based on
Dan Gohman [Thu, 4 Mar 2010 00:23:16 +0000 (00:23 +0000)]
Fix more code to work properly with vector operands. Based on
a patch my Micah Villmow for PR6465.

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

14 years agoTeach the pic16 target to recognize pic16-*-* triples.
John McCall [Thu, 4 Mar 2010 00:21:47 +0000 (00:21 +0000)]
Teach the pic16 target to recognize pic16-*-* triples.

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

14 years agoinline CannotYetSelectIntrinsic into CannotYetSelect and simplify.
Chris Lattner [Thu, 4 Mar 2010 00:21:16 +0000 (00:21 +0000)]
inline CannotYetSelectIntrinsic into CannotYetSelect and simplify.

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

14 years agoFix a logic error. An instruction that has a live physical register def cannot be...
Evan Cheng [Wed, 3 Mar 2010 23:59:08 +0000 (23:59 +0000)]
Fix a logic error. An instruction that has a live physical register def cannot be CSE'ed, but it *can* be used to replace a common subexpression.

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

14 years agoRemove PHINodeTraits and use MachineInstrExpressionTrait instead.
Evan Cheng [Wed, 3 Mar 2010 23:55:49 +0000 (23:55 +0000)]
Remove PHINodeTraits and use MachineInstrExpressionTrait instead.

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

14 years agoExpose the rest of the llvm-c scalar opts to ocaml.
Erick Tryzelaar [Wed, 3 Mar 2010 23:51:34 +0000 (23:51 +0000)]
Expose the rest of the llvm-c scalar opts to ocaml.

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

14 years agoRename some ocaml functions.
Erick Tryzelaar [Wed, 3 Mar 2010 23:51:30 +0000 (23:51 +0000)]
Rename some ocaml functions.

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

14 years agoExpose the external functions for ocaml's execution engine as an optimization.
Erick Tryzelaar [Wed, 3 Mar 2010 23:51:28 +0000 (23:51 +0000)]
Expose the external functions for ocaml's execution engine as an optimization.

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

14 years agoExpose alignment and stack alignment attributes to llvm-c and ocaml.
Erick Tryzelaar [Wed, 3 Mar 2010 23:51:25 +0000 (23:51 +0000)]
Expose alignment and stack alignment attributes to llvm-c and ocaml.

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

14 years agoMove MachineInstrExpressionTrait::getHashValue() out of line so it can skip over...
Evan Cheng [Wed, 3 Mar 2010 23:37:30 +0000 (23:37 +0000)]
Move MachineInstrExpressionTrait::getHashValue() out of line so it can skip over only virtual register defs. This matches what isEqual() is doing.

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

14 years agoRe-apply r97667 but with a little bit of thought put into the patch. This implements...
Evan Cheng [Wed, 3 Mar 2010 23:27:36 +0000 (23:27 +0000)]
Re-apply r97667 but with a little bit of thought put into the patch. This implements a special DenseMapInfo trait for DenseMap<MachineInstr*> that compare the value of the MachineInstr rather than the pointer value. Since the hashing and equality test functions ignore defs it's useful for doing CSE kind optimization.

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

14 years agoModified the asm string of 16-bit Thumb MUL instruction so that it prints:
Johnny Chen [Wed, 3 Mar 2010 23:15:43 +0000 (23:15 +0000)]
Modified the asm string of 16-bit Thumb MUL instruction so that it prints:

MULS <Rdm>, <Rn>, <Rdm>

according to A8.6.105 MUL Encoding T1.

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

14 years agoRevert 97667. It broke a bunch of tests.
Dan Gohman [Wed, 3 Mar 2010 22:40:03 +0000 (22:40 +0000)]
Revert 97667. It broke a bunch of tests.

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

14 years agoFix funky indentation and add comments.
Evan Cheng [Wed, 3 Mar 2010 21:54:14 +0000 (21:54 +0000)]
Fix funky indentation and add comments.

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

14 years agoMove DenseMapInfo for MachineInstr* to MachineInstr.h
Evan Cheng [Wed, 3 Mar 2010 21:47:16 +0000 (21:47 +0000)]
Move DenseMapInfo for MachineInstr* to MachineInstr.h

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

14 years agoFix a bug in SelectionDAG's ReplaceAllUsesWith in the case where
Dan Gohman [Wed, 3 Mar 2010 21:33:37 +0000 (21:33 +0000)]
Fix a bug in SelectionDAG's ReplaceAllUsesWith in the case where
CSE and recursive RAUW calls delete a node from the use list,
invalidating the use list iterator. There's currently no known
way to reproduce this in an unmodified LLVM, however there's no
fundamental reason why a SelectionDAG couldn't be formed which
would trigger this case.

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

14 years agoMachine CSE work in progress. It's doing some CSE now. But implicit def of physical...
Evan Cheng [Wed, 3 Mar 2010 21:20:05 +0000 (21:20 +0000)]
Machine CSE work in progress. It's doing some CSE now. But implicit def of physical registers are getting in the way.

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

14 years agoAdd MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.
Evan Cheng [Wed, 3 Mar 2010 21:18:38 +0000 (21:18 +0000)]
Add MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.

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

14 years agodon't use always_inline with gcc 3.4, it has some unimplemented features
Chris Lattner [Wed, 3 Mar 2010 20:47:12 +0000 (20:47 +0000)]
don't use always_inline with gcc 3.4, it has some unimplemented features
and is too old to really care about the performance of the generated
compiler.

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

14 years agoTopLevelMap[] reference is a pointer.
Evan Cheng [Wed, 3 Mar 2010 20:46:48 +0000 (20:46 +0000)]
TopLevelMap[] reference is a pointer.

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

14 years agoFix PR6444, note still doesn't compile libgcc2 all the way, but fixes that error...
Andrew Lenharth [Wed, 3 Mar 2010 20:15:31 +0000 (20:15 +0000)]
Fix PR6444, note still doesn't compile libgcc2 all the way, but fixes that error.  May not fix it in an ABI complient way.  It wasn't clear what gcc does

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

14 years agofix incorrect folding of icmp with undef, PR6481.
Chris Lattner [Wed, 3 Mar 2010 19:46:03 +0000 (19:46 +0000)]
fix incorrect folding of icmp with undef, PR6481.

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

14 years agoRevert...
Bill Wendling [Wed, 3 Mar 2010 19:31:05 +0000 (19:31 +0000)]
Revert...
--- Reverse-merging r97592 into '.':
U    lib/CodeGen/TargetLoweringObjectFileImpl.cpp

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

14 years agoAdded 32-bit Thumb instructions LDRT, LDRBT, LDRHT,,LDRSBT, LDRSHT, STRT, STRBT,
Johnny Chen [Wed, 3 Mar 2010 18:45:36 +0000 (18:45 +0000)]
Added 32-bit Thumb instructions LDRT, LDRBT, LDRHT,,LDRSBT, LDRSHT, STRT, STRBT,
and STRHT for disassembly only.

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

14 years agoadd some of the more obscure predicate types to the
Chris Lattner [Wed, 3 Mar 2010 07:46:25 +0000 (07:46 +0000)]
add some of the more obscure predicate types to the
Scope accelerator.

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

14 years agospeed up scope node processing: if the first element of a scope
Chris Lattner [Wed, 3 Mar 2010 07:31:15 +0000 (07:31 +0000)]
speed up scope node processing: if the first element of a scope
entry we're about to process is obviously going to fail, don't
bother pushing a scope only to have it immediately be popped.
This avoids a lot of scope stack traffic in common cases.

Unfortunately, this requires duplicating some of the predicate
dispatch.  To avoid duplicating the actual logic I pulled each
predicate out to its own static function which gets used in
both places.

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

14 years agointroduce a new SwitchTypeMatcher node (which is analogous to
Chris Lattner [Wed, 3 Mar 2010 06:28:15 +0000 (06:28 +0000)]
introduce a new SwitchTypeMatcher node (which is analogous to
SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it.  This
speeds up selection, particularly for X86 which has lots of
variants of instructions with only type differences.

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

14 years agoFix comment.
Bill Wendling [Wed, 3 Mar 2010 05:40:40 +0000 (05:40 +0000)]
Fix comment.

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

14 years agoMake SCEVExpander and LSR more aggressive about hoisting expressions out
Dan Gohman [Wed, 3 Mar 2010 05:29:13 +0000 (05:29 +0000)]
Make SCEVExpander and LSR more aggressive about hoisting expressions out
of loops.

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

14 years agoRevert r97580; that's not the right way to fix this.
Dan Gohman [Wed, 3 Mar 2010 04:36:42 +0000 (04:36 +0000)]
Revert r97580; that's not the right way to fix this.

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

14 years agoWork in progress. Finding some cse now.
Evan Cheng [Wed, 3 Mar 2010 02:48:20 +0000 (02:48 +0000)]
Work in progress. Finding some cse now.

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

14 years agoremove nvload and two patterns that use it which are
Chris Lattner [Wed, 3 Mar 2010 02:14:54 +0000 (02:14 +0000)]
remove nvload and two patterns that use it which are
better done by dag combine.

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

14 years agoAdded 32-bit Thumb instructions t2NOP, t2YIELD, t2WFE, t2WFI, t2SEV, and t2DBG
Johnny Chen [Wed, 3 Mar 2010 02:09:43 +0000 (02:09 +0000)]
Added 32-bit Thumb instructions t2NOP, t2YIELD, t2WFE, t2WFI, t2SEV, and t2DBG
for disassembly only.

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

14 years agoUse APInt instead of zext value.
Bill Wendling [Wed, 3 Mar 2010 01:58:01 +0000 (01:58 +0000)]
Use APInt instead of zext value.

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

14 years agofactor the 'in the default address space' check out to a single
Chris Lattner [Wed, 3 Mar 2010 01:52:59 +0000 (01:52 +0000)]
factor the 'in the default address space' check out to a single
'dsload' pattern.  tblgen doesn't check patterns to see if they're
textually identical.  This allows better factoring.

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

14 years agofactor the 'sign extended from 8 bit' patterns better so
Chris Lattner [Wed, 3 Mar 2010 01:45:01 +0000 (01:45 +0000)]
factor the 'sign extended from 8 bit' patterns better so
that they are not destination type specific.  This allows
tblgen to factor them and the type check is redundant with
what the isel does anyway.

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

14 years ago- Change MachineInstr::isIdenticalTo to take a new option that determines whether...
Evan Cheng [Wed, 3 Mar 2010 01:44:33 +0000 (01:44 +0000)]
- Change MachineInstr::isIdenticalTo to take a new option that determines whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality.
- Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools).

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

14 years agoAdd an option to enable machine cse (it's not doing anything yet.
Evan Cheng [Wed, 3 Mar 2010 01:38:35 +0000 (01:38 +0000)]
Add an option to enable machine cse (it's not doing anything yet.

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

14 years agoOrdering forward declarations.
Evan Cheng [Wed, 3 Mar 2010 01:37:50 +0000 (01:37 +0000)]
Ordering forward declarations.

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

14 years agoDon't turn assertions on by default.
Bill Wendling [Wed, 3 Mar 2010 01:13:55 +0000 (01:13 +0000)]
Don't turn assertions on by default.

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

14 years agoEliminate unused instruction classes.
Evan Cheng [Wed, 3 Mar 2010 00:43:15 +0000 (00:43 +0000)]
Eliminate unused instruction classes.

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

14 years agoThis test case:
Bill Wendling [Wed, 3 Mar 2010 00:35:56 +0000 (00:35 +0000)]
This test case:

long test(long x) { return (x & 123124) | 3; }

Currently compiles to:

_test:
        orl     $3, %edi
        movq    %rdi, %rax
        andq    $123127, %rax
        ret

This is because instruction and DAG combiners canonicalize

  (or (and x, C), D) -> (and (or, D), (C | D))

However, this is only profitable if (C & D) != 0. It gets in the way of the
3-addressification because the input bits are known to be zero.

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

14 years agoAdded 32-bit Thumb instructions t2DMB variants, t2DSB variants, and t2ISBsy for
Johnny Chen [Wed, 3 Mar 2010 00:16:28 +0000 (00:16 +0000)]
Added 32-bit Thumb instructions t2DMB variants, t2DSB variants, and t2ISBsy for
disassembly only.

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

14 years agoUse the ocaml tag 0 since we are just returning an option value.
Erick Tryzelaar [Tue, 2 Mar 2010 23:59:08 +0000 (23:59 +0000)]
Use the ocaml tag 0 since we are just returning an option value.

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