Commit Graph

34396 Commits

Author SHA1 Message Date
Evan Cheng
17207ddf38 Enable if-conversion for ARM by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 00:48:22 +00:00
Dale Johannesen
73328d14ac More long double fixes. x86_64 should build now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 23:55:34 +00:00
Evan Cheng
e71bff7405 Avoid referencing deleted instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 21:48:07 +00:00
Ted Kremenek
96345186a5 Previously GraphWriter assumed operator*() for node_iterator always
returned a reference type.  This patch allows operator*() to return a
non-reference type while still maintaining the old behavior when it
does return a reference type.

This patch was motivated when I tried to use "df_iterator" (see
llvm/ADT/DepthFirstIterator.h) as a "node_iterator", as df_iterator
does not return a reference type and thus we would get a compilation
error when trying to take the address of a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 21:26:49 +00:00
Devang Patel
f2038b1d93 Avoid unsafe promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42149 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 20:18:51 +00:00
Evan Cheng
fab7eff0fa PSHUFDmi, etc. are actually folding a load, not a store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42147 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 19:02:47 +00:00
Dale Johannesen
f4d4832724 Fix longdouble -> uint conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 17:53:26 +00:00
Chris Lattner
6693da003b reject things like "declare internal @foo"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42140 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 17:14:45 +00:00
Owen Anderson
742f9b6682 Add a flag to mark a dirty cache entry. This is not yet used, but will eventually
help non-local memdep caching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42137 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 16:13:57 +00:00
Dale Johannesen
ac1220551f Fix some long double issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 14:22:58 +00:00
Duncan Sands
46318cdfd0 Improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42132 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 10:25:38 +00:00
Duncan Sands
7801644332 Partial fix for PR1678: correct some parts of constant
fold that were missed in the fix for PR1646.  Probably
this null/not-null logic should be factorized somewhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 10:16:17 +00:00
Duncan Sands
892c7e4a23 A global variable with external weak linkage can be null, while
an alias could alias such a global variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 10:10:31 +00:00
Gabor Greif
9dbf8ed140 include alloca.h if available. this helps Solaris, but intnat and uintnat types are still undefined, causing errors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 09:29:58 +00:00
Duncan Sands
437c27cd9d Testcase for PR1678.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42128 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 07:43:17 +00:00
Evan Cheng
713a98dee8 Use struct SDep instead of std::pair for SUnit pred and succ lists. First step
in tracking physical register output dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 01:38:40 +00:00
Evan Cheng
dcfa73fe3c Set CCR (EFLAGS) copy cost to -1, i.e. extremely expensive to copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42124 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 01:36:39 +00:00
Evan Cheng
a3ca3149f2 Add CopyCost to TargetRegisterClass. This specifies the cost of copying a value
between two registers in the specific class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 01:35:01 +00:00
Devang Patel
babbe27007 Relax loop ExitCondition predicate restriction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42122 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 00:28:47 +00:00
Devang Patel
968eee2aa7 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();
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 00:15:16 +00:00
Devang Patel
84ef08bfee Bail out early, before modifying anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 00:11:01 +00:00
Devang Patel
4e062e520a Work is incomplete. Loop is not modified at all right now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42119 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 00:08:13 +00:00
Devang Patel
0f2fb60a18 ooops...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42118 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 23:58:14 +00:00
Evan Cheng
921c85c487 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 22:56:31 +00:00
Evan Cheng
e0480d2ec2 Fix a bogus splat xform:
shuffle <undef, undef, x, undef>, <undef, undef, undef, undef>, <2, 2, 2, 2>
!=
<undef, undef, x, undef>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 21:54:37 +00:00
Gabor Greif
d84c3ab4a7 rename test, it is obviously misspelled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 21:42:39 +00:00
Dale Johannesen
c7b21d520a Prevent crash on long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 18:36:59 +00:00
Gordon Henriksen
344be5fbec Tests of the ocaml (and thus C) bindings for constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42101 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 18:07:51 +00:00
Dan Gohman
869b2b2c23 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 14:59:14 +00:00
Gordon Henriksen
8ef426baa3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 12:49:39 +00:00
Gordon Henriksen
54c7e12164 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42092 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 12:27:13 +00:00
Gordon Henriksen
75155ef56d git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42091 91177308-0d34-0410-b5e6-96231b3b80d8 2007-09-18 12:26:59 +00:00
Gordon Henriksen
0908d49c22 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42090 91177308-0d34-0410-b5e6-96231b3b80d8 2007-09-18 12:26:17 +00:00
Gordon Henriksen
b5085212b0 Incorporating review feedback for GC verifier patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 10:14:30 +00:00
Bill Wendling
ce613280f9 Don't pass back a reference to a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42086 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 09:10:16 +00:00
Bill Wendling
ce0228de0d Update my entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42079 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 05:28:19 +00:00
Bill Wendling
5f19cf5df8 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 05:03:44 +00:00
Gordon Henriksen
8b94a14a78 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42077 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 03:18:57 +00:00
Gordon Henriksen
04bdf20ec1 Fixing an comment in Module.h that refers to a nonexistent parameter.
Also adding some missing svn:ignores that've been bothering me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 02:09:34 +00:00
Devang Patel
e3bfb88898 Fix PR1657
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 01:54:42 +00:00
Bill Wendling
6e19896999 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 01:47:22 +00:00
Bill Wendling
ecd9137758 Add support for appending a suffix to the end of a mangled name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 22:39:32 +00:00
Evan Cheng
30729b48d4 Bug fix and minor clean up of generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 22:26:41 +00:00
Devang Patel
8feb1f4467 Do not hide APInt::dump() inside #ifndef NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 22:24:00 +00:00
Tanya Lattner
856585b6d6 Fix broken default help strings for enable-shared, enable-static, and enable-fast-install. Regenerate configure script.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 21:41:15 +00:00
Devang Patel
8893ca6dab 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;
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 21:01:05 +00:00
Devang Patel
5279d064bc Skeleton for transformations to truncate loop's iteration space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 20:39:48 +00:00
Gordon Henriksen
8c33da5dc4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 20:30:04 +00:00
Dale Johannesen
ca8035e356 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.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42049 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 20:15:38 +00:00
Devang Patel
161660e6d2 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42048 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 20:07:40 +00:00