1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 14:33:02 +02:00
Commit Graph

34331 Commits

Author SHA1 Message Date
Evan Cheng
859720c33b Add CopyCost to TargetRegisterClass. This specifies the cost of copying a value
between two registers in the specific class.

llvm-svn: 42123
2007-09-19 01:35:01 +00:00
Devang Patel
339bee9291 Relax loop ExitCondition predicate restriction.
llvm-svn: 42122
2007-09-19 00:28:47 +00:00
Devang Patel
2883f5cc94 Filter loops where split condition's false branch is not empty. For example
for (int i = 0; i < N; ++i) {
  if (i == somevalue)
    dosomething();
   else
    dosomethingelse();
}

llvm-svn: 42121
2007-09-19 00:15:16 +00:00
Devang Patel
03df2adc31 Bail out early, before modifying anything.
llvm-svn: 42120
2007-09-19 00:11:01 +00:00
Devang Patel
9806df698b Work is incomplete. Loop is not modified at all right now.
llvm-svn: 42119
2007-09-19 00:08:13 +00:00
Devang Patel
d9c8d99cac ooops...
llvm-svn: 42118
2007-09-18 23:58:14 +00:00
Evan Cheng
28a7839505 Clean up.
llvm-svn: 42112
2007-09-18 22:56:31 +00:00
Evan Cheng
2716b97b13 Fix a bogus splat xform:
shuffle <undef, undef, x, undef>, <undef, undef, undef, undef>, <2, 2, 2, 2>
!=
<undef, undef, x, undef>

llvm-svn: 42111
2007-09-18 21:54:37 +00:00
Gabor Greif
fd6f1faeeb rename test, it is obviously misspelled
llvm-svn: 42108
2007-09-18 21:42:39 +00:00
Dale Johannesen
83b2001d42 Prevent crash on long double.
llvm-svn: 42103
2007-09-18 18:36:59 +00:00
Gordon Henriksen
9deea8ed1a Tests of the ocaml (and thus C) bindings for constants.
llvm-svn: 42101
2007-09-18 18:07:51 +00:00
Dan Gohman
be3b005b2d Move the entries for 64-bit CMP, IMUL, and a few others into the correct
tables so that they are eligible for reload/remat folding. And add
entries for JMP and CALL.

llvm-svn: 42094
2007-09-18 14:59:14 +00:00
Gordon Henriksen
29fe360b5a Adding ocaml language bindings for the vmcore and bitwriter libraries. These are
built atop the C language bindings, and user programs can link with them as 
such:

  # Bytecode
  ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml
  # Native
  ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml

The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately,
they're not yet numerous enough to write hello world. But:

  $ cat example.ml
  (* example.ml *)
  
  open Llvm
  open Llvm_bitwriter
  
  let _ =
    let filename = Sys.argv.(1) in
    let m = create_module filename in
    
    let v = make_int_constant i32_type 42 false in
    let g = define_global "hello_world" v m in
    
    if not (write_bitcode_file m filename) then exit 1;
    
    dispose_module m;

  $ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml
  File "example.ml", line 11, characters 6-7:
  Warning Y: unused variable g.
  $ ./example example.bc
  $ llvm-dis < example.bc
  ; ModuleID = '<stdin>'
  @hello_world = global i32 42            ; <i32*> [#uses=0]

The ocaml test cases provide effective tests for the C interfaces.

llvm-svn: 42093
2007-09-18 12:49:39 +00:00
Gordon Henriksen
e37b21e71e Regenerate.
llvm-svn: 42092
2007-09-18 12:27:13 +00:00
Gordon Henriksen
a4dc26587e (no commit message)
llvm-svn: 42091
2007-09-18 12:26:59 +00:00
Gordon Henriksen
a8db66a37a (no commit message)
llvm-svn: 42090
2007-09-18 12:26:17 +00:00
Gordon Henriksen
765525cc71 Incorporating review feedback for GC verifier patch.
llvm-svn: 42087
2007-09-18 10:14:30 +00:00
Bill Wendling
bfd2f2f6d7 Don't pass back a reference to a temporary.
llvm-svn: 42086
2007-09-18 09:10:16 +00:00
Bill Wendling
b3730d75be Update my entry.
llvm-svn: 42079
2007-09-18 05:28:19 +00:00
Bill Wendling
537b869514 The exception handling function info should be reset for each new
function. The information isn't used heavily -- it's only used at the end
of exception handling emission -- so there's no need to cache it.

llvm-svn: 42078
2007-09-18 05:03:44 +00:00
Gordon Henriksen
3dc9d9f145 C bindings for libLLVMCore.a and libLLVMBitWriter.a.
- The naming prefix is LLVM.
- All types are represented using opaque references.
- Functions are not named LLVM{Type}{Method}; the names became
  unreadable goop. Instead, they are named LLVM{ImperativeSentence}.
- Where an attribute only appears once in the class hierarchy (e.g.,
  linkage only applies to values; parameter types only apply to
  function types), the class is omitted from identifiers for
  brevity. Tastes like methods.
- Strings are C strings or string/length tuples on a case-by-case
  basis.
- APIs which give the caller ownership of an object are not mapped
  (removeFromParent, certain constructor overloads). This keeps
  keep memory management as simple as possible.

For each library with bindings:

  llvm-c/<LIB>.h       - Declares the bindings.
  lib/<LIB>/<LIB>.cpp  - Implements the bindings.

So just link with the library of your choice and use the C header
instead of the C++ one.

llvm-svn: 42077
2007-09-18 03:18:57 +00:00
Gordon Henriksen
25f8bcd5ee Fixing an comment in Module.h that refers to a nonexistent parameter.
Also adding some missing svn:ignores that've been bothering me.

llvm-svn: 42076
2007-09-18 02:09:34 +00:00
Devang Patel
4014965efb Fix PR1657
llvm-svn: 42075
2007-09-18 01:54:42 +00:00
Bill Wendling
803e0d9970 Objective-C was generating EH frame info like this:
"_-[NSString(local) isNullOrNil]".eh = 0
        .no_dead_strip  "_-[NSString(local) isNullOrNil]".eh

The ".eh" should be inside the quotes.

llvm-svn: 42074
2007-09-18 01:47:22 +00:00
Bill Wendling
d269356b02 Add support for appending a suffix to the end of a mangled name.
llvm-svn: 42071
2007-09-17 22:39:32 +00:00
Evan Cheng
33c343e06b Bug fix and minor clean up of generated code.
llvm-svn: 42069
2007-09-17 22:26:41 +00:00
Devang Patel
547d418b8e Do not hide APInt::dump() inside #ifndef NDEBUG.
llvm-svn: 42068
2007-09-17 22:24:00 +00:00
Tanya Lattner
8748fd73b2 Fix broken default help strings for enable-shared, enable-static, and enable-fast-install. Regenerate configure script.
llvm-svn: 42066
2007-09-17 21:41:15 +00:00
Devang Patel
578a1ae12a Do not eliminate loop when it is invalid to do so. For example,
for(int i = 0; i < N; i++) {
	if ( i == XYZ) {
		A;
	else
		B;
	}
	C;
	D;
}

llvm-svn: 42058
2007-09-17 21:01:05 +00:00
Devang Patel
14b9a01c02 Skeleton for transformations to truncate loop's iteration space.
llvm-svn: 42054
2007-09-17 20:39:48 +00:00
Gordon Henriksen
fa3a5915b1 Fix for PR1633: Verifier doesn't fully verify GC intrinsics
LLVM now enforces the following prototypes for the write barriers:

<ty>* @llvm.gcread(<ty2>*, <ty>**)
void @llvm.gcwrite(<ty>*, <ty2>*, <ty>**)

And for @llvm.gcroot, the first stack slot is verified to be an alloca or a 
bitcast of an alloca.

Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these.

llvm-svn: 42051
2007-09-17 20:30:04 +00:00
Dale Johannesen
46adce144c Remove RSTRegClass case from loadRegFromStackSlot
and storeRegToStackSlot.  Evan and I concluded this
should never be needed and it appears to be true.
(It if is needed, adjustment would be needed for
long double to work.)

llvm-svn: 42049
2007-09-17 20:15:38 +00:00
Devang Patel
f4411aa165 Fix comment.
llvm-svn: 42048
2007-09-17 20:07:40 +00:00
Devang Patel
c7cfb7ebfc This is not ideal but unbreaks build failure.
APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump() routines are not.

llvm-svn: 42047
2007-09-17 20:03:03 +00:00
Dale Johannesen
9ce8a9d633 Implement x86 long double in jit (not really
complete, but common cases work)

llvm-svn: 42043
2007-09-17 18:44:13 +00:00
Chris Lattner
cc315726f7 Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.

llvm-svn: 42042
2007-09-17 18:34:04 +00:00
Daniel Berlin
a19af373e3 That's what i get for using carbon emacs in a terminal
llvm-svn: 42040
2007-09-17 18:05:59 +00:00
Daniel Berlin
d26deb0a6d Fix iterator so it doesn't sometimes report bits that aren't in the bitmap
llvm-svn: 42039
2007-09-17 18:04:21 +00:00
Dan Gohman
81b5cda0aa Add a utility function to SDOperand for testing if a value is unused.
llvm-svn: 42038
2007-09-17 17:44:31 +00:00
Evan Cheng
d7742e7939 X86ISD::TEST is dead.
llvm-svn: 42037
2007-09-17 17:42:53 +00:00
Chris Lattner
9a1b882091 regenerate
llvm-svn: 42036
2007-09-17 17:40:48 +00:00
Dan Gohman
2de5779a99 Instcombine x-((x/y)*y) into a remainder operator.
llvm-svn: 42035
2007-09-17 17:31:57 +00:00
Gordon Henriksen
4a96367fca Adding myself to credits.
llvm-svn: 42032
2007-09-17 17:04:44 +00:00
Dan Gohman
b096221b3e Add 64-bit jmp instructions to the list of instructions that
can terminate a block with no fall-through.

llvm-svn: 42029
2007-09-17 15:19:08 +00:00
Dan Gohman
41a6dea029 Use xorl instead of xorq to enter a zero into a 64-bit register.
llvm-svn: 42027
2007-09-17 14:55:08 +00:00
Dan Gohman
1aeaeec570 Emit integer x<1 as x<=0, as comparisons with zero (now includeing
64-bit) can use test instead of cmp with an immediate.

llvm-svn: 42026
2007-09-17 14:49:27 +00:00
Dan Gohman
b9449c9118 Use "test reg,reg" in place of "cmp reg,0" for 64-bit operands. This was
previously only done for 32-bit and smaller operands.

llvm-svn: 42024
2007-09-17 14:35:24 +00:00
Duncan Sands
901cb2662d Factor the trampoline transformation into a subroutine.
llvm-svn: 42021
2007-09-17 10:26:40 +00:00
Dale Johannesen
0ea2cc2e51 Implement x86 long double (uses host long double,
so only works on x86 target).

llvm-svn: 42019
2007-09-17 00:38:27 +00:00
Daniel Berlin
d44b2016ca Fix bug in andersen's related to test_and_set.
Add operator == and != to SparseBitVector.
Simplify code for test_and_set

llvm-svn: 42018
2007-09-16 23:59:53 +00:00