Commit Graph

7761 Commits

Author SHA1 Message Date
Alkis Evlogimenos
f3ba6ddbec Since we use alloca now make sure we include the proper headers for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16536 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 02:53:15 +00:00
Alkis Evlogimenos
0ee6e2a6da Use alloca instead of a C99 style array. This should fix the
compilation problem in windows.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16535 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 02:47:38 +00:00
Alkis Evlogimenos
200a360ec6 Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 02:40:37 +00:00
Alkis Evlogimenos
c4d3b91816 Fix includes. Patch contributed by Paolo Invernizzi!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16533 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 02:38:58 +00:00
Chris Lattner
83c4ec0372 Fix two bugs: one where a condition was mistakenly swapped, and another
where we folded (X & 254) -> X < 1 instead of X < 2.  These problems were
latent problems exposed by the latest patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16528 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27 19:29:18 +00:00
Misha Brukman
f90a656a9f SparcV8 int regs are not only 32-bits in width, but they are 32-bit aligned!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16526 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27 18:22:18 +00:00
Chris Lattner
56bc894d06 The system ranlib on darwin occasionally adds two extra newlines to the
end of files, breaking the CFE build.  As a gross hack around this,
ignore any trailing garbage on bytecode files.  Thanks to Brian for digging
in and identifying the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16525 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27 16:59:06 +00:00
Chris Lattner
f63f647345 Fold: (setcc (shr X, ShAmt), CI), where 'cc' is eq or ne. This xform
triggers often, for example:

6x in povray, 1x in gzip, 279x in gcc, 1x in crafty, 8x in eon, 11x in perlbmk,
362x in gap, 4x in vortex, 14 in m88ksim, 211x in 126.gcc, 1x in compress,
11x in ijpeg, and 4x in 147.vortex.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16521 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27 16:18:50 +00:00
Nate Begeman
da721e74f8 Correct some BuildMI arguments for the upcoming simple scheduler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16519 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27 05:08:17 +00:00
Misha Brukman
c6e7430499 Fix the copy-pasto that Brian noticed: V8 int regs are 32-bits wide, not 64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16518 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-26 21:07:43 +00:00
Reid Spencer
725f2c82c9 Updated to reflect changes in the interface of TimeValue::now().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16515 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-25 08:32:37 +00:00
Reid Spencer
0d5716e3af Added stub implementations of TimeValue concept for remaining platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16513 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-25 05:03:54 +00:00
Reid Spencer
1fc194c610 Wrap to 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16512 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-25 05:03:22 +00:00
Reid Spencer
9926c31351 Initial implementation of the TimeValue abstraction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16511 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-24 23:25:19 +00:00
Chris Lattner
0c96766c90 Implement shift-and combinations, implementing InstCombine/and.ll:test19-21
These combinations trigger 4 times in povray, 7x in gcc, 4x in gap, and 2x in bzip2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16508 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-24 15:21:34 +00:00
Chris Lattner
648e3bc39c Move LHSI->hasOneUse() into the arms of the conditional, reindenting code.
No functionality changes here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16505 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-23 21:52:49 +00:00
Chris Lattner
b20ba0a83f Implement Transforms/InstCombine/and.ll:test18, a case that occurs 20 times
in perlbmk


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16504 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-23 21:46:38 +00:00
Chris Lattner
684fe210a9 Implement select.ll:test16: fold load (select C, X, null) -> load X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16499 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-23 15:46:00 +00:00
Reid Spencer
f6cbc0fd64 Patch for MINGW. Patch provided by Henrik Bach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16495 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-23 14:47:10 +00:00
Nate Begeman
645495d2e6 Fix the last of the major PPC GEP folding deficiencies. This will allow
the ISel to use indexed and non-zero immediate offsets for GEPs that have
more than one use.  This is common for instruction sequences such as a load
followed by a modify and store to the same address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16493 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-23 05:31:33 +00:00
Misha Brukman
c95759c2f5 Use the V8/V9 shared register file description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16485 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-22 21:48:50 +00:00
Misha Brukman
c42077d371 Combine the F2 and F3 instruction classes into one file for simplicity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16484 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-22 21:38:42 +00:00
Misha Brukman
31b5edd2e9 Fix file header path
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16483 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-22 21:29:12 +00:00
Misha Brukman
981eefd5f7 Prettify formatting of the file, adjust paths to making V8 a subdir of Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16482 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-22 20:09:29 +00:00
Misha Brukman
2ec09e713e V8 is now a subdirectory of Sparc; adjust paths accordingly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16481 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-22 20:08:52 +00:00
Nate Begeman
a2de102a5b add optimized code sequences for setcc x, 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16478 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-22 04:40:25 +00:00
Chris Lattner
3d834bf2c3 Do not fold (X + C1 != C2) if there are other users of the add. Doing
this transformation used to take a loop like this:

int Array[1000];
void test(int X) {
  int i;
  for (i = 0; i < 1000; ++i)
    Array[i] += X;
}

Compiled to LLVM is:

no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]            ; <uint> [#uses=2]
        %tmp.4 = getelementptr [1000 x int]* %Array, int 0, uint %indvar                ; <int*> [#uses=2]
        %tmp.7 = load int* %tmp.4               ; <int> [#uses=1]
        %tmp.9 = add int %tmp.7, %X             ; <int> [#uses=1]
        store int %tmp.9, int* %tmp.4
***     %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
***     %exitcond = seteq uint %indvar.next, 1000               ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

and turn it into a loop like this:

no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr [1000 x int]* %Array, int 0, uint %indvar                ; <int*> [#uses=2]
        %tmp.7 = load int* %tmp.4               ; <int> [#uses=1]
        %tmp.9 = add int %tmp.7, %X             ; <int> [#uses=1]
        store int %tmp.9, int* %tmp.4
***     %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
***     %exitcond = seteq uint %indvar, 999             ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

Note that indvar.next and indvar can no longer be coallesced.  In machine
code terms, this patch changes this code:

.LBBtest_1:     # no_exit
        mov %EDX, OFFSET Array
        mov %ESI, %EAX
        add %ESI, DWORD PTR [%EDX + 4*%ECX]
        mov %EDX, OFFSET Array
        mov DWORD PTR [%EDX + 4*%ECX], %ESI
        mov %EDX, %ECX
        inc %EDX
        cmp %ECX, 999
        mov %ECX, %EDX
        jne .LBBtest_1  # no_exit

into this:

.LBBtest_1:     # no_exit
        mov %EDX, OFFSET Array
        mov %ESI, %EAX
        add %ESI, DWORD PTR [%EDX + 4*%ECX]
        mov %EDX, OFFSET Array
        mov DWORD PTR [%EDX + 4*%ECX], %ESI
        inc %ECX
        cmp %ECX, 1000
        jne .LBBtest_1  # no_exit

We need better instruction selection to get this:

.LBBtest_1:     # no_exit
        add DWORD PTR [Array + 4*%ECX], EAX
        inc %ECX
        cmp %ECX, 1000
        jne .LBBtest_1  # no_exit

... but at least there is less register juggling


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16473 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-21 21:35:23 +00:00
Alkis Evlogimenos
65cbfa0f37 The real x87 floating point registers should not be allocatable. They
are only used by the stackifier when transforming FPn register
allocations to the real stack file x87 registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16472 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-21 21:22:11 +00:00
Misha Brukman
540c82a700 s/ISel/PPC64ISel/ to have unique class names for debugging via gdb because the
C++ front-end in gcc does not mangle classes in anonymous namespaces correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16471 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-21 18:22:33 +00:00
Misha Brukman
a1dca55a3a s/ISel/PPC32ISel/ to have unique class names for debugging via gdb because the
C++ front-end in gcc does not mangle classes in anonymous namespaces correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16470 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-21 18:22:19 +00:00
Misha Brukman
eae1bf10ea s/ISel/X86ISel/ to have unique class names for debugging via gdb because the C++
front-end in gcc does not mangle classes in anonymous namespaces correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16469 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-21 18:21:21 +00:00
Chris Lattner
8cbee4ea5b Make sure to set the operand list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16466 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-21 17:30:54 +00:00
Chris Lattner
79f0c8e4ee Fix potential miscompilations: InstCombine/2004-09-20-BadLoadCombine*.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16447 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 10:15:10 +00:00
Alkis Evlogimenos
7b6ec600c5 Fix loop condition so that we don't decrement off the beginning of the
list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16440 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 06:42:58 +00:00
Chris Lattner
b12914bfc0 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:48:05 +00:00
Chris Lattner
bba61c07dd 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

Also, fix some undefined behavior, expecting | on booleans to evaluate
left-to-right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16435 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:47:19 +00:00
Chris Lattner
68d033cc94 Finegrainify namespacification
'Pass' should now not be derived from by clients.  Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16434 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:44:31 +00:00
Chris Lattner
ded6d0c9fb Prototype more accurately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16433 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:43:57 +00:00
Chris Lattner
4b50156049 Prototype these functions more accurately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16432 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:43:15 +00:00
Reid Spencer
d232438f54 Put in a #error in the event that we don't have an mmap that can map a file
into memor. This is just a reminder that the ReadFileIntoAddressSpace
function needs to be properly converted to lib/System and implemented via
read/write if there's no mmap of file support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16428 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:13:43 +00:00
Chris Lattner
8a37520f80 Make isSafeToLoadUnconditionally a bit smarter, implementing PR362 and
Regression/Transforms/InstCombine/CPP_min_max.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16409 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 19:18:10 +00:00
Chris Lattner
fff03c9074 Fix a nasty iterator invalidation problem I introduced yesterday. This
unfortunately is the cause of a bunch of failures from tonight, and the
reason the tester is running so slow :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16407 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 19:01:06 +00:00
Chris Lattner
a744b77e11 Remove a whole bunch of horrible hacky code that was used to promote allocas
whose addresses where used by trivial phi nodes and select instructions.  This
is now performed by the instcombine pass, which is more powerful, is much
simpler, and is faster.  This allows the deletion of a bunch of code, two
FIXME's and two gotos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16406 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 18:51:51 +00:00
Chris Lattner
c10acedb2d Make instruction combining a bit more aggressive in the face of volatile
loads, and implement two new transforms: InstCombine/load.ll:test[56].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16404 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 18:43:46 +00:00
Reid Spencer
7b60a15abc Minor correction to Signals implementation.
Patch submitted by Jeff Cohen. Thanks Jeff!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16401 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 05:37:39 +00:00
Chris Lattner
f5afcabff8 Add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16400 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 01:05:16 +00:00
Chris Lattner
0c0aa711b8 Fix the inliner to always delete any edges from the external call node to
a function being deleted.  Due to optimizations done while inlining, there
can be edges from the external call node to a function node that were not
apparent any longer.

This fixes the compiler crash while compiling 175.vpr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16399 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 21:37:03 +00:00
Chris Lattner
cd382a3725 Add CallGraphNode::removeAnyCallEdgeTo method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16398 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 21:34:34 +00:00
Reid Spencer
111a348435 Use the /dev/zero device as the device on which the pages are mapped.
Patch contributed by Henrik Bach. Thanks Henrik!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16397 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 19:34:09 +00:00
Reid Spencer
d0c9e0ee0d Porting of Unix implementation to Win32.
Patch contributed by Jeff Cohen. Thanks Jeff!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16396 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 19:29:16 +00:00