Commit Graph

8560 Commits

Author SHA1 Message Date
Reid Spencer
be0b356593 PR466:
* Make the linker find lib*.bca files now instead of lib*.bc since those
  are what the makefiles now generate for bytecode archives.
* Make sure the linker only links archives when LinkLibraries is called.
  Previously if it found a lib*.bc file and that file was a bytecode file,
  it would link in the entire bytecode. This could make -lc -lc fail with
  duplicate symbols error but it shouldn't as searching multiple libraries,
  even the same one more than once, is permitted.
* Now that the above problems are corrected, implement the dependent libs
  feature. After the module is linked with all specified libraries, the
  LinkLibraries function will obtain the set of dependent libraries from
  the linked modules and attemp to find and link against those libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18428 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-02 09:52:10 +00:00
Reid Spencer
86ac2dcda1 Fix seriously broken implementation of GetMagicNumber.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-02 09:09:48 +00:00
Tanya Lattner
ad7654f7c4 Reworked branch adding in prologue. Added check for infinite loops which are not modulo scheduled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18419 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-02 07:22:15 +00:00
Chris Lattner
fa07e4fc30 Implement a FIXME by checking to make sure that a malloc is not being used
in scary and unknown ways before we promote it.  This fixes the miscompilation
of 188.ammp that has been plauging us since a globalopt patch went in.

Thanks a ton to Tanya for helping me diagnose the problem!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18418 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-02 07:11:07 +00:00
Chris Lattner
bc965b97ad Fix a minor bug where we set a var to initialized on malloc, not on store.
This doesn't fix anything that I'm aware of, just noticed it by inspection


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18417 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-02 06:25:58 +00:00
Tanya Lattner
9855b84469 Reverting this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041122/021428.html

It broke Mutlisource/Applications/obsequi


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18407 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-01 18:27:03 +00:00
Chris Lattner
527efc6742 Initial support for packed types, contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18406 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-01 17:14:28 +00:00
Chris Lattner
f71755dc56 Remove unneeded cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18405 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-01 17:13:05 +00:00
Chris Lattner
f0228053f8 Get GEP's working with packed types. Contributed by Morten Ofstad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18404 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-01 17:12:16 +00:00
Reid Spencer
0022b83491 Revert version 1.39. It breaks the ordering of the library processing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18399 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 22:54:48 +00:00
Chris Lattner
40e7c35a2f Do not let GCC emit a warning for INT64_MIN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18398 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 21:33:58 +00:00
Brian Gaeke
33ce43e8a8 Sparcs behave better if we use <alloca.h> and avoid messing with __builtin_alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18397 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 21:27:01 +00:00
Chris Lattner
532343b24e Fix the JIT when being used from llvm-db
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18391 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 17:41:49 +00:00
Chris Lattner
6b205c3ef1 This pass is completely broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18387 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 17:09:06 +00:00
Chris Lattner
3af4b4fe78 RevisionNum is read by error(), initialize it early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 16:58:18 +00:00
Brian Gaeke
cb7a76283b Update list of failing benchmarks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18384 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 08:15:44 +00:00
Brian Gaeke
9e0b9028c7 If we're about to emit something like:
%f0 = fmovs %f0
  %f1 = fmovs %f1

then just delete the FpMOVD pseudo-instruction instead.  Also, add
statistics and debug printouts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18383 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 08:15:15 +00:00
Chris Lattner
0f535c6fa8 Squelch warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18381 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 07:47:34 +00:00
Chris Lattner
0284628e8e Fix several bugs in 'op x, imm' handling. Foremost is that we now emit
addi r3, r3, -1
instead of
   addi r3, r3, 1

for 'sub int X, 1'.

Secondarily, this fixes several cases where we could crash given an unsigned
constant.  And fixes a couple of minor missed optimization cases, such as
xor X, ~0U -> not X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18379 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 07:30:20 +00:00
Reid Spencer
a7a5cc889c Up the compression threshold to 64K so we avoid it for all but the largest
bytecode files. This should help linking substantially.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18378 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 07:13:34 +00:00
Chris Lattner
5a85d9c664 Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx
This only fails on darwin or on X86 under valgrind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18377 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 07:01:15 +00:00
Chris Lattner
35f2bbe8c6 Fix CodeGen/PowerPC/2004-11-30-shr-var-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18376 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 06:40:04 +00:00
Chris Lattner
e74ed0d53b Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18374 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 06:36:11 +00:00
Chris Lattner
7747040410 Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18371 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 06:29:10 +00:00
Chris Lattner
6f9e571529 Alkis noticed that this variable is dead. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18369 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 04:01:44 +00:00
Chris Lattner
38f1455393 Add method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 02:51:53 +00:00
Chris Lattner
37dc938bbe If we have something like this:
if (x) {
    code
    ...
  } else {
    code
    ...
  }

Turn it into:

  code
  if (x) {
    ...
  } else {
    ...
  }

This reduces code size and in some common cases allows us to completely
eliminate the conditional.  This turns several if/then/else blocks in loops
into straightline code in 179.art, turning the loops into single basic blocks
(good for modsched even!).

Maybe now brg will leave me alone ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18366 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 00:29:14 +00:00
Chris Lattner
ee8c9ad8d2 Remove extraneous namespacification. In particular, don't define llvm::llvm::createInternalGlobalMapperPass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18365 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 00:22:59 +00:00
Chris Lattner
8a9193927a Allow hoisting loads of globals and alloca's in conditionals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18363 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 21:26:12 +00:00
Reid Spencer
e934219e77 Functionality moved to portable lib/System/DynamicLibrary.cpp
implementation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 14:11:41 +00:00
Reid Spencer
df5a37efc9 Use System/DynamicLibrary instead of Support/DynamicLinker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18357 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 14:11:29 +00:00
Reid Spencer
737459df79 Use System/DynamicLibrary instead of Support/DynamicLinker to implement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 14:07:46 +00:00
Reid Spencer
19cd4a9e6b Implement two new functions: LoadLibraryPermanently and
SearchForAddressOfSymbol.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18355 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 13:33:28 +00:00
Reid Spencer
a564845f83 Shared library extension is now in LTDL_SHLIB_EXT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18353 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 12:40:21 +00:00
Reid Spencer
29ae1777c1 We just use ltdl's implementation for this abstraction now. Its portable to
more platforms than LLVM supports.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18352 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 12:39:10 +00:00
Reid Spencer
58c8ee1537 Mods for compilation with llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18346 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 12:04:27 +00:00
Reid Spencer
9c16ed5aea Original version of ltdl.h from libtool 1.5.10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18345 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 12:02:48 +00:00
Reid Spencer
535af2be27 Original version of ltdl.c from libtool 1.5.10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18344 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 12:02:25 +00:00
Reid Spencer
441cc2ab01 Implement the default constructor which causes the current program to be
opened as if it was a dynamic library so its symbols can be searched too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18341 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 10:39:46 +00:00
Chris Lattner
928b47ae2e Revamp long/ulong comparisons to use a much more efficient sequence (thanks
to Brian and the Sun compiler for pointing out that the obvious works :)

This also enables folding all long comparisons into setcc and branch
instructions: before we could only do == and !=

For example, for:
void test(unsigned long long A, unsigned long long B) {
   if (A < B) foo();
 }

We now generate:

test:
        subl $4, %esp
        movl %esi, (%esp)
        movl 8(%esp), %eax
        movl 12(%esp), %ecx
        movl 16(%esp), %edx
        movl 20(%esp), %esi
        subl %edx, %eax
        sbbl %esi, %ecx
        jae .LBBtest_2  # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl (%esp), %esi
        addl $4, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl (%esp), %esi
        addl $4, %esp
        ret

Instead of:

test:
        subl $12, %esp
        movl %esi, 8(%esp)
        movl %ebx, 4(%esp)
        movl 16(%esp), %eax
        movl 20(%esp), %ecx
        movl 24(%esp), %edx
        movl 28(%esp), %esi
        cmpl %edx, %eax
        setb %al
        cmpl %esi, %ecx
        setb %bl
        cmove %ax, %bx
        testb %bl, %bl
        je .LBBtest_2   # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18330 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 05:55:24 +00:00
Tanya Lattner
58fe2f0734 Reworked branching so we don't handle BAs specially. It just updates the branchTO regardless of what type of branch it is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18322 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 04:39:47 +00:00
Tanya Lattner
28e5eabf65 Fixed bug where instructions in the kernel were not ordered right to preserve dependencies in a cycle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18314 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 23:36:15 +00:00
Reid Spencer
6731d5c494 Fix for PR454:
* Make sure we handle signed to unsigned conversion correctly
* Move this visitSetCondInst case to its own method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18312 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 21:31:15 +00:00
Chris Lattner
9d0087e043 The LLVM bool type shall have 1 byte alignment on PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18311 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 21:16:45 +00:00
Chris Lattner
8305a64dce Make DSE potentially more aggressive by being more specific about alloca sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18309 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 20:44:37 +00:00
Chris Lattner
eaf8f9c667 Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18308 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 20:30:15 +00:00
Chris Lattner
63eb93025d Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully
PR449


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 17:56:47 +00:00
Chris Lattner
7891593359 Fix PR463
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18303 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 16:45:45 +00:00
Reid Spencer
8dde18fc50 Compute the firstFileOffset correctly after reading the LLVM symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18300 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 03:13:02 +00:00
Chris Lattner
cc8d524a24 When merging to alias sets, if they are both must alias, the result is not
a must alias set unless all of the pointers in the resultant set are must
aliased together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-27 18:37:42 +00:00