Commit Graph

45100 Commits

Author SHA1 Message Date
Gabor Greif 5cd1b25822 Remove the burden of dealing with list offsets
from SymbolTableListTraits' clients, and
intead request a nice declarative interface.
Cleans up an IMHO ugly wart.

llvm-svn: 66331
2009-03-07 10:00:35 +00:00
Chris Lattner 6acb4d6f7e When a crash signal is delivered do two things: remove all of our
signal handlers to prevent reentrance on unrelated things (a sigabort
where the handle bus errors) also, clear the signal mask so that the
signal doesn't infinitely reissue.  This fixes rdar://6654827 -
Crash causes clang to loop

llvm-svn: 66330
2009-03-07 08:15:47 +00:00
Nate Begeman 52b696c7ad Finish cross-process JIT work, and clean up previous work.
1. When the JIT is asked to remove a function, updating it's
   mapping to 0, we invalidate any function stubs used only 
   by that function.  Now, also invalidate the JIT's mapping
   from the GV the stub pointed to, to the address of the GV.

2. When dlsym stubs for cross-process JIT are enabled, do not
   abort just because a named function cannot be found in the
   JIT's process.

3. Fix various assumptions about when it is ok to use the lazy
   resolver when non-lazy JITing is enabled.

llvm-svn: 66324
2009-03-07 06:41:19 +00:00
Dan Gohman ff659b5b86 Arithmetic instructions don't set EFLAGS bits OF and CF bits
the same say the "test" instruction does in overflow cases,
so eliminating the test is only safe when those bits aren't
needed, as is the case for COND_E and COND_NE, or if it
can be proven that no overflow will occur. For now, just
restrict the optimization to COND_E and COND_NE and don't
do any overflow analysis.

llvm-svn: 66318
2009-03-07 01:58:32 +00:00
Evan Cheng 9153f08c74 If ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes sure the JIT work correctly.
llvm-svn: 66315
2009-03-07 01:40:17 +00:00
Daniel Dunbar d39e0974fe Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
- Names are lame, but it seems better to be explicit.

llvm-svn: 66295
2009-03-06 22:26:07 +00:00
Daniel Dunbar 3b3c3f02cc Rename my makefile debugging rule to prevent accidental collisions.
llvm-svn: 66294
2009-03-06 22:23:25 +00:00
Daniel Dunbar dcf8d3c9eb Add Module::getNamedValue; use to normalize access to Module symbol
table.
 - No functionality change.

llvm-svn: 66289
2009-03-06 22:04:43 +00:00
Dale Johannesen 6e447e08ee Fix another case where debug info interferes with
an optimization.

llvm-svn: 66288
2009-03-06 21:08:33 +00:00
Tanya Lattner 8498d2dd2b Add default constructor to SDNode to make gcc 3.4.6 happy.
llvm-svn: 66280
2009-03-06 18:17:45 +00:00
Dan Gohman ec5f2b5e05 Use c_str() to force the string to be nul-terminated.
llvm-svn: 66279
2009-03-06 18:13:15 +00:00
Mikhail Glushenkov 211f3c0f97 Add a comment.
llvm-svn: 66278
2009-03-06 17:59:58 +00:00
Chris Lattner 040ce02174 some nits noticed by Duncan
llvm-svn: 66274
2009-03-06 17:05:04 +00:00
Chris Lattner a59518276e fix header comment and include guard.
llvm-svn: 66273
2009-03-06 16:54:19 +00:00
Chris Lattner e48f897ca7 add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!

llvm-svn: 66272
2009-03-06 16:52:18 +00:00
Mikhail Glushenkov 0658cac532 Trailing whitespace.
llvm-svn: 66269
2009-03-06 12:25:56 +00:00
Mikhail Glushenkov 6a64f907c6 Trailing whitespace.
llvm-svn: 66268
2009-03-06 12:21:40 +00:00
Duncan Sands ed7228319a While thinking about the one-definition-rule and trying
to find a tiny mouse hole to squeeze through, it struck
me that globals without a name can be considered internal
since they can't be referenced from outside the current
module.  This patch makes GlobalOpt give them internal
linkage.  Also done for aliases even though they always
have names, since in my opinion anonymous aliases should
be allowed for consistency with global variables and
functions.  So if that happens one day, this code is ready!

llvm-svn: 66267
2009-03-06 10:21:56 +00:00
Chris Lattner e41a434f89 on apple systems, integrate nicely with crash reporter.
llvm-svn: 66264
2009-03-06 07:19:54 +00:00
Devang Patel 25b625165f While converting an aggregate to scalare, ignore and remove aggregate's debug info.
llvm-svn: 66262
2009-03-06 07:03:54 +00:00
Chris Lattner 4c1e9541d3 Sprinkle some PrettyStackEntry magic into the passmanager. With this, we now
get nice and happy stack traces when we crash in an optimizer or codegen.  For
example, an abort put in UnswitchLoops now looks like this:

Stack dump:
0.	Program arguments: clang pr3399.c -S -O3 
1.	<eof> parser at end of file
2.	per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'pr3399.c'.
4.	Running pass 'Loop Pass Manager' on function '@foo'
5.	Running pass 'Unswitch loops' on basic block '%for.inc'
Abort

llvm-svn: 66260
2009-03-06 06:45:05 +00:00
Zhou Sheng c8e5085cd3 Remove this as dbginfo intrinsics has been defined as
IntrNoMem.

llvm-svn: 66256
2009-03-06 06:05:01 +00:00
Devang Patel 5aed7765b8 While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
llvm-svn: 66255
2009-03-06 06:00:17 +00:00
Chris Lattner 609873608e various cosmetic cleanups.
llvm-svn: 66254
2009-03-06 05:53:14 +00:00
Chris Lattner e6d1e8d0cc this wasn't intended to go in.
llvm-svn: 66252
2009-03-06 05:42:30 +00:00
Chris Lattner e3fc2d13be Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Devang Patel bab43b4c91 Do not count DbgInfoIntrinsic while estimating loop header size.
llvm-svn: 66245
2009-03-06 03:51:30 +00:00
Devang Patel e8c6d3102d Skip DbgInfoIntrinsic.
llvm-svn: 66244
2009-03-06 02:59:27 +00:00
Gordon Henriksen 1424861a62 Committing unsaved changes that should've been with r66237.
llvm-svn: 66242
2009-03-06 02:42:47 +00:00
Dan Gohman 15af5524a4 Fix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodes
with multiple chain operands. This can occur when the scheduler
has added chain operands to a node that already has a chain
operand, in order to handle physical register dependencies.

This fixes an llvm-gcc bootstrap failure on x86-64 introduced
in r66058.

llvm-svn: 66240
2009-03-06 02:23:01 +00:00
Dan Gohman bcad718f73 Use CloneModule's ValueMap to avoid needing to look up
functions by name. This fixes PR718.

llvm-svn: 66239
2009-03-06 02:16:23 +00:00
Gordon Henriksen 3519d5d828 Incorporate feedback to improve GarbageCollection.html.
llvm-svn: 66237
2009-03-06 01:57:32 +00:00
Dale Johannesen fb1caf3e1f Don't assign rank numbers to debug intrinsic "calls".
This is needed so debug info doesn't change codegen.

llvm-svn: 66235
2009-03-06 01:41:59 +00:00
Bill Wendling 6d8472b9cc When we split a basic block, there's a default branch to the newly created BB.
Delete this default branch, because we're going to generate our own.

llvm-svn: 66234
2009-03-06 01:41:15 +00:00
Devang Patel fc507a1f9c Revert 66224.
llvm-svn: 66233
2009-03-06 01:39:36 +00:00
Devang Patel d926aaa28f Revert rev. 66167.
We are still not out of woods yet.

llvm-svn: 66232
2009-03-06 01:37:41 +00:00
Oscar Fuentes afbe97542f CMake: auto-discover project files under the projects/ subdirectory.
Patch by Viktar Zviarovich!

llvm-svn: 66230
2009-03-06 01:16:52 +00:00
Gabor Greif b3805878d1 do not close friendship with every odd class
llvm-svn: 66229
2009-03-06 01:09:27 +00:00
Evan Cheng 5fd4fc76bf SRThreshold is meant to be inclusive.
llvm-svn: 66227
2009-03-06 00:56:43 +00:00
Dale Johannesen 073ab5acab Tweak the check for promotable alloca's to handle
debug intrinsics correctly.

llvm-svn: 66225
2009-03-06 00:42:50 +00:00
Devang Patel ab16577ade Do not let debug info prevert globalopt from shriking a global vars to boolean.
llvm-svn: 66224
2009-03-06 00:21:00 +00:00
Devang Patel 0c970f94e9 Add "check/remove dbg var" helper routines.
llvm-svn: 66223
2009-03-06 00:19:37 +00:00
Bob Wilson 8932717421 Fix a parallel make race condition by swapping the order of -I directories.
The .cmi files are generated in $(ObjDir) and then copied to $(OcamlDir).
The ocamldep output references the .cmi files in $(ObjDir), so make kicks
off a dependent compile as soon as the local copy is generated.  If the
copy to $(OcamlDir) is not complete at that point, the compiler will read
the partially copied file and complain about a "Corrupted compiled
interface".  Searching $(ObjDir) first avoids this.

llvm-svn: 66217
2009-03-06 00:00:58 +00:00
Dan Gohman 4f42ac8400 Fix a bugpoint bug on anonymous functions. Instead of looking up
functions in the new module by name, use the ValueMap provided by
CloneModule to do the lookups.

llvm-svn: 66216
2009-03-05 23:20:46 +00:00
Dan Gohman c719d73eec Don't use plain INC32 and DEC32 on x86-64; it needs
INC64_32r and INC64_16r, because these instructions are encoded
differently on x86-64. This fixes JIT regressions on x86-64 in
kimwitu++ and others.

llvm-svn: 66207
2009-03-05 21:32:23 +00:00
Dan Gohman e014b193c9 When creating X86ISD::INC and X86ISD::DEC nodes, only add one operand.
The extra operand didn't appear to cause any trouble, but it was
erroneous regardless.

llvm-svn: 66206
2009-03-05 21:29:28 +00:00
Dan Gohman 2c2f192c74 Fix the "test" optimization to recognize "dec" as an add of
negative one, as subtracts of immediates are canonicalized
to adds.

llvm-svn: 66180
2009-03-05 19:32:48 +00:00
Dan Gohman 14cc4a458e Make this test more thorough. Not only should there be no %esi,
there should be no spilling of anything.

llvm-svn: 66179
2009-03-05 19:31:32 +00:00
Chris Lattner bbbbbf30bd move some code to gracefully handle the case when a handler crashes.
llvm-svn: 66171
2009-03-05 18:22:14 +00:00
Devang Patel 709d6ac46d GlobalOpt only process non constant local GVs while optimizing global vars.
If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B.

In other words, debug info should not interfere in removal of unused GV.
--This life, and those below, will be ignored--

M    test/Transforms/GlobalOpt/2009-03-03-dbg.ll
M    lib/Transforms/IPO/GlobalOpt.cpp

llvm-svn: 66167
2009-03-05 18:12:02 +00:00