oota-llvm.git
16 years agomove Node Transformation printing from CodeGenDAGPatterns -> DAGISelEmitter.
Chris Lattner [Sat, 5 Jan 2008 22:54:53 +0000 (22:54 +0000)]
move Node Transformation printing from CodeGenDAGPatterns -> DAGISelEmitter.
The only difference in output is that we now print them in alphabetical
order instead of reverse alphabetical order.

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

16 years agomove predicate printing code from CodeGenDAGPatterns -> DAGISelEmitter.
Chris Lattner [Sat, 5 Jan 2008 22:43:57 +0000 (22:43 +0000)]
move predicate printing code from CodeGenDAGPatterns -> DAGISelEmitter.

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

16 years agofix a fixme by improving const correctness.
Chris Lattner [Sat, 5 Jan 2008 22:30:17 +0000 (22:30 +0000)]
fix a fixme by improving const correctness.

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

16 years agochange getQualifiedName to be a global function.
Chris Lattner [Sat, 5 Jan 2008 22:25:12 +0000 (22:25 +0000)]
change getQualifiedName to be a global function.
Split the pattern parsing code out from the dag isel emitter into it's own file.

No functionality change.

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

16 years agoRemove an incorrect optimization that is performed correctly by
Nate Begeman [Sat, 5 Jan 2008 20:51:30 +0000 (20:51 +0000)]
Remove an incorrect optimization that is performed correctly by
the target independent legalizer.

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

16 years agoIf custom lowering of insert element fails, the result Val will be 0.
Nate Begeman [Sat, 5 Jan 2008 20:47:37 +0000 (20:47 +0000)]
If custom lowering of insert element fails, the result Val will be 0.
Don't overwrite a variable used by the fallthrough code path in this
case.

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

16 years agoFix build issue on certain compilers.
Chris Lattner [Sat, 5 Jan 2008 20:15:42 +0000 (20:15 +0000)]
Fix build issue on certain compilers.

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

16 years agoRefactoring the x86 and x86-64 calling convention implementations,
Gordon Henriksen [Sat, 5 Jan 2008 16:56:59 +0000 (16:56 +0000)]
Refactoring the x86 and x86-64 calling convention implementations,
unifying the copied algorithms and saving over 500 LOC. There should
be no functionality change, but please test on your favorite x86
target.

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

16 years agoChris and Evan noticed that this check was compleatly fubared. I was
Bill Wendling [Sat, 5 Jan 2008 09:18:04 +0000 (09:18 +0000)]
Chris and Evan noticed that this check was compleatly fubared. I was
checking that there was a from a global instead of a load from the stub
for a global, which is the one that's safe to hoist.

Consider this program:

volatile char G[100];
int B(char *F, int N) {
  for (; N > 0; --N)
    F[N] = G[N];
}

In static mode, we shouldn't be hoisting the load from G:

$ llc -relocation-model=static -o - a.bc -march=x86 -machine-licm

LBB1_1: # bb.preheader
        leal    -1(%eax), %edx
        testl   %edx, %edx
        movl    $1, %edx
        cmovns  %eax, %edx
        xorl    %esi, %esi
LBB1_2: # bb
        movb    _G(%eax), %bl
        movb    %bl, (%ecx,%eax)

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

16 years agoThe current impl is really trivial, add some comments about how it can be made better.
Chris Lattner [Sat, 5 Jan 2008 06:47:58 +0000 (06:47 +0000)]
The current impl is really trivial, add some comments about how it can be made better.

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

16 years agoallow sinking to be enabled for the jit
Chris Lattner [Sat, 5 Jan 2008 06:14:16 +0000 (06:14 +0000)]
allow sinking to be enabled for the jit

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

16 years agoenable sinking and licm of loads from the argument area. I'd like to enable this
Chris Lattner [Sat, 5 Jan 2008 06:10:42 +0000 (06:10 +0000)]
enable sinking and licm of loads from the argument area.  I'd like to enable this
for remat, but can't due to an RA bug.

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

16 years agosimplify some code by using shorter accessors.
Chris Lattner [Sat, 5 Jan 2008 05:28:30 +0000 (05:28 +0000)]
simplify some code by using shorter accessors.

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

16 years agorevert my previous patch.
Chris Lattner [Sat, 5 Jan 2008 05:26:26 +0000 (05:26 +0000)]
revert my previous patch.

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

16 years agofactor some code better to avoid redundancy between
Chris Lattner [Sat, 5 Jan 2008 05:19:56 +0000 (05:19 +0000)]
factor some code better to avoid redundancy between
isReallySideEffectFree and isReallyTriviallyReMaterializable.  Why is a load from
a global considered side-effect-free but not rematable?

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

16 years agogetting the pic base has no side effects.
Chris Lattner [Sat, 5 Jan 2008 03:54:32 +0000 (03:54 +0000)]
getting the pic base has no side effects.

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

16 years agodon't sink anything with side effects, this makes lots of stuff work, but sinks almos...
Chris Lattner [Sat, 5 Jan 2008 02:33:22 +0000 (02:33 +0000)]
don't sink anything with side effects, this makes lots of stuff work, but sinks almost nothing.

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

16 years agoX86 JIT PIC jumptable support.
Evan Cheng [Sat, 5 Jan 2008 02:26:58 +0000 (02:26 +0000)]
X86 JIT PIC jumptable support.

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

16 years agofix a common crash.
Chris Lattner [Sat, 5 Jan 2008 01:39:17 +0000 (01:39 +0000)]
fix a common crash.

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

16 years agoremove a couple more unsafe xforms in the face of overflow.
Chris Lattner [Sat, 5 Jan 2008 01:22:42 +0000 (01:22 +0000)]
remove a couple more unsafe xforms in the face of overflow.

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

16 years agoremove the (x-y) < 0 comparison xform, it miscompiles
Chris Lattner [Sat, 5 Jan 2008 01:18:20 +0000 (01:18 +0000)]
remove the (x-y) < 0 comparison xform, it miscompiles
things that are not equality comparisons, for example:
   (2147479553+4096)-2147479553 < 0    !=   (2147479553+4096) < 2147479553

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

16 years agoI should not be allowed to commit when sleepy.
Owen Anderson [Sat, 5 Jan 2008 00:48:55 +0000 (00:48 +0000)]
I should not be allowed to commit when sleepy.

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

16 years agoDidn't mean to commit this.
Owen Anderson [Sat, 5 Jan 2008 00:43:37 +0000 (00:43 +0000)]
Didn't mean to commit this.

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

16 years agoDidn't mean to commit this.
Owen Anderson [Sat, 5 Jan 2008 00:42:45 +0000 (00:42 +0000)]
Didn't mean to commit this.

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

16 years agoCombine MovePCtoStack + POP32r into one instruction MOVPC32r so it can be moved if...
Evan Cheng [Sat, 5 Jan 2008 00:41:47 +0000 (00:41 +0000)]
Combine MovePCtoStack + POP32r into one instruction MOVPC32r so it can be moved if needed.

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

16 years agoMove some more functionality from MRegisterInfo to TargetInstrInfo.
Owen Anderson [Fri, 4 Jan 2008 23:57:37 +0000 (23:57 +0000)]
Move some more functionality from MRegisterInfo to TargetInstrInfo.

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

16 years agoDon't recalculate the loop info and loop dominators analyses if they're
Bill Wendling [Fri, 4 Jan 2008 20:54:55 +0000 (20:54 +0000)]
Don't recalculate the loop info and loop dominators analyses if they're
preserved.

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

16 years agofix typo
Wojciech Matyjewicz [Fri, 4 Jan 2008 20:04:08 +0000 (20:04 +0000)]
fix typo

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

16 years agofix typo
Wojciech Matyjewicz [Fri, 4 Jan 2008 20:02:18 +0000 (20:02 +0000)]
fix typo

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

16 years agoTestcase with non-integer "bitfields" (in quotes,
Duncan Sands [Fri, 4 Jan 2008 17:31:56 +0000 (17:31 +0000)]
Testcase with non-integer "bitfields" (in quotes,
since they didn't actually need to be bitfields,
though they are marked as such).

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

16 years agoFix a typo in llvm.mli noticed by Alain Frisch.
Gordon Henriksen [Fri, 4 Jan 2008 13:21:02 +0000 (13:21 +0000)]
Fix a typo in llvm.mli noticed by Alain Frisch.

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

16 years agoTestcase for PR1386.
Duncan Sands [Fri, 4 Jan 2008 13:15:39 +0000 (13:15 +0000)]
Testcase for PR1386.

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

16 years agodoc_code-ify some code in this doc.
Bill Wendling [Fri, 4 Jan 2008 12:04:32 +0000 (12:04 +0000)]
doc_code-ify some code in this doc.

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

16 years agoQuote a path in the Ocaml makefile which is likely to include spaces on Windows.
Gordon Henriksen [Fri, 4 Jan 2008 11:55:57 +0000 (11:55 +0000)]
Quote a path in the Ocaml makefile which is likely to include spaces on Windows.

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

16 years agoUnbreak tailcall opt in JIT.
Evan Cheng [Fri, 4 Jan 2008 10:50:28 +0000 (10:50 +0000)]
Unbreak tailcall opt in JIT.

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

16 years agoX86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support.
Evan Cheng [Fri, 4 Jan 2008 10:46:51 +0000 (10:46 +0000)]
X86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support.

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

16 years ago80-column violations.
Bill Wendling [Fri, 4 Jan 2008 08:59:18 +0000 (08:59 +0000)]
80-column violations.

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

16 years agoAdd that this preserves some analyses.
Bill Wendling [Fri, 4 Jan 2008 08:48:49 +0000 (08:48 +0000)]
Add that this preserves some analyses.

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

16 years agoMove option to enable machine LICM into LLVMTargetMachine.cpp.
Bill Wendling [Fri, 4 Jan 2008 08:11:03 +0000 (08:11 +0000)]
Move option to enable machine LICM into LLVMTargetMachine.cpp.

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

16 years agoCall the parent's getAnalysisUsage.
Bill Wendling [Fri, 4 Jan 2008 07:50:05 +0000 (07:50 +0000)]
Call the parent's getAnalysisUsage.

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

16 years agoAdd a really quick hack at a machine code sinking pass, enabled with --enable-sinking.
Chris Lattner [Fri, 4 Jan 2008 07:36:53 +0000 (07:36 +0000)]
Add a really quick hack at a machine code sinking pass, enabled with --enable-sinking.
It is missing validity checks, so it is known broken.  However, it is powerful enough
to compile this contrived code:

void test1(int C, double A, double B, double *P) {
  double Tmp = A*A+B*B;
  *P = C ? Tmp : A;
}

into:

_test1:
movsd 8(%esp), %xmm0
cmpl $0, 4(%esp)
je LBB1_2 # entry
LBB1_1: # entry
movsd 16(%esp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
LBB1_2: # entry
movl 24(%esp), %eax
movsd %xmm0, (%eax)
ret

instead of:

_test1:
movsd 16(%esp), %xmm0
mulsd %xmm0, %xmm0
movsd 8(%esp), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
cmpl $0, 4(%esp)
je LBB1_2 # entry
LBB1_1: # entry
movapd %xmm2, %xmm1
LBB1_2: # entry
movl 24(%esp), %eax
movsd %xmm1, (%eax)
ret

woo.

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

16 years agoremove dead #includes and reorder the rest.
Chris Lattner [Fri, 4 Jan 2008 06:41:45 +0000 (06:41 +0000)]
remove dead #includes and reorder the rest.

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

16 years agoFix PR1896
Chris Lattner [Fri, 4 Jan 2008 05:04:53 +0000 (05:04 +0000)]
Fix PR1896

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

16 years agoChange the builtin matcher to emit a decision tree, which should help out
Chris Lattner [Fri, 4 Jan 2008 04:38:35 +0000 (04:38 +0000)]
Change the builtin matcher to emit a decision tree, which should help out
the VC++ 'nesting depth' issue.

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

16 years agofix nesting issues.
Chris Lattner [Fri, 4 Jan 2008 04:34:14 +0000 (04:34 +0000)]
fix nesting issues.

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

16 years agofix validation issues.
Chris Lattner [Fri, 4 Jan 2008 04:33:49 +0000 (04:33 +0000)]
fix validation issues.

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

16 years agoimprove the description of types, patch by Alain Frisch
Chris Lattner [Fri, 4 Jan 2008 04:32:38 +0000 (04:32 +0000)]
improve the description of types, patch by Alain Frisch

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

16 years agoDon't let IntrinsicID be uninitialized if it doesn't match.
Chris Lattner [Fri, 4 Jan 2008 03:32:52 +0000 (03:32 +0000)]
Don't let IntrinsicID be uninitialized if it doesn't match.

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

16 years agoCorrect order of parameters.
Evan Cheng [Fri, 4 Jan 2008 02:22:21 +0000 (02:22 +0000)]
Correct order of parameters.

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

16 years agoRemove the default else. This was ending in code that looked like this:
Bill Wendling [Thu, 3 Jan 2008 23:02:16 +0000 (23:02 +0000)]
Remove the default else. This was ending in code that looked like this:

if (!strcmp(Target, "x86")) {
  // ...
}
else
  IntrinsicID = Intrinsic::not_intrinsic;

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

16 years agoRemove symbols that don't exist, remove tabs, fix comment typo
Chris Lattner [Thu, 3 Jan 2008 22:15:32 +0000 (22:15 +0000)]
Remove symbols that don't exist, remove tabs, fix comment typo

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

16 years agoAdding new files to win32 build
Chuck Rose III [Thu, 3 Jan 2008 19:53:03 +0000 (19:53 +0000)]
Adding new files to win32 build

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

16 years agoIgnoring output files.
Gordon Henriksen [Thu, 3 Jan 2008 17:42:08 +0000 (17:42 +0000)]
Ignoring output files.

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

16 years agoadd info on walking preds/succs of a block.
Chris Lattner [Thu, 3 Jan 2008 16:56:04 +0000 (16:56 +0000)]
add info on walking preds/succs of a block.

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

16 years agoFirst steps in in X86 calling convention cleanup.
Gordon Henriksen [Thu, 3 Jan 2008 16:47:34 +0000 (16:47 +0000)]
First steps in in X86 calling convention cleanup.

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

16 years agoTest for handling of large bit offset from a
Duncan Sands [Thu, 3 Jan 2008 11:53:52 +0000 (11:53 +0000)]
Test for handling of large bit offset from a
variable field offset.

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

16 years agodon't hoist FP additions into unconditional adds + selects. This
Chris Lattner [Thu, 3 Jan 2008 07:25:26 +0000 (07:25 +0000)]
don't hoist FP additions into unconditional adds + selects.  This
could theoretically introduce a trap, but is also a performance issue.
This speeds up ptrdist/ks by 8%.

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

16 years agoFix PR1873, a problem finding stat-related symbols on linux, due to
Chris Lattner [Thu, 3 Jan 2008 07:10:51 +0000 (07:10 +0000)]
Fix PR1873, a problem finding stat-related symbols on linux, due to
"libc_nonshared.a". Patch by Edwin Török!

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

16 years agoTrying that again.
Gordon Henriksen [Thu, 3 Jan 2008 03:32:33 +0000 (03:32 +0000)]
Trying that again.

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

16 years agoFix a compile error on Windows.
Gordon Henriksen [Thu, 3 Jan 2008 03:21:18 +0000 (03:21 +0000)]
Fix a compile error on Windows.

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

16 years agoChange MachineRelocation::DoesntNeedFnStub to NeedStub. This fields will be used
Evan Cheng [Thu, 3 Jan 2008 02:56:28 +0000 (02:56 +0000)]
Change MachineRelocation::DoesntNeedFnStub to NeedStub. This fields will be used
for non-function GV relocations that require function address stubs (e.g. Mac OS X in non-static mode).

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

16 years agodon't access element zero of an array of size zero.
Chris Lattner [Thu, 3 Jan 2008 01:25:31 +0000 (01:25 +0000)]
don't access element zero of an array of size zero.

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

16 years agoRemove the function attr cache for intrinsics. This does not maintain the
Chris Lattner [Thu, 3 Jan 2008 01:20:12 +0000 (01:20 +0000)]
Remove the function attr cache for intrinsics.  This does not maintain the
refcount on these correctly, and can end up referring to deleted
attributes.  This fixes PR1881.

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

16 years agoDon't create a new ParamAttrsList (which copies the vector) just to
Chris Lattner [Thu, 3 Jan 2008 00:29:27 +0000 (00:29 +0000)]
Don't create a new ParamAttrsList (which copies the vector) just to
get a profile.

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

16 years agoAn example for which the TYPE_SIZE was being set from
Duncan Sands [Thu, 3 Jan 2008 00:26:42 +0000 (00:26 +0000)]
An example for which the TYPE_SIZE was being set from
the initial value, while the type fields were not (this
is a qualified union type, so not all fields are always
present).  This resulted in the size of the corresponding
LLVM type being larger than the gcc TYPE_SIZE.

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

16 years agoTest handling of records for which the fields are
Duncan Sands [Thu, 3 Jan 2008 00:17:02 +0000 (00:17 +0000)]
Test handling of records for which the fields are
not ordered by offset.

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

16 years agomove some code out of line, rearrange a bit.
Chris Lattner [Thu, 3 Jan 2008 00:10:22 +0000 (00:10 +0000)]
move some code out of line, rearrange a bit.

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

16 years agoDisallow copying explicitly.
Chris Lattner [Thu, 3 Jan 2008 00:09:47 +0000 (00:09 +0000)]
Disallow copying explicitly.

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

16 years agoSplit param attr implementation out from Function.cpp into its
Chris Lattner [Wed, 2 Jan 2008 23:42:30 +0000 (23:42 +0000)]
Split param attr implementation out from Function.cpp into its
own file.  Don't #include ParameterAttributes.h into any major
public header files: just move methods out of line as appropriate.

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

16 years agoadd missing #include
Chris Lattner [Wed, 2 Jan 2008 23:41:05 +0000 (23:41 +0000)]
add missing #include

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

16 years agoX86 PIC JIT bug fix: relocations for constantpool and jumptable.
Evan Cheng [Wed, 2 Jan 2008 23:38:59 +0000 (23:38 +0000)]
X86 PIC JIT bug fix: relocations for constantpool and jumptable.

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

16 years agoremove blob of #if'd out code.
Chris Lattner [Wed, 2 Jan 2008 23:10:45 +0000 (23:10 +0000)]
remove blob of #if'd out code.

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

16 years agofix this to use a valid triple.
Chris Lattner [Wed, 2 Jan 2008 22:21:45 +0000 (22:21 +0000)]
fix this to use a valid triple.

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

16 years agoInverted argument order for ImmutableMap::Profile.
Ted Kremenek [Wed, 2 Jan 2008 22:18:33 +0000 (22:18 +0000)]
Inverted argument order for ImmutableMap::Profile.

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

16 years agoFix a build issue on cygwin
Chris Lattner [Wed, 2 Jan 2008 22:03:27 +0000 (22:03 +0000)]
Fix a build issue on cygwin

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

16 years agoAdded iterator and profiling (i.e. FoldingSetNodeID) support to ImmutableMap.
Ted Kremenek [Wed, 2 Jan 2008 21:31:48 +0000 (21:31 +0000)]
Added iterator and profiling (i.e. FoldingSetNodeID) support to ImmutableMap.

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

16 years agoFix PR1888, patch by Wilhansen Li.
Chris Lattner [Wed, 2 Jan 2008 21:30:58 +0000 (21:30 +0000)]
Fix PR1888, patch by Wilhansen Li.

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

16 years agoFix a build problem with VC++ by not doing the target prefix
Chris Lattner [Wed, 2 Jan 2008 21:24:22 +0000 (21:24 +0000)]
Fix a build problem with VC++ by not doing the target prefix
comparison for every builtin.  This reduces the depth of
the if/elseif chain dramatically.

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

16 years agoUse the correct MachineRegisterInfo object.
Bill Wendling [Wed, 2 Jan 2008 21:10:54 +0000 (21:10 +0000)]
Use the correct MachineRegisterInfo object.

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

16 years agoMachine LICM will check that operands are defined outside of the loop. Also
Bill Wendling [Wed, 2 Jan 2008 21:10:40 +0000 (21:10 +0000)]
Machine LICM will check that operands are defined outside of the loop. Also
check that register isn't 0 before going further.

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

16 years agoRemove dead code.
Bill Wendling [Wed, 2 Jan 2008 20:47:37 +0000 (20:47 +0000)]
Remove dead code.

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

16 years agoverify that aligned common support doesn't break.
Chris Lattner [Wed, 2 Jan 2008 19:48:24 +0000 (19:48 +0000)]
verify that aligned common support doesn't break.

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

16 years agodarwin9 and above support aligned common symbols.
Chris Lattner [Wed, 2 Jan 2008 19:44:55 +0000 (19:44 +0000)]
darwin9 and above support aligned common symbols.

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

16 years agoleopard and above support alignment for common symbols.
Chris Lattner [Wed, 2 Jan 2008 19:35:16 +0000 (19:35 +0000)]
leopard and above support alignment for common symbols.

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

16 years agoUse the new architecture to get the containing machine basic block for a machine
Bill Wendling [Wed, 2 Jan 2008 19:32:43 +0000 (19:32 +0000)]
Use the new architecture to get the containing machine basic block for a machine
instruction. Also, use "splice" to move the new instruction instead of
remove/insert (where it was leaking memory anyway).

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

16 years agoDon't be rude, emit debugging info where asked to.
Nick Lewycky [Wed, 2 Jan 2008 02:49:20 +0000 (02:49 +0000)]
Don't be rude, emit debugging info where asked to.

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

16 years agoMove some more instruction creation methods from RegisterInfo into InstrInfo.
Owen Anderson [Tue, 1 Jan 2008 21:11:32 +0000 (21:11 +0000)]
Move some more instruction creation methods from RegisterInfo into InstrInfo.

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

16 years agoMake MachineRegisterInfo::getVRegDef more efficient by aiming the keep the def of...
Chris Lattner [Tue, 1 Jan 2008 21:08:22 +0000 (21:08 +0000)]
Make MachineRegisterInfo::getVRegDef more efficient by aiming the keep the def of the vreg at the start of the list, so the list doesn't need to be traversed.

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

16 years agoswitch the register iterator to act more like hte LLVM value iterator: dereferencing
Chris Lattner [Tue, 1 Jan 2008 20:36:19 +0000 (20:36 +0000)]
switch the register iterator to act more like hte LLVM value iterator: dereferencing
it now returns the machineinstr of the use.  To get the operand, use I.getOperand().

Add a new MachineRegisterInfo::replaceRegWith, which is basically like
Value::replaceAllUsesWith.

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

16 years agoAdding C bindings for SwitchInst::addCase.
Gordon Henriksen [Tue, 1 Jan 2008 05:50:53 +0000 (05:50 +0000)]
Adding C bindings for SwitchInst::addCase.

Patch by Bryan O'Sullivan!

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

16 years agoAdd a trivial but handy function to efficiently return the machine
Chris Lattner [Tue, 1 Jan 2008 03:07:29 +0000 (03:07 +0000)]
Add a trivial but handy function to efficiently return the machine
instruction that defines the specified vreg.  Crazy.

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

16 years agoadd efficient iteration support for register use/def's
Chris Lattner [Tue, 1 Jan 2008 02:55:32 +0000 (02:55 +0000)]
add efficient iteration support for register use/def's
within a machine function.

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

16 years agoUpdate this testcase. The output needs to be disabled to pass.
Bill Wendling [Tue, 1 Jan 2008 01:34:36 +0000 (01:34 +0000)]
Update this testcase. The output needs to be disabled to pass.

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

16 years agoImplement automatically updated def/use lists for all MachineInstr register
Chris Lattner [Tue, 1 Jan 2008 01:12:31 +0000 (01:12 +0000)]
Implement automatically updated def/use lists for all MachineInstr register
operands.  The lists are currently kept in MachineRegisterInfo, but it does
not yet provide an iterator interface to them.

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

16 years agoFix a bug in my previous patch: refer to the impl not the pure virtual version. ...
Chris Lattner [Tue, 1 Jan 2008 01:05:34 +0000 (01:05 +0000)]
Fix a bug in my previous patch: refer to the impl not the pure virtual version.  It's unclear why gcc would ever compile this...

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

16 years agoFix a problem where lib/Target/TargetInstrInfo.h would include and use
Chris Lattner [Tue, 1 Jan 2008 01:03:04 +0000 (01:03 +0000)]
Fix a problem where lib/Target/TargetInstrInfo.h would include and use
a header file from libcodegen.  This violates a layering order: codegen
depends on target, not the other way around.  The fix to this is to
split TII into two classes, TII and TargetInstrInfoImpl, which defines
stuff that depends on libcodegen.  It is defined in libcodegen, where
the base is not.

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

16 years agoFactor out makefile dependency generation better.
Chris Lattner [Mon, 31 Dec 2007 23:58:31 +0000 (23:58 +0000)]
Factor out makefile dependency generation better.
Don't include system headers in the .d files.
Don't use $@ in the makefile rules, as there are two possible targets it could resolve to: use the one that we need explicitly.

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

16 years agoFix PR1833 - eh.exception and eh.selector return two
Duncan Sands [Mon, 31 Dec 2007 18:35:50 +0000 (18:35 +0000)]
Fix PR1833 - eh.exception and eh.selector return two
values, which means doing extra legalization work.
It would be easier to get this kind of thing right if
there was some documentation...

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

16 years agoMove copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
Owen Anderson [Mon, 31 Dec 2007 06:32:00 +0000 (06:32 +0000)]
Move copyRegToReg from MRegisterInfo to TargetInstrInfo.  This is part of the
Machine-level API cleanup instigated by Chris.

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

16 years agoproperly encapsulate the parent field of MBB and MI with get/set accessors.
Chris Lattner [Mon, 31 Dec 2007 04:56:33 +0000 (04:56 +0000)]
properly encapsulate the parent field of MBB and MI with get/set accessors.

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