oota-llvm.git
16 years agoAdd a file to VC++ proj.
Steve Naroff [Fri, 24 Oct 2008 10:38:57 +0000 (10:38 +0000)]
Add a file to VC++ proj.

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

16 years agoDon't try to create a mask when we don't need one. Fixes a crash.
Nick Lewycky [Fri, 24 Oct 2008 06:14:27 +0000 (06:14 +0000)]
Don't try to create a mask when we don't need one. Fixes a crash.

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

16 years agoFix a end() dereference; remove an abort() that wasn't meant to be left in.
Evan Cheng [Fri, 24 Oct 2008 05:53:44 +0000 (05:53 +0000)]
Fix a end() dereference; remove an abort() that wasn't meant to be left in.

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

16 years agoAdd value range analyzing of Add and Sub.
Nick Lewycky [Fri, 24 Oct 2008 04:00:26 +0000 (04:00 +0000)]
Add value range analyzing of Add and Sub.
Understand that mul %x, 1 = %x.

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

16 years agoAvoid splitting an interval multiple times; avoid splitting re-materializable val...
Evan Cheng [Fri, 24 Oct 2008 02:05:00 +0000 (02:05 +0000)]
Avoid splitting an interval multiple times; avoid splitting re-materializable val# (for now).

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

16 years agoFix constant-offset emission for x86-64 absolute addresses. This
Dan Gohman [Fri, 24 Oct 2008 01:57:54 +0000 (01:57 +0000)]
Fix constant-offset emission for x86-64 absolute addresses. This
fixes a bunch of test-suite JIT failures on x86-64 in
-relocation-model=static mode.

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

16 years agoAdd file to VC++ project.
Steve Naroff [Fri, 24 Oct 2008 01:21:47 +0000 (01:21 +0000)]
Add file to VC++ project.

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

16 years agoInitialize uninitialized variable.
Dale Johannesen [Fri, 24 Oct 2008 01:06:58 +0000 (01:06 +0000)]
Initialize uninitialized variable.

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

16 years agoAdded raw_fd_ostream::close().
Ted Kremenek [Thu, 23 Oct 2008 23:49:09 +0000 (23:49 +0000)]
Added raw_fd_ostream::close().

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

16 years agoChanges to make the Windows build work...
Steve Naroff [Thu, 23 Oct 2008 23:28:23 +0000 (23:28 +0000)]
Changes to make the Windows build work...
- Add a file to the VC++ project.
- Make sure the clang driver links against the Transforms library.
- Incorporate changes from patch by Dan Gohman.

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

16 years agoCommitting a good chunk of the pre-register allocation live interval splitting pass...
Evan Cheng [Thu, 23 Oct 2008 20:43:13 +0000 (20:43 +0000)]
Committing a good chunk of the pre-register allocation live interval splitting pass. It's handling simple cases and appear to do good things. Next: avoid splitting an interval multiple times; renumber registers when possible; record stack slot live intervals for coloring; rematerialize defs when possible.

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

16 years agoMark defs and uses of CTR and LR correctly.
Dale Johannesen [Thu, 23 Oct 2008 20:41:28 +0000 (20:41 +0000)]
Mark defs and uses of CTR and LR correctly.
Prevents DeadMachineInstructionElim from thinking
things like MTCTR are dead (fixes massive
testsuite breakage at -O0).

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

16 years agoMake sure to set stdout to binary when writing bitcode files via
Daniel Dunbar [Thu, 23 Oct 2008 19:37:34 +0000 (19:37 +0000)]
Make sure to set stdout to binary when writing bitcode files via
std::ostream API.

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

16 years agoFix thinko - the operand number has nothing to do
Duncan Sands [Thu, 23 Oct 2008 19:34:23 +0000 (19:34 +0000)]
Fix thinko - the operand number has nothing to do
with the result number.

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

16 years agoIntroduce INT64_C macro and unbreak LLVM on MSVC.
Argyrios Kyrtzidis [Thu, 23 Oct 2008 17:20:39 +0000 (17:20 +0000)]
Introduce INT64_C macro and unbreak LLVM on MSVC.

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

16 years agomake this test not depend on how the system header defines memset.
Chris Lattner [Thu, 23 Oct 2008 00:24:51 +0000 (00:24 +0000)]
make this test not depend on how the system header defines memset.

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

16 years agoChange create*Pass factory functions to return Pass* instead of
Daniel Dunbar [Wed, 22 Oct 2008 23:32:42 +0000 (23:32 +0000)]
Change create*Pass factory functions to return Pass* instead of
LoopPass*.
 - Although less precise, this means they can be used in clients
   without RTTI (who would otherwise need to include LoopPass.h, which
   eventually includes things using dynamic_cast). This was the
   simplest solution that presented itself, but I am happy to use a
   better one if available.

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

16 years agoFix incorrect testing for the end of the both strings in CStrInCStrNoCase. This...
Ted Kremenek [Wed, 22 Oct 2008 23:16:52 +0000 (23:16 +0000)]
Fix incorrect testing for the end of the both strings in CStrInCStrNoCase.  This could cause a read-out-of-bounds error if s2 is smaller than s1.

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

16 years agoremove extraneous #ifdef's
Jim Grosbach [Wed, 22 Oct 2008 22:27:51 +0000 (22:27 +0000)]
remove extraneous #ifdef's

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

16 years agoAdd raw_ostream versions of WriteBitcodeToFile and BitcodeWriterPass.
Daniel Dunbar [Wed, 22 Oct 2008 17:39:14 +0000 (17:39 +0000)]
Add raw_ostream versions of WriteBitcodeToFile and BitcodeWriterPass.
 - The old versions are still hanging around, but should be migrated
   away from.

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

16 years agoRemove allocation of unused stack slot.
Dale Johannesen [Wed, 22 Oct 2008 17:26:06 +0000 (17:26 +0000)]
Remove allocation of unused stack slot.

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

16 years agoFix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.
Julien Lerouge [Wed, 22 Oct 2008 16:30:41 +0000 (16:30 +0000)]
Fix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.

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

16 years ago[PR2886] Ignore stderr from ocamlc since it prints unresolvable warnings on some...
Gordon Henriksen [Wed, 22 Oct 2008 12:41:54 +0000 (12:41 +0000)]
[PR2886] Ignore stderr from ocamlc since it prints unresolvable warnings on some platforms.

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

16 years agoRegenerate.
Gordon Henriksen [Wed, 22 Oct 2008 12:40:55 +0000 (12:40 +0000)]
Regenerate.

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

16 years ago[PR2886] Don't look for ocaml's .opt executables; something in the autoconf/test...
Gordon Henriksen [Wed, 22 Oct 2008 12:40:40 +0000 (12:40 +0000)]
[PR2886] Don't look for ocaml's .opt executables; something in the autoconf/test machinery doesn't handle the period properly.

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

16 years agoLegalizeTypes soft-float support for fpow.
Duncan Sands [Wed, 22 Oct 2008 11:49:09 +0000 (11:49 +0000)]
LegalizeTypes soft-float support for fpow.

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

16 years agoGet this working with LegalizeTypes: (1) don't
Duncan Sands [Wed, 22 Oct 2008 11:24:12 +0000 (11:24 +0000)]
Get this working with LegalizeTypes: (1) don't
assume that i64 has been turned into a BUILD_PAIR
node (when called from LegalizeTypes this hasn't
happened yet) and don't use a vector shuffle mask
with an illegal element type.

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

16 years agoRegenerate configure
Torok Edwin [Wed, 22 Oct 2008 09:56:27 +0000 (09:56 +0000)]
Regenerate configure

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

16 years agoUnbreak LLVM on the MSVC compiler:
Argyrios Kyrtzidis [Wed, 22 Oct 2008 09:54:13 +0000 (09:54 +0000)]
Unbreak LLVM on the MSVC compiler:

-Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h
-Define strtoull

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

16 years agoUse spaces rather than tab.
Duncan Sands [Wed, 22 Oct 2008 09:42:14 +0000 (09:42 +0000)]
Use spaces rather than tab.

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

16 years agoBe nice to CellSPU: for this target getSetCCResultType
Duncan Sands [Wed, 22 Oct 2008 09:23:20 +0000 (09:23 +0000)]
Be nice to CellSPU: for this target getSetCCResultType
may return i8, which can result in SELECT nodes for
which the type of the condition is i8, but there are
no patterns for select with i8 condition.  Tweak the
LegalizeTypes logic to avoid this as much as possible.
This isn't a real fix because it is still perfectly
possible to end up with such select nodes - CellSPU
needs to be fixed IMHO.

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

16 years agoPort from LegalizeDAG the logic to only generate
Duncan Sands [Wed, 22 Oct 2008 09:07:29 +0000 (09:07 +0000)]
Port from LegalizeDAG the logic to only generate
ADDC/ADDE/SUBC/SUBE if the target supports it.

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

16 years agoAdd some comments explaining the meaning of a boolean
Duncan Sands [Wed, 22 Oct 2008 09:06:24 +0000 (09:06 +0000)]
Add some comments explaining the meaning of a boolean
that is not of type MVT::i1 in SELECT and SETCC nodes.
Relax the LegalizeTypes SELECT condition promotion
sanity checks to allow other condition types than i1.

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

16 years agoTemporarily allow the operands of a BUILD_VECTOR
Duncan Sands [Wed, 22 Oct 2008 09:00:33 +0000 (09:00 +0000)]
Temporarily allow the operands of a BUILD_VECTOR
to have a different type to the vector element
type.  This should be fairly harmless because in
the past guys like this were being built all over
the place (and were cleaned up when I added this
check).  The reason for relaxing this check is
that it helps LegalizeTypes legalize vector
shuffles: the mask is a BUILD_VECTOR that it is
*not always possible* to legalize while keeping it
a BUILD_VECTOR (vector_shuffle requires the mask
to be a BUILD_VECTOR, as opposed to a vector with
the right vector type).  With this check it is even
harder to legalize the mask - turning the check off
means that LegalizeTypes manages to legalize almost
all vector shuffles encountered in practice.  The
correct solution is to change vector_shuffle to be a
variadic node with the mask built into it as operands.
While waiting for that change, this hack stops the
problem with vector_shuffle from blocking the turning
on of LegalizeTypes.

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

16 years agoFix PR2907 by digging through constant expressions to find FP constants that
Chris Lattner [Wed, 22 Oct 2008 04:53:16 +0000 (04:53 +0000)]
Fix PR2907 by digging through constant expressions to find FP constants that
are their operands.

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

16 years agoMove Print*Pass to use raw_ostream.
Daniel Dunbar [Wed, 22 Oct 2008 03:25:22 +0000 (03:25 +0000)]
Move Print*Pass to use raw_ostream.

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

16 years agoCMake: `make install' for libraries, executables and header files.
Oscar Fuentes [Wed, 22 Oct 2008 02:56:07 +0000 (02:56 +0000)]
CMake: `make install' for libraries, executables and header files.

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

16 years agoCMake: use add_llvm_example for HowToUseJIT.
Oscar Fuentes [Wed, 22 Oct 2008 02:52:59 +0000 (02:52 +0000)]
CMake: use add_llvm_example for HowToUseJIT.

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

16 years agoCMake: Turned some libraries into partially linked objects. Corrected
Oscar Fuentes [Wed, 22 Oct 2008 02:51:53 +0000 (02:51 +0000)]
CMake: Turned some libraries into partially linked objects. Corrected
names of LLVMCore and ARMCodeGen.

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

16 years agoAdjust comments for pedantic satisfaction.
Dale Johannesen [Wed, 22 Oct 2008 00:02:32 +0000 (00:02 +0000)]
Adjust comments for pedantic satisfaction.

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

16 years agoFix comment to name "TokenFactor" instead of "Token factor".
Bill Wendling [Tue, 21 Oct 2008 23:57:52 +0000 (23:57 +0000)]
Fix comment to name "TokenFactor" instead of "Token factor".

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

16 years agoCMake: updated lib/VMCore/CMakeLists.txt
Oscar Fuentes [Tue, 21 Oct 2008 23:52:03 +0000 (23:52 +0000)]
CMake: updated lib/VMCore/CMakeLists.txt

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

16 years agoPrivatize PrintModulePass and PrintFunctionPass and add
Daniel Dunbar [Tue, 21 Oct 2008 23:33:38 +0000 (23:33 +0000)]
Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.

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

16 years agoAdd comments to explain uint64->f64 algorithm,
Dale Johannesen [Tue, 21 Oct 2008 23:07:49 +0000 (23:07 +0000)]
Add comments to explain uint64->f64 algorithm,
well, sort of.  (Algorithm by Ian Ollmann.)

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

16 years agoAdd an SSE2 algorithm for uint64->f64 conversion.
Dale Johannesen [Tue, 21 Oct 2008 20:50:01 +0000 (20:50 +0000)]
Add an SSE2 algorithm for uint64->f64 conversion.
The same one Apple gcc uses, faster.  Also gets the
extreme case in gcc.c-torture/execute/ieee/rbug.c
correct which we weren't before; this is not
sufficient to get the test to pass though, there
is another bug.

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

16 years agoFix SelectionDAGBuild lowering of Select instructions to
Dan Gohman [Tue, 21 Oct 2008 20:00:42 +0000 (20:00 +0000)]
Fix SelectionDAGBuild lowering of Select instructions to
handle first-class aggregate values. Also, fix a bug in
the Ret handling for empty aggregates.

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

16 years agoClear raw_fd_ostream error string on success and explain behavior in
Daniel Dunbar [Tue, 21 Oct 2008 19:53:10 +0000 (19:53 +0000)]
Clear raw_fd_ostream error string on success and explain behavior in
documentation.

Add C++ header marker.

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

16 years agoUpdated email address.
Dan Gohman [Tue, 21 Oct 2008 19:50:00 +0000 (19:50 +0000)]
Updated email address.

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

16 years agoImplement the optimized FCMP_OEQ/FCMP_UNE code for x86 fast-isel.
Dan Gohman [Tue, 21 Oct 2008 18:24:51 +0000 (18:24 +0000)]
Implement the optimized FCMP_OEQ/FCMP_UNE code for x86 fast-isel.

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

16 years agoFix make check on Solaris 10/x86: the default grep is not GNU grep, same for as.
Torok Edwin [Tue, 21 Oct 2008 17:21:32 +0000 (17:21 +0000)]
Fix make check on Solaris 10/x86: the default grep is not GNU grep, same for as.

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

16 years agouse pre-UAL mnemonics for push/pop for compilaton callback function
Jim Grosbach [Tue, 21 Oct 2008 16:54:12 +0000 (16:54 +0000)]
use pre-UAL mnemonics for push/pop for compilaton callback function

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

16 years agofix a tricky bug in the JIT global variable emitter, that was triggered when JITing...
Nuno Lopes [Tue, 21 Oct 2008 11:42:16 +0000 (11:42 +0000)]
fix a tricky bug in the JIT global variable emitter, that was triggered when JITing a variable independently of a function. This lead to sharing memory memory between functions and GVs thus changing the value of a GV could change the code in execution. more details on the ML.

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

16 years agoconstify some methods and variables in ImmutableList.
Ted Kremenek [Tue, 21 Oct 2008 05:59:33 +0000 (05:59 +0000)]
constify some methods and variables in ImmutableList.

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

16 years agoreally fix run line
Chris Lattner [Tue, 21 Oct 2008 03:55:19 +0000 (03:55 +0000)]
really fix run line

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

16 years agofix run line
Chris Lattner [Tue, 21 Oct 2008 03:54:49 +0000 (03:54 +0000)]
fix run line

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

16 years agoremove some unneeded eh generation
Chris Lattner [Tue, 21 Oct 2008 03:49:19 +0000 (03:49 +0000)]
remove some unneeded eh generation

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

16 years agoDisable constant-offset folding for PowerPC, as the PowerPC target
Dan Gohman [Tue, 21 Oct 2008 03:41:46 +0000 (03:41 +0000)]
Disable constant-offset folding for PowerPC, as the PowerPC target
isn't yet prepared for it.

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

16 years agoDon't create TargetGlobalAddress nodes with offsets that don't fit
Dan Gohman [Tue, 21 Oct 2008 03:38:42 +0000 (03:38 +0000)]
Don't create TargetGlobalAddress nodes with offsets that don't fit
in the 32-bit signed offset field of addresses. Even though this
may be intended, some linkers refuse to relocate code where the
relocated address computation overflows.

Also, fix the sign-extension of constant offsets to use the
actual pointer size, rather than the size of the GlobalAddress
node, which may be different, for example on x86-64 where MVT::i32
is used when the address is being fit into the 32-bit displacement
field.

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

16 years agoOptimized FCMP_OEQ and FCMP_UNE for x86.
Dan Gohman [Tue, 21 Oct 2008 03:29:32 +0000 (03:29 +0000)]
Optimized FCMP_OEQ and FCMP_UNE for x86.

Where previously LLVM might emit code like this:

        ucomisd %xmm1, %xmm0
        setne   %al
        setp    %cl
        orb     %al, %cl
        jne     .LBB4_2

it now emits this:

        ucomisd %xmm1, %xmm0
        jne     .LBB4_2
        jp      .LBB4_2

It has fewer instructions and uses fewer registers, but it does
have more branches. And in the case that this code is followed by
a non-fallthrough edge, it may be followed by a jmp instruction,
resulting in three branch instructions in sequence. Some effort
is made to avoid this situation.

To achieve this, X86ISelLowering.cpp now recognizes FCMP_OEQ and
FCMP_UNE in lowered form, and replace them with code that emits
two branches, except in the case where it would require converting
a fall-through edge to an explicit branch.

Also, X86InstrInfo.cpp's branch analysis and transform code now
knows now to handle blocks with multiple conditional branches. It
uses loops instead of having fixed checks for up to two
instructions. It can now analyze and transform code generated
from FCMP_OEQ and FCMP_UNE.

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

16 years agoWhen the coalescer is doing rematerializing, have it remove
Dan Gohman [Tue, 21 Oct 2008 03:24:31 +0000 (03:24 +0000)]
When the coalescer is doing rematerializing, have it remove
the copy instruction from the instruction list before asking the
target to create the new instruction. This gets the old instruction
out of the way so that it doesn't interfere with the target's
rematerialization code. In the case of x86, this helps it find
more cases where EFLAGS is not live.

Also, in the X86InstrInfo.cpp, teach isSafeToClobberEFLAGS to check
to see if it reached the end of the block after scanning each
instruction, instead of just before. This lets it notice when the
end of the block is only two instructions away, without doing any
additional scanning.

These changes allow rematerialization to clobber EFLAGS in more
cases, for example using xor instead of mov to set the return value
to zero in the included testcase.

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

16 years agoMake the NaN test come second, heuristically assuming
Dan Gohman [Tue, 21 Oct 2008 03:12:54 +0000 (03:12 +0000)]
Make the NaN test come second, heuristically assuming
that NaNs are less common.

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

16 years agoUse Function::getEntryBlock() instead of Function::front(), for clarity.
Dan Gohman [Tue, 21 Oct 2008 03:10:28 +0000 (03:10 +0000)]
Use Function::getEntryBlock() instead of Function::front(), for clarity.

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

16 years agoCMake: updated lib/CodeGen/CMakeLists.txt
Oscar Fuentes [Tue, 21 Oct 2008 02:37:50 +0000 (02:37 +0000)]
CMake: updated lib/CodeGen/CMakeLists.txt

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

16 years agoFix a bug that prevented llvm-extract -delete from working.
Dan Gohman [Tue, 21 Oct 2008 01:08:07 +0000 (01:08 +0000)]
Fix a bug that prevented llvm-extract -delete from working.

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

16 years agoFix gcc.c-torture/compile/920520-1.c by inserting bitconverts
Chris Lattner [Tue, 21 Oct 2008 00:45:36 +0000 (00:45 +0000)]
Fix gcc.c-torture/compile/920520-1.c by inserting bitconverts
for strange asm conditions earlier.  In this case, we have a
double being passed in an integer reg class.  Convert to like
sized integer register so that we allocate the right number
for the class (two i32's for the f64 in this case).

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

16 years agoAdd skeleton for the pre-register allocation live interval splitting pass.
Evan Cheng [Mon, 20 Oct 2008 21:44:59 +0000 (21:44 +0000)]
Add skeleton for the pre-register allocation live interval splitting pass.

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

16 years agoUpdate the stub and callback code to handle lazy compilation. The stub
Jim Grosbach [Mon, 20 Oct 2008 21:39:23 +0000 (21:39 +0000)]
Update the stub and callback code to handle lazy compilation. The stub
is re-written by the callback to branch directly to the compiled code
in future invocations.

Added back in range-based memory permission functions for the updating of
the stub on Darwin.

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

16 years agoFast-isel no longer an experiment.
Dan Gohman [Mon, 20 Oct 2008 21:30:12 +0000 (21:30 +0000)]
Fast-isel no longer an experiment.

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

16 years agoAdd a register class -> virtual registers map.
Evan Cheng [Mon, 20 Oct 2008 20:03:28 +0000 (20:03 +0000)]
Add a register class -> virtual registers map.

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

16 years agoThis forward declaration is unnecessary.
Evan Cheng [Mon, 20 Oct 2008 20:02:17 +0000 (20:02 +0000)]
This forward declaration is unnecessary.

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

16 years agoSupport operations like fp_to_uint with a vector
Duncan Sands [Mon, 20 Oct 2008 16:31:21 +0000 (16:31 +0000)]
Support operations like fp_to_uint with a vector
result type when the result type is legal but
not the operand type.  Add additional support
for EXTRACT_SUBVECTOR and CONCAT_VECTORS,
needed to handle such cases.

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

16 years agoTeach getTypeToTransformTo to return something
Duncan Sands [Mon, 20 Oct 2008 16:24:25 +0000 (16:24 +0000)]
Teach getTypeToTransformTo to return something
sensible for vectors being scalarized.  Note
that this method can't return anything very
sensible when splitting non-power-of-two vectors.

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

16 years agoLegalizeTypes support for atomic operation promotion.
Duncan Sands [Mon, 20 Oct 2008 16:17:42 +0000 (16:17 +0000)]
LegalizeTypes support for atomic operation promotion.

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

16 years agoUse DAG.getIntPtrConstant rather than DAG.getConstant
Duncan Sands [Mon, 20 Oct 2008 16:14:43 +0000 (16:14 +0000)]
Use DAG.getIntPtrConstant rather than DAG.getConstant
with TLI.getPointerTy for a small simplification.

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

16 years agoAlways use either MVT::i1 or getSetCCResultType for
Duncan Sands [Mon, 20 Oct 2008 16:13:04 +0000 (16:13 +0000)]
Always use either MVT::i1 or getSetCCResultType for
the condition of a SELECT node.  Make sure that the
correct extension type (any-, sign- or zero-extend)
is used.

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

16 years agoFormatting - no functional change.
Duncan Sands [Mon, 20 Oct 2008 16:06:47 +0000 (16:06 +0000)]
Formatting - no functional change.

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

16 years agoDon't use a random type for the select condition,
Duncan Sands [Mon, 20 Oct 2008 16:04:57 +0000 (16:04 +0000)]
Don't use a random type for the select condition,
use an MVT::i1 and simplify the code while there.

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

16 years agoFix a typo in a comment.
Dan Gohman [Mon, 20 Oct 2008 15:58:02 +0000 (15:58 +0000)]
Fix a typo in a comment.

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

16 years agoHave X86 custom lowering for LegalizeTypes use
Duncan Sands [Mon, 20 Oct 2008 15:56:33 +0000 (15:56 +0000)]
Have X86 custom lowering for LegalizeTypes use
LowerOperation if it doesn't know what else to do.
This methods should probably be factorized some,
but this is good enough for the moment.  Have
LowerATOMIC_BINARY_64 use EXTRACT_ELEMENT rather
than assuming the operand is a BUILD_PAIR (if it
is then getNode will automagically simplify the
EXTRACT_ELEMENT).  This way LowerATOMIC_BINARY_64
usable from LegalizeTypes.

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

16 years agoFix typo in a comment.
Matthijs Kooijman [Mon, 20 Oct 2008 11:24:57 +0000 (11:24 +0000)]
Fix typo in a comment.

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

16 years agoRemove another stale comment.
Matthijs Kooijman [Mon, 20 Oct 2008 11:23:18 +0000 (11:23 +0000)]
Remove another stale comment.

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

16 years agoRemove an inappropriate (probably outdated) comment.
Matthijs Kooijman [Mon, 20 Oct 2008 11:21:12 +0000 (11:21 +0000)]
Remove an inappropriate (probably outdated) comment.

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

16 years agoFix spelling error.
Matthijs Kooijman [Mon, 20 Oct 2008 08:45:34 +0000 (08:45 +0000)]
Fix spelling error.

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

16 years agoSet N->OperandList to 0 after deletion. Otherwise, it's possible that it will
Bill Wendling [Sun, 19 Oct 2008 20:51:12 +0000 (20:51 +0000)]
Set N->OperandList to 0 after deletion. Otherwise, it's possible that it will
be either deleted or referenced afterwards.

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

16 years agoFix comment. Other formatting changes. No functionality changes.
Bill Wendling [Sun, 19 Oct 2008 20:34:04 +0000 (20:34 +0000)]
Fix comment. Other formatting changes. No functionality changes.

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

16 years agoVector shuffle mask elements may be "undef". Handle
Duncan Sands [Sun, 19 Oct 2008 15:00:25 +0000 (15:00 +0000)]
Vector shuffle mask elements may be "undef".  Handle
this everywhere in LegalizeTypes.

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

16 years agoUse a legal integer type for vector shuffle mask
Duncan Sands [Sun, 19 Oct 2008 14:58:05 +0000 (14:58 +0000)]
Use a legal integer type for vector shuffle mask
elements.  Otherwise LegalizeTypes will, reasonably
enough, legalize the mask, which may result in it
no longer being a BUILD_VECTOR node (LegalizeDAG
simply ignores the legality or not of vector masks).

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

16 years agoReapply r57699 with a fix to not crash on asms with multiple results. Unlike
Chris Lattner [Sat, 18 Oct 2008 18:49:30 +0000 (18:49 +0000)]
Reapply r57699 with a fix to not crash on asms with multiple results.  Unlike
the previous patch this one actually passes make check.

"Fix PR2356 on PowerPC: if we have an input and output that are tied together
that have different sizes (e.g. i32 and i64) make sure to reserve registers for
the bigger operand."

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

16 years agoDon't truncate GlobalAddress offsets to int in debug output.
Dan Gohman [Sat, 18 Oct 2008 18:22:42 +0000 (18:22 +0000)]
Don't truncate GlobalAddress offsets to int in debug output.

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

16 years agoBy min, I mean max.
Evan Cheng [Sat, 18 Oct 2008 05:21:37 +0000 (05:21 +0000)]
By min, I mean max.

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

16 years agoWhen creating intervals, leave min(1, numdefs) holes after each instruction.
Evan Cheng [Sat, 18 Oct 2008 05:18:55 +0000 (05:18 +0000)]
When creating intervals, leave min(1, numdefs) holes after each instruction.

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

16 years agoMake llvm memory barrier available as an intrinsic
Mon P Wang [Sat, 18 Oct 2008 02:48:13 +0000 (02:48 +0000)]
Make llvm memory barrier available as an intrinsic

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

16 years agoTeach DAGCombine to fold constant offsets into GlobalAddress nodes,
Dan Gohman [Sat, 18 Oct 2008 02:06:02 +0000 (02:06 +0000)]
Teach DAGCombine to fold constant offsets into GlobalAddress nodes,
and add a TargetLowering hook for it to use to determine when this
is legal (i.e. not in PIC mode, etc.)

This allows instruction selection to emit folded constant offsets
in more cases, such as the included testcase, eliminating the need
for explicit arithmetic instructions.

This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp
that attempted to achieve the same effect, but wasn't as effective.

Also, fix handling of offsets in GlobalAddressSDNodes in several
places, including changing GlobalAddressSDNode's offset from
int to int64_t.

The Mips, Alpha, Sparc, and CellSPU targets appear to be
unaware of GlobalAddress offsets currently, so set the hook to
false on those targets.

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

16 years agoRevert r57699. It's causing regressions in
Dan Gohman [Sat, 18 Oct 2008 01:03:45 +0000 (01:03 +0000)]
Revert r57699. It's causing regressions in
test/CodeGen/X86/2008-09-17-inline-asm-1.ll
and a few others, and it breaks the llvm-gcc build.

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

16 years agoUse the opcode predicates, instead of duplicating the code.
Dan Gohman [Fri, 17 Oct 2008 21:42:45 +0000 (21:42 +0000)]
Use the opcode predicates, instead of duplicating the code.

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

16 years agoThis is now partly done.
Dan Gohman [Fri, 17 Oct 2008 21:39:27 +0000 (21:39 +0000)]
This is now partly done.

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

16 years agoThis is done.
Dan Gohman [Fri, 17 Oct 2008 21:38:40 +0000 (21:38 +0000)]
This is done.

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

16 years agoFactor out the code for mapping LLVM IR condition opcodes to
Dan Gohman [Fri, 17 Oct 2008 21:16:08 +0000 (21:16 +0000)]
Factor out the code for mapping LLVM IR condition opcodes to
ISD condition opcodes into helper functions.

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

16 years agoAdd implicit defs of XMM8 to XMM15 on 32-bit call instructions. While this is not...
Evan Cheng [Fri, 17 Oct 2008 21:02:22 +0000 (21:02 +0000)]
Add implicit defs of XMM8 to XMM15 on 32-bit call instructions. While this is not technically true, it tells tblgen that these instructions "clobber" the entire XMM register file.

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

16 years agoAdd RCBarriers to TargetInstrDesc. It's a list of register classes the given instruct...
Evan Cheng [Fri, 17 Oct 2008 21:00:09 +0000 (21:00 +0000)]
Add RCBarriers to TargetInstrDesc. It's a list of register classes the given instruction can "clobber". For example, on x86 the call instruction can modify all of the XMM and fp stack registers.

TableGen has been taught to generate the lists from instruction definitions.

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