Commit Graph

35476 Commits

Author SHA1 Message Date
Evan Cheng af21e9550e No need to remove dead range from soon-to-be-dead live interval. Its val# may be out of whack.
llvm-svn: 41024
2007-08-12 01:26:19 +00:00
Chris Lattner 460e34afed constant fold ptrtoint(inttoptr) with target data when available. This allows
us to fold the entry block of PR1602 to false instead of:

br i1 icmp eq (i32 and (i32 ptrtoint (void (%struct.S*)* inttoptr (i64
1 to void (%struct.S*)*) to i32), i32 1), i32 0), label %cond_next, label
%cond_true

llvm-svn: 41023
2007-08-11 23:49:01 +00:00
Chris Lattner 99c8ee2977 Transform a load from an undef/zero global into an undef/global even if we
have complex pointer manipulation going on.  This allows us to compile
stuff like this:

__m128i foo(__m128i x){
                static const unsigned int c_0[4] = { 0, 0, 0, 0 };
                __m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
                x  = _mm_unpacklo_epi8(x,  v_Zero);
                return x;
}

into:

_foo:
        xorps   %xmm1, %xmm1
        punpcklbw       %xmm1, %xmm0
        ret

llvm-svn: 41022
2007-08-11 18:48:48 +00:00
Chris Lattner 750b3dfcf5 expand a note
llvm-svn: 41021
2007-08-11 18:19:07 +00:00
Chris Lattner ee44ab5b5f With evan's explicit flag representation, hopefully we will finally be
able to 3-addressify away stuff like this:

        movl    %ecx, %eax
        decl    %eax

llvm-svn: 41020
2007-08-11 18:16:46 +00:00
Reid Spencer 3687007119 Now that llvm-ld can accept - as input from stdin, use this feature to extract
the pass arguments that it supports.

llvm-svn: 41019
2007-08-11 16:11:22 +00:00
Reid Spencer 2dc9f13278 Fix a comment typo noticed by Sandro Magi.
llvm-svn: 41018
2007-08-11 15:57:56 +00:00
Bill Wendling cdbd82ee37 64-bit SSSE3 ops that use MMX registers don't require 16-byte alignment.
Make a 'memop' pattern just for them.

llvm-svn: 41017
2007-08-11 09:52:53 +00:00
Evan Cheng 05cc486c7b Code to maintain kill information during register coalescing.
llvm-svn: 41016
2007-08-11 00:59:19 +00:00
Chris Lattner afada9b077 xfail this for now.
llvm-svn: 41015
2007-08-11 00:05:07 +00:00
Chris Lattner 6278e6ac30 start splitting out aggregate value computation from EmitExpr into EmitAggExpr.
aggregate value and scalar expression computation are very different, this
gets them away from each other.  This causes a temporary regression on some
complex number examples.

llvm-svn: 41014
2007-08-11 00:04:45 +00:00
Christopher Lamb 44e79f8aba Use subregs to improve any_extend code generation when feasible.
llvm-svn: 41013
2007-08-10 22:22:41 +00:00
Christopher Lamb 030a59d967 Fix test so it passes.
llvm-svn: 41012
2007-08-10 22:20:57 +00:00
Chris Lattner 11472debe9 make sure to add a newline at the end of the dump
llvm-svn: 41011
2007-08-10 21:51:12 +00:00
Christopher Lamb b372abab14 Increase efficiency of sign_extend_inreg by using subregisters for truncation. As the README suggests sign_extend_subreg is selected to (sext(trunc)).
llvm-svn: 41010
2007-08-10 21:48:46 +00:00
Christopher Lamb f0c236fb8a Edit README in light of previous LEA16 commit.
llvm-svn: 41009
2007-08-10 21:29:05 +00:00
Ted Kremenek 56c864e3fd Added "id_idx" parameter to CheckPrintfArguments. This will be used
by CheckPrintfArguments to determine if a given printf function
accepts a va_arg argument.

llvm-svn: 41008
2007-08-10 21:21:05 +00:00
Christopher Lamb d36d30b53c Add 2-addr to 3-addr promotion code that allows 32-bit LEA to be used via subregisters when 16-bit LEA is disabled.
llvm-svn: 41007
2007-08-10 21:18:25 +00:00
Ted Kremenek cfc9419dd4 Moved id_asprintf before id_vsnprintf in the enum used for indexing
KnownFunctionIDs.  This allows us to test for a printf-like function
that accepts a va_arg argument using a range comparison.

llvm-svn: 41006
2007-08-10 21:13:51 +00:00
Christopher Lamb e081928f49 Move isSubRegOf into MRegisterInfo. Fix a missed move elimination in LowerSubregs and add more debugging output there.
llvm-svn: 41005
2007-08-10 21:11:55 +00:00
Chris Lattner cccc311110 add support for a top-level __extension__ marker, implementing a todo.
llvm-svn: 41004
2007-08-10 20:57:02 +00:00
Chris Lattner b87b1b36ee initial support for checking format strings, patch by Ted Kremenek:
"I've coded up some support in clang to flag warnings for non-constant format strings used in calls to printf-like functions (all the functions listed in "man fprintf").  Non-constant format strings are a source of many security exploits in C/C++ programs, and I believe are currently detected by gcc using the flag -Wformat-nonliteral."

llvm-svn: 41003
2007-08-10 20:18:51 +00:00
Chris Lattner d79671fdf2 New file, just a placeholder for now.
llvm-svn: 41002
2007-08-10 20:13:28 +00:00
Devang Patel d305c404be Do not overuse std::string. Pass around char * directly.
llvm-svn: 41001
2007-08-10 18:29:32 +00:00
Chris Lattner ac9823bc5d Build ASTs before relexing the file. This avoids having comment finding mutate the
preprocessor state, causing bogus diagnostics when the file is parsed for real.  This
implements Misc/diag-checker.c.  Thanks to Ted for noticing this.

llvm-svn: 41000
2007-08-10 18:27:41 +00:00
Steve Naroff 47fea35e48 Make sure the arithmetic conversion are done for relation and equality operators.
This fixes the following...

eypedef short S;
int test(S X, long long Y) {
  return X < Y;
}

Before...

(CompoundStmt 0x2905d00
  (ReturnStmt 0x2905cf0
    (BinaryOperator 0x2905cd0 'int' '<'
      (ImplicitCastExpr 0x2905cc0 'int'
        (DeclRefExpr 0x2905c80 'S':'short' Decl='X' 0x2905c20))
      (DeclRefExpr 0x2905ca0 'long long' Decl='Y' 0x2905c50))))

After...

(CompoundStmt 0x2b05c30
  (ReturnStmt 0x2b05c20
    (BinaryOperator 0x2b05c00 'int' '<'
      (ImplicitCastExpr 0x2b05bf0 'long long'
        (DeclRefExpr 0x2b05bb0 'S':'short' Decl='X' 0x2b05b50))
      (DeclRefExpr 0x2b05bd0 'long long' Decl='Y' 0x2b05b80))))

llvm-svn: 40999
2007-08-10 18:26:40 +00:00
Devang Patel f417c2cc34 Clone loop.
llvm-svn: 40998
2007-08-10 18:07:13 +00:00
Devang Patel aa36a43908 Add utility to clone loops.
llvm-svn: 40997
2007-08-10 17:59:47 +00:00
Chris Lattner 213ef35a89 fix this test to pass.
llvm-svn: 40996
2007-08-10 17:18:58 +00:00
Chris Lattner 8eab8ff127 fix a codegen bug handling ocuvector element exprs.
llvm-svn: 40995
2007-08-10 17:10:08 +00:00
Chris Lattner e9a91ae4ea make this harder
llvm-svn: 40994
2007-08-10 17:02:59 +00:00
Chris Lattner 90d9120453 implement initial codegen for aggregate return functions. This implements
codegen for:

_Complex double bar(int);
void test(_Complex double*);

void test2(int c) {
  _Complex double X;
  X = bar(1);
  test(&X);
}

llvm-svn: 40993
2007-08-10 17:02:28 +00:00
Chris Lattner 02697701d9 Fix a bug handling function -> pointer decay and avoid emitting a noop
bitcast.

llvm-svn: 40992
2007-08-10 16:33:59 +00:00
Devang Patel 0b1af29f28 Add #ifndef guard.
llvm-svn: 40991
2007-08-10 15:58:23 +00:00
Chris Lattner 430826179c add #ifndef guards
llvm-svn: 40990
2007-08-10 15:53:08 +00:00
Chris Lattner 5109a88ac3 add Value::getNameStart/getNameLen() accessors.
llvm-svn: 40989
2007-08-10 15:34:35 +00:00
Dan Gohman 97b58e27e6 Add a test script for counting lines. This can be used instead of the
"| grep foo | wc -l | grep 2" idiom used by many tests, so that, for
example, tests don't mistakenly accept a count of 12 when 2 is
expected. Also, the new form is more consice: "| grep foo | count 2".

llvm-svn: 40988
2007-08-10 15:07:05 +00:00
Dan Gohman a17799a3bd Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to
use an intptr ValueType instead of i32 for the index operand in
getCopyToParts.

llvm-svn: 40987
2007-08-10 14:59:38 +00:00
Rafael Espindola 66011c17d5 propagate struct size and alignment of byval arguments to the DAG
llvm-svn: 40986
2007-08-10 14:44:42 +00:00
Bill Wendling 7014615087 For kicks, I though it would be fun to use the correct opcode.
llvm-svn: 40985
2007-08-10 09:00:17 +00:00
Chris Lattner 0c8aa5cd64 memcpy with zero length is hugely expensive, so avoid it. This speeds up coallescing from 1.17s to 0.88s on siod.
llvm-svn: 40984
2007-08-10 07:02:50 +00:00
Chris Lattner b21e76ecb1 small speedup in the case where a smallvector is default ctor'd from
an empty vector.  This speeds up llc slightly.

llvm-svn: 40983
2007-08-10 06:54:38 +00:00
Bill Wendling 2377206923 Adding SSSE3 intrinsics.
llvm-svn: 40982
2007-08-10 06:22:27 +00:00
Chris Lattner de2aa65877 minor simplifications.
llvm-svn: 40981
2007-08-10 06:22:25 +00:00
Chris Lattner dd6304f6b1 avoid copying strings.
llvm-svn: 40980
2007-08-10 06:17:04 +00:00
Devang Patel 9a4761464f Remove unncessary duplication.
llvm-svn: 40979
2007-08-10 00:59:03 +00:00
Devang Patel 7bdf4531bb Calculate exit and start value of true loop and false loop respectively.
llvm-svn: 40978
2007-08-10 00:53:35 +00:00
Devang Patel 67af6cd7ea ExitCondition and Induction variable are loop constraints
not split condition constraints.

llvm-svn: 40977
2007-08-10 00:33:50 +00:00
Chris Lattner 2b9fe84b07 unbreak the build
llvm-svn: 40976
2007-08-09 23:55:17 +00:00
Evan Cheng 1115a2b412 Bug fix. ~1U marks the val# dead.
llvm-svn: 40975
2007-08-09 23:14:39 +00:00