Commit Graph

25456 Commits

Author SHA1 Message Date
Dan Gohman
2275105edb Take Chris' suggestion and define EnableFastISelVerbose and
EnableFastISelAbort variables for Release mode instead of
using ifdefs in the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 20:35:31 +00:00
Daniel Dunbar
e9da133ae0 Reuse PrintEscapedString for printing names in .ll
- One functionality change, '\\' in a name is now printed as a hex
   escape instead of "\\\\". This is consistent with other users of
   PrintEscapedString.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58343 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 19:33:02 +00:00
Dan Gohman
727809ad8a Protect the code for fast-isel debugging with #ifndef NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 19:08:46 +00:00
Jim Grosbach
bc6d876adf Support for constant islands in the ARM JIT.
Since the ARM constant pool handling supercedes the standard LLVM constant
pool entirely, the JIT emitter does not allocate space for the constants,
nor initialize the memory. The constant pool is considered part of the 
instruction stream.

Likewise, when resolving relocations into the constant pool, a hook into
the target back end is used to resolve from the constant ID# to the
address where the constant is stored.

For now, the support in the ARM emitter is limited to 32-bit integer. Future
patches will expand this to the full range of constants necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58338 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 18:25:49 +00:00
Duncan Sands
57760d96e2 Fix darwin ppc llvm-gcc build breakage: intercept
ppcf128 to i32 conversion and expand it into a code
sequence like in LegalizeDAG.  This needs custom
ppc lowering of FP_ROUND_INREG, so turn that on and
make it work with LegalizeTypes.  Probably PPC should
simply custom lower the original conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 15:00:32 +00:00
Duncan Sands
1acb29c8ea Fix a testcase provided by Bill in which the node
id could end up being wrong mostly because of
forgetting to remap new nodes that morphed into
processed nodes through CSE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 09:38:36 +00:00
Chris Lattner
6e1c6231ba Don't produce invalid comparisons after legalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 07:11:07 +00:00
Chris Lattner
7fe5e1812f fix some whitespace stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 07:10:51 +00:00
Chris Lattner
4002a1b6f1 Fix a nasty miscompilation of 176.gcc on linux/x86 where we synthesized
a memset using 16-byte XMM stores, but where the stack realignment code
didn't work.  Until it does (PR2962) disable use of xmm regs in memcpy
and memset formation for linux and other targets with insufficiently
aligned stacks.

This is part of PR2888



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 05:49:35 +00:00
Evan Cheng
1f08cc2d2b If def is in the same mbb as the barrier, spilt the value after the last use before the barrier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 05:28:21 +00:00
Evan Cheng
ae7fa5bef1 Add command line option to limit the number splits to help debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 01:48:24 +00:00
Evan Cheng
f62ce370a4 Avoid putting a split past the end of the live range; always shrink wrap live interval in the barrier mbb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 00:47:49 +00:00
Evan Cheng
985921e846 Silence a bogus compile time warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 23:29:28 +00:00
David Greene
c714f13090 Re-apply 55137 with fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 23:24:03 +00:00
Evan Cheng
b3990d5e94 Remove val# defined by a remat'ed def that is now dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 23:21:01 +00:00
Ted Kremenek
8e7fa916fe Fix bogus comparison of "const char *" with c-string literal. Use strcmp instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 22:43:07 +00:00
David Greene
8ad4c00c00 Have TableGen emit setSubgraphColor calls under control of a -gen-debug
flag.  Then in a debugger developers can set breakpoints at these calls
to see waht is about to be selected and what the resulting subgraph
looks like.  This really helps when debugging instruction selection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 21:56:29 +00:00
David Greene
c5e7e8d87d Add setSubgraphColor to color an entire portion of a SelectionDAG. This
will be used to support debug features in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 18:17:03 +00:00
David Greene
26b86a0b56 Fix PR2634. Create new virtual registers from spills early so that we
can give it the same stack slot as the spilled interval if it is folded.
This prevents the fold/unfold code from pointing to the wrong register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58255 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 17:38:59 +00:00
Duncan Sands
0dc4045bd2 Fix UpdateNodeOperands so that it does CSE of calls
(and a bunch of other node types).  While there, I
added a doNotCSE predicate and used it to reduce code
duplication (some of the duplicated code was wrong...).
This fixes ARM/cse-libcalls.ll when using LegalizeTypes. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58249 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 15:30:53 +00:00
Duncan Sands
20f04e9fdd Fix a bug in which a node could be added to the
worklist twice: UpdateNodeOperands could morph
a new node into a node already on the worklist.
We would then recalculate the NodeId for this
existing node and add it to the worklist.  The
testcase is ARM/cse-libcalls.ll, the problem
showing up once UpdateNodeOperands is taught to
do CSE for calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 13:18:32 +00:00
Torok Edwin
c83889ad90 Avoid crashing if instruction is not part of a loop.
If it is not part of a loop it is obviously invariant wrt to all loops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58240 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 10:18:45 +00:00
Torok Edwin
3d54502304 export an ID for the instructionNamer, allowing analysis/transformation passes
that need it to require it by ID.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 10:16:27 +00:00
Duncan Sands
7cb07874dc Turn on LegalizeTypes, the new type legalization
codegen infrastructure, by default.  Please report
any breakage to the mailing lists.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58232 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 08:42:46 +00:00
Nick Lewycky
41fe88b26d Fix an obvious copy/pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 07:28:44 +00:00
Evan Cheng
23066288fd For now, don't split live intervals around x87 stack register barriers. FpGET_ST0_80 must be right after a call instruction (and ADJCALLSTACKUP) so we need to find a way to prevent reload of x87 registers between them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 07:14:50 +00:00
Chris Lattner
0fd77a579b Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power of
LargeBlockInfo, we can now dramatically simplify their implementation
and speed them up at the same time.  Now the code has time proportional
to the number of uses of the alloca, not the size of the block.

This also eliminates code that tried to batch up different allocas which
are used in the same blocks, and eliminates the 'retry list' logic which
was baroque and no unneccesary.  In addition to being a speedup for crazy
cases, this is also a nice cleanup:

PromoteMemoryToRegister.cpp |  270 +++++++++++++++-----------------------------
 1 file changed, 96 insertions(+), 174 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 07:05:53 +00:00
Chris Lattner
33210608be Add a new LargeBlockInfo helper, which is just a wrapper around
a trivial dense map.  Use this in RewriteSingleStoreAlloca to
avoid aggressively rescanning blocks over and over again.  This
fixes PR2925, speeding up mem2reg on the testcase in that bug
from 4.56s to 0.02s in a debug build on my machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 06:05:26 +00:00
Dale Johannesen
622addbe49 Increase default setting of tail-merge-threshold to
150, based on llvm-test measurements.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 02:10:21 +00:00
Chris Lattner
f61ca1eeda fix PR2953, an off-by-one error handling formatted i/o.
Thanks to Török Edwin for the awesome reduced testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58199 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-26 19:20:47 +00:00
Evan Cheng
aaf510c932 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-26 07:49:03 +00:00
Bill Wendling
9a20afd700 Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
Patch by Frits van Bommel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58175 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-26 00:19:56 +00:00
Evan Cheng
79d5b5acae Handle cases where there aren't uses in the barrier mbb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 23:49:39 +00:00
Dan Gohman
5d9759bd04 Make comments and code for QuietWarnings and QuietErrors
actually correspond to what their names suggest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 17:57:20 +00:00
Dan Gohman
048ca55dc1 SDNodes may have at most one Flag result. Update this comment
to reflect that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58145 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 17:51:24 +00:00
Dan Gohman
71b7f646de 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 17:46:52 +00:00
Gordon Henriksen
a2cbe6c5b5 Related to PR2911, reject as invalid non-pointer GC roots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 16:28:35 +00:00
Nicolas Geoffray
46fa139e26 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 15:41:43 +00:00
Nicolas Geoffray
b74f370e43 Generate code for TLS instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58141 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 15:22:06 +00:00
Oscar Fuentes
28df32b559 CMake: lib/Target/ARM/AsmPrinter/CMakeLists.txt added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 03:40:32 +00:00
Oscar Fuentes
ddbbb4fe89 CMake: Cross-platform support for using pre-generated llvmAsmParser.cpp and llvmAsmParser.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 03:19:08 +00:00
Evan Cheng
78dfef771b 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 00:52:41 +00:00
Dale Johannesen
f14df02340 Mark MFCR as reading all condition code registers.
Prevents some more overzealous deletions (mostly
in AltiVec code).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 22:08:01 +00:00
Dale Johannesen
c12e5812be 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58116 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 21:24:23 +00:00
Torok Edwin
61df3b751a move the note to the correct README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58104 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 19:23:07 +00:00
Torok Edwin
db1b3bc276 add note about va_arg code on x86 and x86-64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58103 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 19:20:05 +00:00
Evan Cheng
56ab0def90 Fix a pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 18:46:44 +00:00
Duncan Sands
4047f4a0b4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 13:03:10 +00:00
Cedric Venet
389b715e0f 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58090 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 11:24:33 +00:00
Nick Lewycky
04aa2c3520 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
2008-10-24 06:14:27 +00:00