Commit Graph

42065 Commits

Author SHA1 Message Date
Evan Cheng ed033ede22 Do not shrink wrap live interval in a mbb if it's livein any of its successor blocks. The mbb can be revisited again after all of the successors are processed.
llvm-svn: 58184
2008-10-26 07:49:03 +00:00
Oscar Fuentes 29a0da5f8e Return something (i.e. NULL) from an unimplemented virtual function.
llvm-svn: 58183
2008-10-26 04:26:33 +00:00
Oscar Fuentes e638f5d854 CMake: If we have `clang' under the `tools/' subdirectory, add it to
the build.

llvm-svn: 58179
2008-10-26 00:52:09 +00:00
Oscar Fuentes 20baf2fc3c CMake: Support for LLVM_USED_LIBS variable, which is the cmake
counterpart of USED_LIBS.

llvm-svn: 58178
2008-10-26 00:51:05 +00:00
Oscar Fuentes ca0b988a21 CMake: Removed unnecessary macro definitions. They are defined in
config.h

llvm-svn: 58177
2008-10-26 00:50:03 +00:00
Oscar Fuentes bf81f792cd CMake: GetTargetTriple: new module for determining the target
triple. Assign to LLVM_HOSTTRIPLE so it figures in config.h.

llvm-svn: 58176
2008-10-26 00:47:52 +00:00
Bill Wendling 97f7de8875 Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
Patch by Frits van Bommel!

llvm-svn: 58175
2008-10-26 00:19:56 +00:00
Evan Cheng f48367b8e9 Handle cases where there aren't uses in the barrier mbb.
llvm-svn: 58174
2008-10-25 23:49:39 +00:00
Evan Cheng 6be78004a5 Add storeRegTo{StackSlot|Addr} and loadRegFrom{StackSlot|Addr} descriptions.
llvm-svn: 58164
2008-10-25 23:08:22 +00:00
Dan Gohman f856f50463 Make comments and code for QuietWarnings and QuietErrors
actually correspond to what their names suggest.

llvm-svn: 58146
2008-10-25 17:57:20 +00:00
Dan Gohman 811eed81ab SDNodes may have at most one Flag result. Update this comment
to reflect that.

llvm-svn: 58145
2008-10-25 17:51:24 +00:00
Dan Gohman 191453174d Move the code that adds the DeadMachineInstructionElimPass from
target-independent code to target-specific code. This prevents it
from running on targets that aren't using fast-isel.

In addition to saving compile time, this addresses the problem
that not all targets are prepared for it. In order to use this
pass, all instructions must declare all their fixed uses and
defs of physical registers.

llvm-svn: 58144
2008-10-25 17:46:52 +00:00
Gordon Henriksen bf40eee91a Related to PR2911, reject as invalid non-pointer GC roots.
llvm-svn: 58143
2008-10-25 16:28:35 +00:00
Nicolas Geoffray 5457ce9ac3 Support for allocation of TLS variables in the JIT. Allocation of a global
variable is moved to the execution engine. The JIT calls the TargetJITInfo
to allocate thread local storage. Currently, only linux/x86 knows how to
allocate thread local global variables.

llvm-svn: 58142
2008-10-25 15:41:43 +00:00
Nicolas Geoffray db30612fc4 Generate code for TLS instructions.
llvm-svn: 58141
2008-10-25 15:22:06 +00:00
Bruno Cardoso Lopes 24eb3de4c2 Added MIPS release notes.
llvm-svn: 58139
2008-10-25 14:56:26 +00:00
Oscar Fuentes 24617b7152 CMake: Directed bug reports to llvmbugs.
llvm-svn: 58134
2008-10-25 03:49:35 +00:00
Oscar Fuentes 9ba4650b76 CMake: lib/Target/ARM/AsmPrinter/CMakeLists.txt added.
llvm-svn: 58133
2008-10-25 03:40:32 +00:00
Oscar Fuentes a9ac909248 CMake: MSVC++ no longer uses a special configuration method.
llvm-svn: 58132
2008-10-25 03:29:36 +00:00
Oscar Fuentes 593bb21ded CMake: Sync'ed DataTypes.h.cmake with DataTypes.h.in.
llvm-svn: 58131
2008-10-25 03:25:11 +00:00
Oscar Fuentes c4b5c8c1ed CMake: Cross-platform support for using pre-generated llvmAsmParser.cpp and llvmAsmParser.h.
llvm-svn: 58130
2008-10-25 03:19:08 +00:00
Evan Cheng 85d71d4588 If val# def is ~0U, meaning it's defined by a PHI, and it's previously split, spill before the barrier because it's impossible to determine if all the defs are spilled in the same spill slot.
llvm-svn: 58129
2008-10-25 00:52:41 +00:00
Dale Johannesen 71f361e758 Mark MFCR as reading all condition code registers.
Prevents some more overzealous deletions (mostly
in AltiVec code).

llvm-svn: 58121
2008-10-24 22:08:01 +00:00
Dale Johannesen 3863f8e725 Rewrite logic to figure out whether LR needs to
be saved/restored in the prolog/epilog.  We need
to do this iff something in the function stores
into it.

llvm-svn: 58116
2008-10-24 21:24:23 +00:00
Dale Johannesen e45896fc4f Be kind to non-x86 hosts.
llvm-svn: 58113
2008-10-24 21:20:25 +00:00
Torok Edwin 33986d8f17 move the note to the correct README
llvm-svn: 58104
2008-10-24 19:23:07 +00:00
Torok Edwin fcaae54669 add note about va_arg code on x86 and x86-64
llvm-svn: 58103
2008-10-24 19:20:05 +00:00
Evan Cheng cd160f9859 Fix a pasto.
llvm-svn: 58102
2008-10-24 18:46:44 +00:00
Duncan Sands 014f5bbaad Fix translateX86CC: if SetCCOpcode is SETULE and
LHS is a foldable load, then LHS and RHS are swapped
and SetCCOpcode is changed to SETUGT.  But the later
code is expecting operands to be the wrong way round
for SETUGT, but they are not in this case, resulting
in an inverted compare.  The solution is to move the
load normalization before the correction for SETUGT.
This bug was tickled by LegalizeTypes which happened
to legalize the testcase slightly differently to
LegalizeDAG.

llvm-svn: 58092
2008-10-24 13:03:10 +00:00
Cedric Venet a00d112486 Modify the cmake build system so that if it doesn't find bison, it will use the pregenerated file in from the svn (.cvs). Work only for windows for the moment. Tested on Vista64 with MSVC2008express.
llvm-svn: 58090
2008-10-24 11:24:33 +00:00
Steve Naroff 7fb14b0cd0 Add a file to VC++ proj.
llvm-svn: 58089
2008-10-24 10:38:57 +00:00
Nick Lewycky 730d5dade6 Don't try to create a mask when we don't need one. Fixes a crash.
llvm-svn: 58075
2008-10-24 06:14:27 +00:00
Evan Cheng f8b09d424d Fix a end() dereference; remove an abort() that wasn't meant to be left in.
llvm-svn: 58072
2008-10-24 05:53:44 +00:00
Nick Lewycky f6e4dca67e Add value range analyzing of Add and Sub.
Understand that mul %x, 1 = %x.

llvm-svn: 58069
2008-10-24 04:00:26 +00:00
Evan Cheng 4bac4d0a16 Avoid splitting an interval multiple times; avoid splitting re-materializable val# (for now).
llvm-svn: 58068
2008-10-24 02:05:00 +00:00
Dan Gohman 712886f561 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.

llvm-svn: 58066
2008-10-24 01:57:54 +00:00
Steve Naroff 886b5193a7 Add file to VC++ project.
llvm-svn: 58060
2008-10-24 01:21:47 +00:00
Dale Johannesen 8b531d2754 Initialize uninitialized variable.
llvm-svn: 58057
2008-10-24 01:06:58 +00:00
Ted Kremenek 3c6de496b0 Added raw_fd_ostream::close().
llvm-svn: 58052
2008-10-23 23:49:09 +00:00
Steve Naroff a6090204a1 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.

llvm-svn: 58048
2008-10-23 23:28:23 +00:00
Evan Cheng d0d0317b9a 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.
llvm-svn: 58044
2008-10-23 20:43:13 +00:00
Dale Johannesen e395d78657 Mark defs and uses of CTR and LR correctly.
Prevents DeadMachineInstructionElim from thinking
things like MTCTR are dead (fixes massive
testsuite breakage at -O0).

llvm-svn: 58043
2008-10-23 20:41:28 +00:00
Daniel Dunbar f4be24686f Make sure to set stdout to binary when writing bitcode files via
std::ostream API.

llvm-svn: 58042
2008-10-23 19:37:34 +00:00
Duncan Sands 62951678ee Fix thinko - the operand number has nothing to do
with the result number.

llvm-svn: 58041
2008-10-23 19:34:23 +00:00
Argyrios Kyrtzidis cdc89ad215 Introduce INT64_C macro and unbreak LLVM on MSVC.
llvm-svn: 58039
2008-10-23 17:20:39 +00:00
Chris Lattner 9246c2c8e1 make this test not depend on how the system header defines memset.
llvm-svn: 58016
2008-10-23 00:24:51 +00:00
Daniel Dunbar 7f39e2d85a 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.

llvm-svn: 58010
2008-10-22 23:32:42 +00:00
Ted Kremenek 5902794c8c 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.
llvm-svn: 58009
2008-10-22 23:16:52 +00:00
Jim Grosbach 1ecf1fd5c8 remove extraneous #ifdef's
llvm-svn: 58006
2008-10-22 22:27:51 +00:00
Daniel Dunbar 890d0deb74 Add raw_ostream versions of WriteBitcodeToFile and BitcodeWriterPass.
- The old versions are still hanging around, but should be migrated
   away from.

llvm-svn: 57989
2008-10-22 17:39:14 +00:00
Dale Johannesen f6655a9e79 Remove allocation of unused stack slot.
llvm-svn: 57987
2008-10-22 17:26:06 +00:00
Julien Lerouge e9de15b88a Fix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.
llvm-svn: 57984
2008-10-22 16:30:41 +00:00
Gordon Henriksen e38d542d89 [PR2886] Ignore stderr from ocamlc since it prints unresolvable warnings on some platforms.
llvm-svn: 57976
2008-10-22 12:41:54 +00:00
Gordon Henriksen 9b601a4df8 Regenerate.
llvm-svn: 57975
2008-10-22 12:40:55 +00:00
Gordon Henriksen 2289eb89fb [PR2886] Don't look for ocaml's .opt executables; something in the autoconf/test machinery doesn't handle the period properly.
llvm-svn: 57974
2008-10-22 12:40:40 +00:00
Duncan Sands 8178141378 LegalizeTypes soft-float support for fpow.
llvm-svn: 57973
2008-10-22 11:49:09 +00:00
Duncan Sands 5ee1dde8fa 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.

llvm-svn: 57972
2008-10-22 11:24:12 +00:00
Torok Edwin 822dcee526 Regenerate configure
llvm-svn: 57971
2008-10-22 09:56:27 +00:00
Argyrios Kyrtzidis 9e50bff478 Unbreak LLVM on the MSVC compiler:
-Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h
-Define strtoull

llvm-svn: 57970
2008-10-22 09:54:13 +00:00
Duncan Sands 685dcdc896 Use spaces rather than tab.
llvm-svn: 57969
2008-10-22 09:42:14 +00:00
Duncan Sands 578a68a91a 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.

llvm-svn: 57968
2008-10-22 09:23:20 +00:00
Duncan Sands 01a1c11218 Port from LegalizeDAG the logic to only generate
ADDC/ADDE/SUBC/SUBE if the target supports it.

llvm-svn: 57967
2008-10-22 09:07:29 +00:00
Duncan Sands a1a388cac3 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.

llvm-svn: 57966
2008-10-22 09:06:24 +00:00
Duncan Sands 4b6b5fcd80 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.

llvm-svn: 57965
2008-10-22 09:00:33 +00:00
Chris Lattner 35b40f8c2f Fix PR2907 by digging through constant expressions to find FP constants that
are their operands.

llvm-svn: 57956
2008-10-22 04:53:16 +00:00
Daniel Dunbar 81b5fa5620 Move Print*Pass to use raw_ostream.
llvm-svn: 57946
2008-10-22 03:25:22 +00:00
Oscar Fuentes 64c996271e CMake: `make install' for libraries, executables and header files.
llvm-svn: 57945
2008-10-22 02:56:07 +00:00
Oscar Fuentes cac467ef44 CMake: use add_llvm_example for HowToUseJIT.
llvm-svn: 57944
2008-10-22 02:52:59 +00:00
Oscar Fuentes f3c03b02dc CMake: Turned some libraries into partially linked objects. Corrected
names of LLVMCore and ARMCodeGen.

llvm-svn: 57943
2008-10-22 02:51:53 +00:00
Dale Johannesen cf4607fcce Adjust comments for pedantic satisfaction.
llvm-svn: 57940
2008-10-22 00:02:32 +00:00
Bill Wendling 8286026700 Fix comment to name "TokenFactor" instead of "Token factor".
llvm-svn: 57939
2008-10-21 23:57:52 +00:00
Oscar Fuentes 7089213eec CMake: updated lib/VMCore/CMakeLists.txt
llvm-svn: 57937
2008-10-21 23:52:03 +00:00
Daniel Dunbar 54d5b9ea2c Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.

llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Dale Johannesen 3d7ece1acb Add comments to explain uint64->f64 algorithm,
well, sort of.  (Algorithm by Ian Ollmann.)

llvm-svn: 57932
2008-10-21 23:07:49 +00:00
Dale Johannesen 28929589e7 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.

llvm-svn: 57926
2008-10-21 20:50:01 +00:00
Dan Gohman 8b44b88eff Fix SelectionDAGBuild lowering of Select instructions to
handle first-class aggregate values. Also, fix a bug in
the Ret handling for empty aggregates.

llvm-svn: 57925
2008-10-21 20:00:42 +00:00
Daniel Dunbar 1ca20df437 Clear raw_fd_ostream error string on success and explain behavior in
documentation.

Add C++ header marker.

llvm-svn: 57923
2008-10-21 19:53:10 +00:00
Dan Gohman c7d4f28254 Updated email address.
llvm-svn: 57920
2008-10-21 19:50:00 +00:00
Dan Gohman 4ddf7a4c22 Implement the optimized FCMP_OEQ/FCMP_UNE code for x86 fast-isel.
llvm-svn: 57915
2008-10-21 18:24:51 +00:00
Torok Edwin 016fa4cd0d Fix make check on Solaris 10/x86: the default grep is not GNU grep, same for as.
llvm-svn: 57912
2008-10-21 17:21:32 +00:00
Jim Grosbach cfebc18d7c use pre-UAL mnemonics for push/pop for compilaton callback function
llvm-svn: 57911
2008-10-21 16:54:12 +00:00
Nuno Lopes 94844e2054 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.
llvm-svn: 57900
2008-10-21 11:42:16 +00:00
Ted Kremenek cdef990677 constify some methods and variables in ImmutableList.
llvm-svn: 57894
2008-10-21 05:59:33 +00:00
Chris Lattner 192f27cb5c really fix run line
llvm-svn: 57889
2008-10-21 03:55:19 +00:00
Chris Lattner b4ee2aebb5 fix run line
llvm-svn: 57888
2008-10-21 03:54:49 +00:00
Chris Lattner 0b641e4718 remove some unneeded eh generation
llvm-svn: 57887
2008-10-21 03:49:19 +00:00
Dan Gohman c14e5227f0 Disable constant-offset folding for PowerPC, as the PowerPC target
isn't yet prepared for it.

llvm-svn: 57886
2008-10-21 03:41:46 +00:00
Dan Gohman 269246b034 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.

llvm-svn: 57885
2008-10-21 03:38:42 +00:00
Dan Gohman 97d95d6d85 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.

llvm-svn: 57873
2008-10-21 03:29:32 +00:00
Dan Gohman c835458da9 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.

llvm-svn: 57872
2008-10-21 03:24:31 +00:00
Dan Gohman 97d3f6cfe3 Make the NaN test come second, heuristically assuming
that NaNs are less common.

llvm-svn: 57871
2008-10-21 03:12:54 +00:00
Dan Gohman 72e66eedb8 Use Function::getEntryBlock() instead of Function::front(), for clarity.
llvm-svn: 57870
2008-10-21 03:10:28 +00:00
Oscar Fuentes 0e12e5b12c CMake: updated lib/CodeGen/CMakeLists.txt
llvm-svn: 57869
2008-10-21 02:37:50 +00:00
Dan Gohman fa29b67aee Fix a bug that prevented llvm-extract -delete from working.
llvm-svn: 57864
2008-10-21 01:08:07 +00:00
Chris Lattner 4396e0d2c3 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).

llvm-svn: 57862
2008-10-21 00:45:36 +00:00
Evan Cheng 7e721ecd21 Add skeleton for the pre-register allocation live interval splitting pass.
llvm-svn: 57847
2008-10-20 21:44:59 +00:00
Jim Grosbach 9396051e3d 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.

llvm-svn: 57846
2008-10-20 21:39:23 +00:00
Dan Gohman 1a59b3b9b8 Fast-isel no longer an experiment.
llvm-svn: 57845
2008-10-20 21:30:12 +00:00
Evan Cheng bc623edaba Add a register class -> virtual registers map.
llvm-svn: 57844
2008-10-20 20:03:28 +00:00
Evan Cheng b660409c7d This forward declaration is unnecessary.
llvm-svn: 57843
2008-10-20 20:02:17 +00:00