oota-llvm.git
15 years agoadd a note.
Chris Lattner [Sun, 8 Mar 2009 03:04:26 +0000 (03:04 +0000)]
add a note.

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

15 years agoadd a note.
Chris Lattner [Sun, 8 Mar 2009 01:54:43 +0000 (01:54 +0000)]
add a note.

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

15 years agoimplement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4.
Chris Lattner [Sun, 8 Mar 2009 01:51:30 +0000 (01:51 +0000)]
implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4.
For 2009-03-07-FPConstSelect.ll we now produce:

_f:
xorl %eax, %eax
testl %edi, %edi
movl $4, %ecx
cmovne %rax, %rcx
leaq LCPI1_0(%rip), %rax
movss (%rcx,%rax), %xmm0
ret

previously we produced:

_f:
subl $4, %esp
cmpl $0, 8(%esp)
movss LCPI1_0, %xmm0
je LBB1_2 ## entry
LBB1_1: ## entry
movss LCPI1_1, %xmm0
LBB1_2: ## entry
movss %xmm0, (%esp)
flds (%esp)
addl $4, %esp
ret

on PPC the code also improves to:

_f:
cntlzw r2, r3
srwi r2, r2, 5
li r3, lo16(LCPI1_0)
slwi r2, r2, 2
addis r3, r3, ha16(LCPI1_0)
lfsx f1, r3, r2
blr

from:

_f:
li r2, lo16(LCPI1_1)
cmplwi cr0, r3, 0
addis r2, r2, ha16(LCPI1_1)
beq cr0, LBB1_2 ; entry
LBB1_1: ; entry
li r2, lo16(LCPI1_0)
addis r2, r2, ha16(LCPI1_0)
LBB1_2: ; entry
lfs f1, 0(r2)
blr

This also improves the existing pic-cpool case from:

foo:
subl $12, %esp
call .Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
popl %eax
addl $_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
cmpl $0, 16(%esp)
movsd .LCPI1_0@GOTOFF(%eax), %xmm0
je .LBB1_2 # entry
.LBB1_1: # entry
movsd .LCPI1_1@GOTOFF(%eax), %xmm0
.LBB1_2: # entry
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret

to:

foo:
call .Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
popl %eax
addl $_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
xorl %ecx, %ecx
cmpl $0, 4(%esp)
movl $8, %edx
cmovne %ecx, %edx
fldl .LCPI1_0@GOTOFF(%eax,%edx)
ret

This triggers a few dozen times in spec FP 2000.

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

15 years agorandom cleanups.
Chris Lattner [Sun, 8 Mar 2009 01:47:41 +0000 (01:47 +0000)]
random cleanups.

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

15 years agoFix misaligned whitespace. No functionality change.
Nick Lewycky [Sun, 8 Mar 2009 00:57:09 +0000 (00:57 +0000)]
Fix misaligned whitespace. No functionality change.

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

15 years agofix a serious pessimization that Tron on IRC pointed out where we would
Chris Lattner [Sat, 7 Mar 2009 23:32:02 +0000 (23:32 +0000)]
fix a serious pessimization that Tron on IRC pointed out where we would
"boolify" pointers, generating really awful code because getting the pointer
value requires a load itself.  Before:

_foo:
movb $1, _X.b
ret
_get:
xorl %ecx, %ecx
movb _X.b, %al
testb %al, %al
movl $_Y, %eax
cmove %ecx, %eax
ret

With the xform disabled:

_foo:
movl $_Y, _X
ret
_get:
movl _X, %eax
ret

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

15 years agoRevert r66315. Fix the build on mixed 64/32 Linux systems.
Nick Lewycky [Sat, 7 Mar 2009 22:17:05 +0000 (22:17 +0000)]
Revert r66315. Fix the build on mixed 64/32 Linux systems.

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

15 years agoRemove some duplication.
Mikhail Glushenkov [Sat, 7 Mar 2009 20:18:46 +0000 (20:18 +0000)]
Remove some duplication.

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

15 years agoIntroduce new linkage types linkonce_odr, weak_odr, common_odr
Duncan Sands [Sat, 7 Mar 2009 15:45:40 +0000 (15:45 +0000)]
Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

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

15 years agosimplify the way how traits get hold of the symbol table
Gabor Greif [Sat, 7 Mar 2009 12:33:24 +0000 (12:33 +0000)]
simplify the way how traits get hold of the symbol table

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

15 years agofurther simplifications arising from peruse of the more declarative interface
Gabor Greif [Sat, 7 Mar 2009 10:49:57 +0000 (10:49 +0000)]
further simplifications arising from peruse of the more declarative interface

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

15 years agoRemove the burden of dealing with list offsets
Gabor Greif [Sat, 7 Mar 2009 10:00:35 +0000 (10:00 +0000)]
Remove the burden of dealing with list offsets
from SymbolTableListTraits' clients, and
intead request a nice declarative interface.
Cleans up an IMHO ugly wart.

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

15 years agoWhen a crash signal is delivered do two things: remove all of our
Chris Lattner [Sat, 7 Mar 2009 08:15:47 +0000 (08:15 +0000)]
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

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

15 years agoFinish cross-process JIT work, and clean up previous work.
Nate Begeman [Sat, 7 Mar 2009 06:41:19 +0000 (06:41 +0000)]
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.

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

15 years agoArithmetic instructions don't set EFLAGS bits OF and CF bits
Dan Gohman [Sat, 7 Mar 2009 01:58:32 +0000 (01:58 +0000)]
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.

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

15 years agoIf ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes sure...
Evan Cheng [Sat, 7 Mar 2009 01:40:17 +0000 (01:40 +0000)]
If ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes sure the JIT work correctly.

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

15 years agoAdd IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
Daniel Dunbar [Fri, 6 Mar 2009 22:26:07 +0000 (22:26 +0000)]
Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
 - Names are lame, but it seems better to be explicit.

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

15 years agoRename my makefile debugging rule to prevent accidental collisions.
Daniel Dunbar [Fri, 6 Mar 2009 22:23:25 +0000 (22:23 +0000)]
Rename my makefile debugging rule to prevent accidental collisions.

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

15 years agoAdd Module::getNamedValue; use to normalize access to Module symbol
Daniel Dunbar [Fri, 6 Mar 2009 22:04:43 +0000 (22:04 +0000)]
Add Module::getNamedValue; use to normalize access to Module symbol
table.
 - No functionality change.

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

15 years agoFix another case where debug info interferes with
Dale Johannesen [Fri, 6 Mar 2009 21:08:33 +0000 (21:08 +0000)]
Fix another case where debug info interferes with
an optimization.

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

15 years agoAdd default constructor to SDNode to make gcc 3.4.6 happy.
Tanya Lattner [Fri, 6 Mar 2009 18:17:45 +0000 (18:17 +0000)]
Add default constructor to SDNode to make gcc 3.4.6 happy.

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

15 years agoUse c_str() to force the string to be nul-terminated.
Dan Gohman [Fri, 6 Mar 2009 18:13:15 +0000 (18:13 +0000)]
Use c_str() to force the string to be nul-terminated.

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

15 years agoAdd a comment.
Mikhail Glushenkov [Fri, 6 Mar 2009 17:59:58 +0000 (17:59 +0000)]
Add a comment.

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

15 years agosome nits noticed by Duncan
Chris Lattner [Fri, 6 Mar 2009 17:05:04 +0000 (17:05 +0000)]
some nits noticed by Duncan

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

15 years agofix header comment and include guard.
Chris Lattner [Fri, 6 Mar 2009 16:54:19 +0000 (16:54 +0000)]
fix header comment and include guard.

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

15 years agoadd a bunch more passes to the C bindings (PR3734), patch by
Chris Lattner [Fri, 6 Mar 2009 16:52:18 +0000 (16:52 +0000)]
add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!

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

15 years agoTrailing whitespace.
Mikhail Glushenkov [Fri, 6 Mar 2009 12:25:56 +0000 (12:25 +0000)]
Trailing whitespace.

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

15 years agoTrailing whitespace.
Mikhail Glushenkov [Fri, 6 Mar 2009 12:21:40 +0000 (12:21 +0000)]
Trailing whitespace.

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

15 years agoWhile thinking about the one-definition-rule and trying
Duncan Sands [Fri, 6 Mar 2009 10:21:56 +0000 (10:21 +0000)]
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!

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

15 years agoon apple systems, integrate nicely with crash reporter.
Chris Lattner [Fri, 6 Mar 2009 07:19:54 +0000 (07:19 +0000)]
on apple systems, integrate nicely with crash reporter.

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

15 years agoWhile converting an aggregate to scalare, ignore and remove aggregate's debug info.
Devang Patel [Fri, 6 Mar 2009 07:03:54 +0000 (07:03 +0000)]
While converting an aggregate to scalare, ignore and remove aggregate's debug info.

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

15 years agoSprinkle some PrettyStackEntry magic into the passmanager. With this, we now
Chris Lattner [Fri, 6 Mar 2009 06:45:05 +0000 (06:45 +0000)]
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

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

15 years agoRemove this as dbginfo intrinsics has been defined as
Zhou Sheng [Fri, 6 Mar 2009 06:05:01 +0000 (06:05 +0000)]
Remove this as dbginfo intrinsics has been defined as
IntrNoMem.

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

15 years agoWhile hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
Devang Patel [Fri, 6 Mar 2009 06:00:17 +0000 (06:00 +0000)]
While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.

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

15 years agovarious cosmetic cleanups.
Chris Lattner [Fri, 6 Mar 2009 05:53:14 +0000 (05:53 +0000)]
various cosmetic cleanups.

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

15 years agothis wasn't intended to go in.
Chris Lattner [Fri, 6 Mar 2009 05:42:30 +0000 (05:42 +0000)]
this wasn't intended to go in.

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

15 years agoChange various llvm utilities to use PrettyStackTraceProgram in
Chris Lattner [Fri, 6 Mar 2009 05:34:10 +0000 (05:34 +0000)]
Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

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

15 years agoDo not count DbgInfoIntrinsic while estimating loop header size.
Devang Patel [Fri, 6 Mar 2009 03:51:30 +0000 (03:51 +0000)]
Do not count DbgInfoIntrinsic while estimating loop header size.

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

15 years agoSkip DbgInfoIntrinsic.
Devang Patel [Fri, 6 Mar 2009 02:59:27 +0000 (02:59 +0000)]
Skip DbgInfoIntrinsic.

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

15 years agoCommitting unsaved changes that should've been with r66237.
Gordon Henriksen [Fri, 6 Mar 2009 02:42:47 +0000 (02:42 +0000)]
Committing unsaved changes that should've been with r66237.

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

15 years agoFix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodes
Dan Gohman [Fri, 6 Mar 2009 02:23:01 +0000 (02:23 +0000)]
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.

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

15 years agoUse CloneModule's ValueMap to avoid needing to look up
Dan Gohman [Fri, 6 Mar 2009 02:16:23 +0000 (02:16 +0000)]
Use CloneModule's ValueMap to avoid needing to look up
functions by name. This fixes PR718.

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

15 years agoIncorporate feedback to improve GarbageCollection.html.
Gordon Henriksen [Fri, 6 Mar 2009 01:57:32 +0000 (01:57 +0000)]
Incorporate feedback to improve GarbageCollection.html.

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

15 years agoDon't assign rank numbers to debug intrinsic "calls".
Dale Johannesen [Fri, 6 Mar 2009 01:41:59 +0000 (01:41 +0000)]
Don't assign rank numbers to debug intrinsic "calls".
This is needed so debug info doesn't change codegen.

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

15 years agoWhen we split a basic block, there's a default branch to the newly created BB.
Bill Wendling [Fri, 6 Mar 2009 01:41:15 +0000 (01:41 +0000)]
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.

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

15 years agoRevert 66224.
Devang Patel [Fri, 6 Mar 2009 01:39:36 +0000 (01:39 +0000)]
Revert 66224.

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

15 years agoRevert rev. 66167.
Devang Patel [Fri, 6 Mar 2009 01:37:41 +0000 (01:37 +0000)]
Revert rev. 66167.
We are still not out of woods yet.

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

15 years agoCMake: auto-discover project files under the projects/ subdirectory.
Oscar Fuentes [Fri, 6 Mar 2009 01:16:52 +0000 (01:16 +0000)]
CMake: auto-discover project files under the projects/ subdirectory.

Patch by Viktar Zviarovich!

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

15 years agodo not close friendship with every odd class
Gabor Greif [Fri, 6 Mar 2009 01:09:27 +0000 (01:09 +0000)]
do not close friendship with every odd class

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

15 years agoSRThreshold is meant to be inclusive.
Evan Cheng [Fri, 6 Mar 2009 00:56:43 +0000 (00:56 +0000)]
SRThreshold is meant to be inclusive.

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

15 years agoTweak the check for promotable alloca's to handle
Dale Johannesen [Fri, 6 Mar 2009 00:42:50 +0000 (00:42 +0000)]
Tweak the check for promotable alloca's to handle
debug intrinsics correctly.

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

15 years agoDo not let debug info prevert globalopt from shriking a global vars to boolean.
Devang Patel [Fri, 6 Mar 2009 00:21:00 +0000 (00:21 +0000)]
Do not let debug info prevert globalopt from shriking a global vars to boolean.

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

15 years agoAdd "check/remove dbg var" helper routines.
Devang Patel [Fri, 6 Mar 2009 00:19:37 +0000 (00:19 +0000)]
Add "check/remove dbg var" helper routines.

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

15 years agoFix a parallel make race condition by swapping the order of -I directories.
Bob Wilson [Fri, 6 Mar 2009 00:00:58 +0000 (00:00 +0000)]
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.

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

15 years agoFix a bugpoint bug on anonymous functions. Instead of looking up
Dan Gohman [Thu, 5 Mar 2009 23:20:46 +0000 (23:20 +0000)]
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.

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

15 years agoDon't use plain INC32 and DEC32 on x86-64; it needs
Dan Gohman [Thu, 5 Mar 2009 21:32:23 +0000 (21:32 +0000)]
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.

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

15 years agoWhen creating X86ISD::INC and X86ISD::DEC nodes, only add one operand.
Dan Gohman [Thu, 5 Mar 2009 21:29:28 +0000 (21:29 +0000)]
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.

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

15 years agoFix the "test" optimization to recognize "dec" as an add of
Dan Gohman [Thu, 5 Mar 2009 19:32:48 +0000 (19:32 +0000)]
Fix the "test" optimization to recognize "dec" as an add of
negative one, as subtracts of immediates are canonicalized
to adds.

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

15 years agoMake this test more thorough. Not only should there be no %esi,
Dan Gohman [Thu, 5 Mar 2009 19:31:32 +0000 (19:31 +0000)]
Make this test more thorough. Not only should there be no %esi,
there should be no spilling of anything.

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

15 years agoignore build dirs
Gabor Greif [Thu, 5 Mar 2009 19:22:57 +0000 (19:22 +0000)]
ignore build dirs

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

15 years agomove some code to gracefully handle the case when a handler crashes.
Chris Lattner [Thu, 5 Mar 2009 18:22:14 +0000 (18:22 +0000)]
move some code to gracefully handle the case when a handler crashes.

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

15 years agoGlobalOpt only process non constant local GVs while optimizing global vars.
Devang Patel [Thu, 5 Mar 2009 18:12:02 +0000 (18:12 +0000)]
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

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

15 years agoAdd missing file.
Duncan Sands [Thu, 5 Mar 2009 09:19:13 +0000 (09:19 +0000)]
Add missing file.

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

15 years ago(Hopefully) silence a warning.
Owen Anderson [Thu, 5 Mar 2009 08:23:20 +0000 (08:23 +0000)]
(Hopefully) silence a warning.

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

15 years agoRegenerate.
Nick Lewycky [Thu, 5 Mar 2009 08:20:44 +0000 (08:20 +0000)]
Regenerate.

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

15 years agoAutodetect the availability of -export-dynamic in the linker.
Nick Lewycky [Thu, 5 Mar 2009 08:20:21 +0000 (08:20 +0000)]
Autodetect the availability of -export-dynamic in the linker.

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

15 years agoBe more careful about choosing restore points when doing restore folding. This fixes...
Owen Anderson [Thu, 5 Mar 2009 07:19:18 +0000 (07:19 +0000)]
Be more careful about choosing restore points when doing restore folding.  This fixes some subtle miscompilations.

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

15 years agoDaniel wanted the stack printed upside down. Perhaps he
Chris Lattner [Thu, 5 Mar 2009 07:03:49 +0000 (07:03 +0000)]
Daniel wanted the stack printed upside down.  Perhaps he
feels a kinship to machine stacks that grow down.  Now we get
stuff like this:

Stack dump:
0. Program arguments: clang clang_crash_Iw2Osj.mi
1. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: parsing function body '_mm_cvtpi16_ps'
2. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: in compound statement ('{}')
Abort

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

15 years agoindicate what the program args line is.
Chris Lattner [Thu, 5 Mar 2009 06:51:42 +0000 (06:51 +0000)]
indicate what the program args line is.

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

15 years agoswitch this message back to only being in -debug mode.
Chris Lattner [Thu, 5 Mar 2009 06:48:16 +0000 (06:48 +0000)]
switch this message back to only being in -debug mode.

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

15 years agoWhen allocating stubs, keep track of which Functions are referencing the stub.
Nate Begeman [Thu, 5 Mar 2009 06:34:37 +0000 (06:34 +0000)]
When allocating stubs, keep track of which Functions are referencing the stub.
This invalidates the stubs in the resolver map when they are no longer referenced,
and should the JIT memory manager ever pick up a deallocateStub interface, the
JIT could reclaim the memory for unused stubs as well.

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

15 years agoDo not split edges to EH landing pads. It will cause code size explosion.
Evan Cheng [Thu, 5 Mar 2009 06:31:26 +0000 (06:31 +0000)]
Do not split edges to EH landing pads. It will cause code size explosion.

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

15 years agoFix how livein live intervals are handled. Previously it could end at MBB start....
Evan Cheng [Thu, 5 Mar 2009 03:34:26 +0000 (03:34 +0000)]
Fix how livein live intervals are handled. Previously it could end at MBB start. Sorry, no small test case possible.

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

15 years agoFix another case where debug info was affecting
Dale Johannesen [Thu, 5 Mar 2009 02:06:48 +0000 (02:06 +0000)]
Fix another case where debug info was affecting
codegen.  I convinced myself it was OK to skip all
pointer bitcasts here too.

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

15 years agoIgnore the debug info intrinsics when looking for dependency through basic block.
Zhou Sheng [Thu, 5 Mar 2009 01:45:43 +0000 (01:45 +0000)]
Ignore the debug info intrinsics when looking for dependency through basic block.

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

15 years agoAdd comment to emphasize that the while body is empty.
Bill Wendling [Thu, 5 Mar 2009 01:08:35 +0000 (01:08 +0000)]
Add comment to emphasize that the while body is empty.

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

15 years agoFix another case where a dbg.declare meant something
Dale Johannesen [Thu, 5 Mar 2009 00:39:02 +0000 (00:39 +0000)]
Fix another case where a dbg.declare meant something
had 2 uses instead of 1.

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

15 years agoShould have XFAILed this test.
Bill Wendling [Wed, 4 Mar 2009 22:29:34 +0000 (22:29 +0000)]
Should have XFAILed this test.

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

15 years agoTemporarily revert r65994. It was causing rdar://6646455.
Bill Wendling [Wed, 4 Mar 2009 22:02:09 +0000 (22:02 +0000)]
Temporarily revert r65994. It was causing rdar://6646455.

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

15 years agoooops, forgot to include the pointless-write eliminator in my previous checkin
Gabor Greif [Wed, 4 Mar 2009 21:54:31 +0000 (21:54 +0000)]
ooops, forgot to include the pointless-write eliminator in my previous checkin

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

15 years agoAdd some cautionary comments.
Dale Johannesen [Wed, 4 Mar 2009 21:53:29 +0000 (21:53 +0000)]
Add some cautionary comments.

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

15 years agoadd some helper classes for building light-weight symbolic stack traces
Chris Lattner [Wed, 4 Mar 2009 21:40:23 +0000 (21:40 +0000)]
add some helper classes for building light-weight symbolic stack traces
that get printed when a program crashes.  This is the first step of many.

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

15 years agoRe-commit 65975 and a fix for the problem that
Dale Johannesen [Wed, 4 Mar 2009 21:24:04 +0000 (21:24 +0000)]
Re-commit 65975 and a fix for the problem that
was causing llvm-gcc to fail to build.  I've
verified it bootstraps now; good enough for me.

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

15 years agoAdd a new 'AddSignalHandler' function to Signals.h that allows
Chris Lattner [Wed, 4 Mar 2009 21:21:36 +0000 (21:21 +0000)]
Add a new 'AddSignalHandler' function to Signals.h that allows
arbitrary functions to be run when a crash happens.  Delete
RemoveDirectoryOnSignal as it is dead and has never had clients.

Change PrintStackTraceOnErrorSignal to be implemented in terms of
AddSignalHandler.

I updated the Win32 versions of these APIs, but can't test them.
If there are any problems, I'd be happy to fix them as well.

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

15 years agoFix this comment.
Dan Gohman [Wed, 4 Mar 2009 20:50:23 +0000 (20:50 +0000)]
Fix this comment.

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

15 years agoAdd an assertion for a condition that's always true, and not
Dan Gohman [Wed, 4 Mar 2009 20:49:01 +0000 (20:49 +0000)]
Add an assertion for a condition that's always true, and not
immediately obvious.

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

15 years agoGive sentinel traits the right to determine the policy where the sentinel is kept.
Gabor Greif [Wed, 4 Mar 2009 20:36:44 +0000 (20:36 +0000)]
Give sentinel traits the right to determine the policy where the sentinel is kept.
This should result in less indirect memory accesses, less dead writes and tighter code.

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

15 years agoRe-apply 66008, now that the unfoldMemoryOperand bug is fixed.
Dan Gohman [Wed, 4 Mar 2009 19:44:21 +0000 (19:44 +0000)]
Re-apply 66008, now that the unfoldMemoryOperand bug is fixed.

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

15 years agoCorrect this comment.
Dan Gohman [Wed, 4 Mar 2009 19:24:25 +0000 (19:24 +0000)]
Correct this comment.

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

15 years agoWhen using MachineInstr operand indices on SDNodes, the number
Dan Gohman [Wed, 4 Mar 2009 19:23:38 +0000 (19:23 +0000)]
When using MachineInstr operand indices on SDNodes, the number
of MachineInstr def operands must be subtracted out. This bug
was uncovered by the recent x86 EFLAGS optimization. Before
that, the only instructions that ever needed unfolding were
things like CMP32rm, where NumDefs is zero.

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

15 years agocomplete comment.
Chris Lattner [Wed, 4 Mar 2009 19:23:25 +0000 (19:23 +0000)]
complete comment.

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

15 years agothis wasn't intended to be committed.
Chris Lattner [Wed, 4 Mar 2009 19:22:30 +0000 (19:22 +0000)]
this wasn't intended to be committed.

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

15 years agoFix PR3720 by properly propagating alignment information from memcpy/memmove
Chris Lattner [Wed, 4 Mar 2009 19:20:50 +0000 (19:20 +0000)]
Fix PR3720 by properly propagating alignment information from memcpy/memmove
onto element accesses.

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

15 years agoFix a thinko in the JIT where the address of a GV was only recorded in the map
Nate Begeman [Wed, 4 Mar 2009 19:10:38 +0000 (19:10 +0000)]
Fix a thinko in the JIT where the address of a GV was only recorded in the map
  on failure to resolve it.
Do not abort on failure to resolve an external symbol when using dlsym stubs,
  since the symbol may not be in the JIT's address space.  Just use 0.
Allow dlsym stubs to differentiate between GlobalVars and Functions.

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

15 years agoFix BuildVectorSDNode::isConstantSplat to handle one-element vectors.
Bob Wilson [Wed, 4 Mar 2009 17:47:01 +0000 (17:47 +0000)]
Fix BuildVectorSDNode::isConstantSplat to handle one-element vectors.
It is an error to call APInt::zext with a size that is equal to the value's
current size, so use zextOrTrunc instead.

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

15 years ago.emacs file bits for automatically setting the llvm.org coding style. Thanks Anton.
Mike Stump [Wed, 4 Mar 2009 14:14:37 +0000 (14:14 +0000)]
.emacs file bits for automatically setting the llvm.org coding style.  Thanks Anton.

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

15 years agoAdd a restore folder, which shaves a dozen or so machineinstrs off oggenc. Update...
Owen Anderson [Wed, 4 Mar 2009 08:52:31 +0000 (08:52 +0000)]
Add a restore folder, which shaves a dozen or so machineinstrs off oggenc.  Update a testcase to check this.

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

15 years ago"Ghostify" embedded sentinels. This is a real win in all cases
Gabor Greif [Wed, 4 Mar 2009 06:57:48 +0000 (06:57 +0000)]
"Ghostify" embedded sentinels. This is a real win in all cases
because less bytes are allocated and subobject construction is gone.
For reference how it works, see BasicBlock.h.
Btw. it is very assuring to see that somebody has invented
this ilist-embedded sentinel technique before me :-)

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

15 years agoFix PR3666: isel calls to constant addresses.
Evan Cheng [Wed, 4 Mar 2009 06:48:53 +0000 (06:48 +0000)]
Fix PR3666: isel calls to constant addresses.

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

15 years agoPR3686: make the legalizer handle bitcast from i80 to x86 long double.
Eli Friedman [Wed, 4 Mar 2009 06:23:34 +0000 (06:23 +0000)]
PR3686: make the legalizer handle bitcast from i80 to x86 long double.

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