Commit Graph

19363 Commits

Author SHA1 Message Date
Chris Lattner 76dc204488 move two functions up in the file, use SafeToMergeTerminators to eliminate
some duplicated code

llvm-svn: 22610
2005-08-03 00:19:45 +00:00
Chris Lattner 733d6704ce Rip some code out of the main SimplifyCFG function into a subfunction and
call it from the only place it is live.  No functionality changes.

llvm-svn: 22609
2005-08-03 00:11:16 +00:00
Chris Lattner e972403215 This fails for now
llvm-svn: 22608
2005-08-03 00:10:28 +00:00
Chris Lattner ac594de8dc Disable this patch:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050801/027345.html

This breaks real programs and only fixes an obscure regression testcase.  A
real fix is in development.

llvm-svn: 22606
2005-08-02 23:31:38 +00:00
Chris Lattner eee90f7eb4 Change a place to use an arbitrary value instead of null, when possible
llvm-svn: 22605
2005-08-02 23:29:23 +00:00
Chris Lattner bd615f518c If the user interrupts bugpoint, don't extract loops
llvm-svn: 22603
2005-08-02 23:25:56 +00:00
Chris Lattner 68095d7722 Add a note, people are responsible for requesting that they be added to the
file.

llvm-svn: 22602
2005-08-02 22:10:21 +00:00
Chris Lattner ab08df9699 Pass -export-dynamic to gcc when compiling with -native and the link is
performed with -export-dynamic (aka. -disable-internalize).

Patch by Nicholas Riley!

llvm-svn: 22601
2005-08-02 22:07:38 +00:00
Chris Lattner 0caa43492f Fix the non-gcc 4.0 paths for countleadingzeros
Patch fixed by Jim Laskey

llvm-svn: 22598
2005-08-02 20:21:33 +00:00
Chris Lattner fba2e9c8f9 Fix inverted conditionals
llvm-svn: 22597
2005-08-02 20:06:18 +00:00
Chris Lattner 80e038c148 one more hunk that got dropped
llvm-svn: 22596
2005-08-02 19:35:29 +00:00
Chris Lattner 989d8bbda9 This hunk accidentally got dropped. Patch by Jim Laskey
llvm-svn: 22595
2005-08-02 19:30:55 +00:00
Chris Lattner 6667bdbaca Update to use the new MathExtras.h support for log2 computation.
Patch contributed by Jim Laskey!

llvm-svn: 22594
2005-08-02 19:26:06 +00:00
Chris Lattner 44060e0871 Fix the non-gcc 4.0 path to compile
llvm-svn: 22593
2005-08-02 19:21:51 +00:00
Chris Lattner 22d00a8e90 Update to use the new MathExtras.h support for log2 computation.
Patch contributed by Jim Laskey!

llvm-svn: 22592
2005-08-02 19:16:58 +00:00
Chris Lattner e1d60c39aa Consolidate all of the various log2 computing functions into MathExtras.h.
Also, provide accelerated implementations when building with GCC.
Patch contributed by Jim Laskey!

llvm-svn: 22591
2005-08-02 19:15:30 +00:00
Chris Lattner 25865406f0 Update a doc, patch contributed by Jim Laskey!
llvm-svn: 22590
2005-08-02 19:14:25 +00:00
Chris Lattner c98d48fabe add a pass name to make debugging dumps nicer
llvm-svn: 22588
2005-08-02 19:07:49 +00:00
Misha Brukman c9076e0acf Fix grammar: it's == "it is".
llvm-svn: 22587
2005-08-02 16:04:59 +00:00
Chris Lattner 351b891cbc Like the comment says, do not insert cast instructions before phi nodes
llvm-svn: 22586
2005-08-02 03:31:14 +00:00
Jeff Cohen 9aafa06bef It's dangerous coding on Mondays.
llvm-svn: 22585
2005-08-02 03:26:32 +00:00
Chris Lattner 4fd3e16cbd This code was very close, but not quite right. It did not take into
consideration the case where a reference in an unreachable block could
occur.  This fixes Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll,
something I ran into while bugpoint'ing another pass.

llvm-svn: 22584
2005-08-02 03:24:05 +00:00
Chris Lattner 8530d6d0af New testcase that caused simplifycfg to crash
llvm-svn: 22583
2005-08-02 03:23:03 +00:00
Jeff Cohen ba7cc68594 Implement SetInterruptFunction for Windows.
llvm-svn: 22582
2005-08-02 03:04:47 +00:00
Chris Lattner 75a44e154e add a comment, make a check more lenient
llvm-svn: 22581
2005-08-02 02:52:02 +00:00
Chris Lattner dcce49e006 Simplify for loop, clear a per-loop map after processing each loop
llvm-svn: 22580
2005-08-02 02:44:31 +00:00
Chris Lattner beb01faea3 When the user hits ctrl-c, bugpoint should attempt to stop reduction as
quickly as possible and output what it has so far.  If they hit it twice,
bugpoint is killed.

llvm-svn: 22579
2005-08-02 02:16:17 +00:00
Chris Lattner 6a5d6ecd09 Implement sys::SetInterruptFunction on Unix, stub it on win32 so that the
build will not fail

llvm-svn: 22578
2005-08-02 02:14:22 +00:00
Chris Lattner a429d00757 add a new function proto
llvm-svn: 22577
2005-08-02 02:13:42 +00:00
Chris Lattner 9ef1294210 Add a comment
Make LSR ignore GEP's that have loop variant base values, as we currently
cannot codegen them

llvm-svn: 22576
2005-08-02 01:32:29 +00:00
Chris Lattner 564900e5e5 Fix an iterator invalidation problem
llvm-svn: 22575
2005-08-02 00:41:11 +00:00
Chris Lattner fca31aee4f 200.sixtrack prints FP numbers with a very strange notation that uses D
instead of E for exponentials (e.g. 1.234D-43).  Add support for this
notation.

llvm-svn: 22574
2005-08-02 00:11:53 +00:00
Chris Lattner b30c947ceb make is the standard name, not gmake
llvm-svn: 22573
2005-08-02 00:10:52 +00:00
Chris Lattner 0545ae9ca4 Mark these as V9 specific
llvm-svn: 22572
2005-08-01 20:38:31 +00:00
Andrew Lenharth ae97fff758 update function codes to reflect /su flags that have been added since this was written
llvm-svn: 22571
2005-08-01 20:06:01 +00:00
Chris Lattner 4398daf069 Fix casts from long to sbyte on ppc
llvm-svn: 22570
2005-08-01 18:16:37 +00:00
Andrew Lenharth 33bbf15147 use llabs not abs
llvm-svn: 22569
2005-08-01 17:47:28 +00:00
Andrew Lenharth 27f1e26db7 one cannot allocate a global, until one is done initializing the global pointers
llvm-svn: 22568
2005-08-01 17:35:40 +00:00
Chris Lattner 8a3d007d75 temporarily fail these two tests until LSR evolves to support them
llvm-svn: 22567
2005-08-01 17:10:50 +00:00
Chris Lattner e17c5d0e59 ConstantInt::get only works for arguments < 128.
SimplifyLibCalls probably has to be audited to make sure it does not make
this mistake elsewhere.  Also, if this code knows that the type will be
unsigned, obviously one arm of this is dead.

Reid, can you take a look into this further?

llvm-svn: 22566
2005-08-01 16:52:50 +00:00
Jeff Cohen 546fd5944e Keep tabs and trailing spaces out.
llvm-svn: 22565
2005-07-30 18:33:25 +00:00
Jeff Cohen c500991055 Fix VC++ build problems.
llvm-svn: 22564
2005-07-30 18:22:27 +00:00
Chris Lattner 941d84a34d fix float->long conversions on x86
llvm-svn: 22563
2005-07-30 01:40:57 +00:00
Chris Lattner 4c0f43edf6 this tests every fp-to-integer conversion
llvm-svn: 22562
2005-07-30 01:33:38 +00:00
Chris Lattner 4913457573 fix a typeo
llvm-svn: 22561
2005-07-30 00:43:00 +00:00
Nate Begeman 17a0e2afea Ack, typo
llvm-svn: 22560
2005-07-30 00:21:31 +00:00
Chris Lattner aeef51b6b7 Change the fp to integer code to not perform 2-byte stores followed by
1 byte loads and other operations.  This is bad for store-forwarding on
common CPUs.  We now do this:

fnstcw WORD PTR [%ESP]
mov %AX, WORD PTR [%ESP]

instead of:

fnstcw WORD PTR [%ESP]
mov %AL, BYTE PTR [%ESP + 1]

llvm-svn: 22559
2005-07-30 00:17:52 +00:00
Nate Begeman e68bcd1946 Commit a new LoopStrengthReduce pass that can use scalar evolutions and
target data to decide which loop induction variables to strength reduce
and how to do so.  This work is mostly by Chris Lattner, with tweaks by
me to get it working on some of MultiSource.

llvm-svn: 22558
2005-07-30 00:15:07 +00:00
Nate Begeman 2bca4d9b7b Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.

llvm-svn: 22557
2005-07-30 00:12:19 +00:00
Chris Lattner 4738d1b5cd Use a custom expander for all FP to int conversions, as the X86 only has
FP-to-int-in-memory: this exposes the load from the stored slot to the
selection dag, allowing it to be folded into other operaions.

llvm-svn: 22556
2005-07-30 00:05:54 +00:00
Chris Lattner f59b2daddb Allow targets to have custom expanders for FP_TO_*INT conversions where
both the src and dest values are legal

llvm-svn: 22555
2005-07-30 00:04:12 +00:00
Andrew Lenharth 0940218cca support near allocations for the JIT
llvm-svn: 22554
2005-07-29 23:40:16 +00:00
Andrew Lenharth 2f9c52e194 turn off GOT on archs that didn't use it (not that it appeard to harm them much with it on)
llvm-svn: 22553
2005-07-29 23:32:02 +00:00
Chris Lattner bc85c32c73 Implement a FIXME: move a bunch of cruft for handling FP_TO_*INT operations
that the X86 does not support to the legalizer.  This allows it to be better
optimized, etc, and will help with SSE support.

llvm-svn: 22551
2005-07-29 01:00:29 +00:00
Chris Lattner 6dc60e859b Don't forget to diddle with the control word when performing an FISTP64.
llvm-svn: 22550
2005-07-29 00:54:34 +00:00
Chris Lattner 67756e2e22 Use a custom expander to compile this:
long %test4(double %X) {
        %tmp.1 = cast double %X to long         ; <long> [#uses=1]
        ret long %tmp.1
}

to this:

_test4:
        sub %ESP, 12
        fld QWORD PTR [%ESP + 16]
        fistp QWORD PTR [%ESP]
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP]
        add %ESP, 12
        ret

instead of this:

_test4:
        sub %ESP, 28
        fld QWORD PTR [%ESP + 32]
        fstp QWORD PTR [%ESP]
        call ___fixdfdi
        add %ESP, 28
        ret

llvm-svn: 22549
2005-07-29 00:40:01 +00:00
Chris Lattner fe68d75aad Allow targets to define custom expanders for FP_TO_*INT
llvm-svn: 22548
2005-07-29 00:33:32 +00:00
Chris Lattner 44fe26ff07 allow a target to request that unknown FP_TO_*INT conversion be promoted to
a larger integer destination.

llvm-svn: 22547
2005-07-29 00:11:56 +00:00
Chris Lattner f99f8f9081 instead of having all conversions be handled by one case value, and then have
subcases inside, break things out earlier.

llvm-svn: 22546
2005-07-28 23:31:12 +00:00
Chris Lattner 7727bbfb06 New testcase for PR610
llvm-svn: 22545
2005-07-28 20:18:33 +00:00
Andrew Lenharth 1ec48e8683 support bsr, and more .td simplification
llvm-svn: 22543
2005-07-28 18:14:47 +00:00
Andrew Lenharth 3faa82219a new is not a valid default anywhere, so make this pure virtual
llvm-svn: 22542
2005-07-28 18:13:59 +00:00
Reid Spencer 29f83e0997 Fix a problem in getDirectoryContents where sub-directory names were
appended to a path string that didn't end in a slash, yielding invalid
path names.

Path contribute by Nicholas Riley.

llvm-svn: 22539
2005-07-28 16:25:57 +00:00
Andrew Lenharth b57b0baac0 get lazy JITing working. Some of shootout runs now
llvm-svn: 22538
2005-07-28 12:45:20 +00:00
Andrew Lenharth 3444cf5128 Like constants, globals on some platforms are GOT relative. This means they have to be allocated
near the GOT, which new doesn't do.  So break out the allocate into a new function.

Also move GOT index handling into JITResolver.  This lets it update the mapping when a Lazy
function is JITed.  It doesn't managed the table, just the mapping.  Note that this is
still non-ideal, as any function that takes a function address should also take a GOT
index, but that is a lot of changes.  The relocation resolve process updates any GOT entry
it sees is out of date.

llvm-svn: 22537
2005-07-28 12:44:13 +00:00
Chris Lattner a8195603e4 Eliminate an extra copy from R1 that Nate noticed on function calls that
have to write arguments to the stack

llvm-svn: 22536
2005-07-28 05:23:43 +00:00
Chris Lattner 7c38bd14ef Specify the correct number of operands
llvm-svn: 22535
2005-07-28 04:42:11 +00:00
Reid Spencer 87c5a8a48a Run the verifier pass after all the other passes rather than before them.
This catches mistakes in the passes rather than just verifying the bytecode
input to llc.

llvm-svn: 22534
2005-07-28 04:00:49 +00:00
Nate Begeman c5b6bd9a8e Fold constant adds into loads and stores to frame indices.
For the following code:
double %ext(int %A.0__, long %A.1__) {
        %A_addr = alloca %typedef.DComplex              ; <%typedef.DComplex*> [#uses=2]
        %tmp.1 = cast %typedef.DComplex* %A_addr to int*                ; <int*> [#uses=1]
        store int %A.0__, int* %tmp.1
        %tmp.2 = getelementptr %typedef.DComplex* %A_addr, int 0, uint 1                ; <double*> [#uses=2]
        %tmp.3 = cast double* %tmp.2 to long*           ; <long*> [#uses=1]
        store long %A.1__, long* %tmp.3
        %tmp.5 = load double* %tmp.2            ; <double> [#uses=1]
        ret double %tmp.5
}

We now generate:
_ext:
.LBB_ext_0:     ;
        stw r3, -12(r1)
        stw r4, -8(r1)
        stw r5, -4(r1)
        lfd f1, -8(r1)
        blr

Instead of:
_ext:
.LBB_ext_0:     ;
        stw r3, -12(r1)
        addi r2, r1, -12
        stw r4, 4(r2)
        stw r5, 8(r2)
        lfd f1, 4(r2)
        blr

This also fires hundreds of times on MultiSource.

llvm-svn: 22533
2005-07-28 03:02:05 +00:00
Reid Spencer 8e3830dae7 Make the verifier pass run (in debug mode) in llc. This adds a sanity check
to llc when debugging. Also allow other passes to be run from llc.
Patch contributed by Michael McCracken.

llvm-svn: 22532
2005-07-28 02:25:30 +00:00
Jeff Cohen 8c6de7781a Please do not reintroduce tabs.
llvm-svn: 22531
2005-07-28 02:04:44 +00:00
Nate Begeman 594a3ba40e Fix some comments
llvm-svn: 22530
2005-07-27 23:11:27 +00:00
Chris Lattner 96cbfbbeaf Fix debug info to not print out recently freed memory.
llvm-svn: 22529
2005-07-27 23:11:25 +00:00
Chris Lattner 9937713252 Print symbolic register names in debug dumps
llvm-svn: 22528
2005-07-27 23:03:38 +00:00
Reid Spencer 2b381e0c1e Fix PR608:
Previously the script assumed the version number was the last field, now
it assumes it is the first sequence of digits.

llvm-svn: 22527
2005-07-27 21:58:38 +00:00
Jeff Cohen 5f4ef3c5a8 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Nate Begeman 8e2411334c Implement the optimization for the Red Zone on Darwin. This removes the
unnecessary SP manipulation in leaf routines that don't need it.

llvm-svn: 22522
2005-07-27 06:06:29 +00:00
Chris Lattner a5ec193118 fix some warnings when compiled with 32-bit hosts
llvm-svn: 22521
2005-07-27 05:58:01 +00:00
Jeff Cohen 33a030e36c Eliminate tabs and trailing spaces.
llvm-svn: 22520
2005-07-27 05:53:44 +00:00
Chris Lattner f7100ad225 Testcase for PR607
llvm-svn: 22519
2005-07-26 22:08:53 +00:00
Chris Lattner 1defb7fe80 add a note about the red zone
llvm-svn: 22518
2005-07-26 19:07:51 +00:00
Chris Lattner 06721f50b0 Wrap some long lines, fix emission of weak global variables
llvm-svn: 22517
2005-07-26 19:03:27 +00:00
Nate Begeman 7b8733571e Update the PPC readme
llvm-svn: 22516
2005-07-26 18:59:06 +00:00
Chris Lattner 31d0ac2414 ConvertibleToGEP always returns 0, remove some old crufty code which
is actually dead because of this!

llvm-svn: 22515
2005-07-26 16:38:28 +00:00
Chris Lattner 54d27a49da fix a warning on 32-bit systems
llvm-svn: 22513
2005-07-25 23:42:58 +00:00
Nate Begeman b9ce12b4bb Fix an optimization put in for accessing static globals. This obviates
the need to build PIC.

llvm-svn: 22512
2005-07-25 21:15:28 +00:00
Reid Spencer dfa35465dd Get rid of bash specific syntax for variable dereferencing, replacing it
with the more crufty (but more widely available) "eval" command.

llvm-svn: 22509
2005-07-25 20:25:08 +00:00
Andrew Lenharth 54b0b62ff0 fix compile error
llvm-svn: 22508
2005-07-23 07:46:48 +00:00
Chris Lattner 12f5d12b21 PowerPC no-pic code is not quite ready for prime-time
llvm-svn: 22507
2005-07-22 22:58:34 +00:00
Misha Brukman 08c3645d3a No, really, it's an Alpha! And you probably thought it was a PowerPC.
llvm-svn: 22506
2005-07-22 22:43:40 +00:00
Andrew Lenharth 7dec1f3aa6 Handle more imm forms, and load small negative i32 constants without hitting memory (should do the same for arbitrary zero extended small negative constants)
llvm-svn: 22505
2005-07-22 22:24:01 +00:00
Andrew Lenharth 9900701f19 I know PowerPC wishes it could be alpha, but it cannot. so there
llvm-svn: 22504
2005-07-22 22:00:24 +00:00
Andrew Lenharth 3fe8a6b104 make sure we always handle small negatives well
llvm-svn: 22503
2005-07-22 21:53:35 +00:00
Andrew Lenharth c32843ed2b finally found the gcc defined constants
llvm-svn: 22502
2005-07-22 21:00:30 +00:00
Andrew Lenharth c7fe0f510f Alpha has JIT
llvm-svn: 22501
2005-07-22 20:54:01 +00:00
Andrew Lenharth 55d045190e Alpha JIT (beta)
llvm-svn: 22500
2005-07-22 20:52:16 +00:00
Andrew Lenharth 02daecc7c6 simpilfy instruction encoding (and make the lines way shorter, aka Misha happification)
llvm-svn: 22499
2005-07-22 20:50:29 +00:00
Andrew Lenharth 111e5e6490 update interface
llvm-svn: 22498
2005-07-22 20:49:37 +00:00
Andrew Lenharth 940b07c7fa the JIT memory manager will construct a GOT if you want it too. Also, it places the constants in the allocated memory, rather than a malloc area
llvm-svn: 22497
2005-07-22 20:48:12 +00:00
Andrew Lenharth cf5cf4dfcd allow constants to be relocated like GV (necessary for alpha, as constants are relocated with globals, not with .text), and allow targets to have a GOT managed for them
llvm-svn: 22496
2005-07-22 20:46:42 +00:00