Commit Graph

34850 Commits

Author SHA1 Message Date
Duncan Sands 2be91fcdd8 Place SCCPSolver also in the anonymous namespace. This
pacifies g++-4.2.

llvm-svn: 40089
2007-07-20 08:56:21 +00:00
Owen Anderson 5bd6c3f2c4 Fix a bug where we were marking GEP expressions with the wrong opcode.
llvm-svn: 40085
2007-07-20 08:19:20 +00:00
Owen Anderson edb926bfe3 When removing instructions from the analysis, be sure to check the confirmed
flag when determining what to do with dependencies.

llvm-svn: 40079
2007-07-20 06:16:07 +00:00
Evan Cheng f195429a0e New test.
llvm-svn: 40077
2007-07-20 00:27:56 +00:00
Evan Cheng 8fefeffb37 Because we promote SSE logical ops and loads to v2i64, we often end up generate
code that cross integer / floating point domains (e.g. generate pxor / pand for
logical ops on floating point value, movdqa to load / store floating point SSE
values). Given that, it's better to use movaps instead of movdqa and movups
instead of movdqu. They have the same latency but the "aps" variants are one
byte shorter.
If the domain crossing problem is a real performance issue, then we will have to
fix it with dynamic programming based isel.

llvm-svn: 40076
2007-07-20 00:27:43 +00:00
Evan Cheng 869852b03e No need for noResults anymore.
llvm-svn: 40075
2007-07-20 00:21:23 +00:00
Evan Cheng 9081ab8127 Oops. These stores actually produce results.
llvm-svn: 40074
2007-07-20 00:20:46 +00:00
Evan Cheng a39fd10e32 New test.
llvm-svn: 40073
2007-07-19 23:53:50 +00:00
Evan Cheng 8ab393548f Try fixing it again.
llvm-svn: 40072
2007-07-19 23:53:29 +00:00
Evan Cheng 64738536b3 Fix custom lowering of SSE FXOR.
llvm-svn: 40071
2007-07-19 23:36:01 +00:00
Evan Cheng 7ca3555bfa Fix patterns so we isel the xorps, etc. for floating pt logical SSE ops. DAG combiner may fold away the (bit_convert (load)).
llvm-svn: 40070
2007-07-19 23:34:10 +00:00
Reid Spencer 314e1cb7ee For PR1553:
Change the keywords for the zext and sext parameter attributes to be 
zeroext and signext so they don't conflict with the keywords for the
instructions of the same name. This gets around the ambiguity.

llvm-svn: 40069
2007-07-19 23:13:04 +00:00
Chris Lattner f2e101f164 implement size/alignment analysis for arrays and vectors. This gets carbon.h working again.
llvm-svn: 40068
2007-07-19 22:06:24 +00:00
Steve Naroff 57eb2c5f58 Finish fixing crasher with compound literals.
We still need to do sematic analysis (and implement initializers), however this 
should complete the parsing & ast building for compound literals.

llvm-svn: 40067
2007-07-19 21:32:11 +00:00
Reid Spencer 68ee4e8efc Hush a noisy warning from GCC 4.2 about overflow during conversion by using
the type "unsigned" instead of uintptr_t for a 1-bit structure field.

llvm-svn: 40066
2007-07-19 21:05:30 +00:00
Owen Anderson f9e6542969 Make val_replace fail early, which reduces the time to optimize 403.gcc to 14.8s.
llvm-svn: 40064
2007-07-19 19:57:13 +00:00
Bill Wendling dd96b98bf6 Don't need the "&&" to glue lines together.
llvm-svn: 40063
2007-07-19 18:06:26 +00:00
Devang Patel a273d1cd3a Verify loop info.
llvm-svn: 40062
2007-07-19 18:02:32 +00:00
Chris Lattner 24dbee71ab Fix a stringizing bug that Neil noticed. We should preprocess this:
#define t(x) #x
t(a
c)

to "a c", not "ac".

llvm-svn: 40060
2007-07-19 16:11:58 +00:00
Anton Korobeynikov b4acc033cf Properly initialize value :)
llvm-svn: 40059
2007-07-19 15:32:47 +00:00
Duncan Sands 60f28bff4c Replace mysterious code causing a g++-4.2 warning
with hopefully correct code that pleases g++-4.2.

llvm-svn: 40051
2007-07-19 09:42:01 +00:00
Duncan Sands 42f7a9c379 Fix this test. We produce pretty cruddy code for this
nowadays, unfortunately it's not so easy to get good
code here while still producing correct code in exotic
situations.

llvm-svn: 40050
2007-07-19 09:38:34 +00:00
Duncan Sands 85ec2af554 As pointed out by g++-4.2, the original code didn't do
what it thought it was doing.

llvm-svn: 40044
2007-07-19 07:31:58 +00:00
Owen Anderson ee99010782 Remember to free the heap allocated array if we're not going to use it.
llvm-svn: 40043
2007-07-19 06:45:33 +00:00
Owen Anderson 6aa17f1def Use SmallVector and DenseMap in even more places.
With this, the time to optimize 403.gcc is down to 15.1s.

llvm-svn: 40042
2007-07-19 06:37:56 +00:00
Bill Wendling e8ea3303ce Testcase for PR1549
llvm-svn: 40041
2007-07-19 06:31:11 +00:00
Owen Anderson 75a244d6eb Change ValueTable to use a DenseMap for mapping expressions to value numbers.
This results in a slight speedup for 403.gcc.

llvm-svn: 40040
2007-07-19 06:13:15 +00:00
Devang Patel ef43253e2e Set up ground work to verify preserved analysis info.
llvm-svn: 40039
2007-07-19 05:36:09 +00:00
Chris Lattner 2ac26568d4 silence a warning by treating ocuvectors the same as vectors.
llvm-svn: 40037
2007-07-19 05:13:51 +00:00
Owen Anderson 6a4ff8549b Move some sets and maps to SmallPtrSet and DenseMap respectively. This
reduces the time to optimize 403.gcc from 17.6s to 16.4s.

llvm-svn: 40036
2007-07-19 03:32:44 +00:00
Devang Patel 186e0d8b0a After a basic block is split into two parts,
second part dominates all the blocks dominated
by original basic block. And first part dominates
second part.

llvm-svn: 40035
2007-07-19 02:29:24 +00:00
Devang Patel de5901523c Now this temp. fix is not required.
llvm-svn: 40034
2007-07-19 02:22:21 +00:00
Evan Cheng 94b5a80b93 Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr  : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
                 "add{l} {$src2, $dst|$dst, $src2}",
                 [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr  : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
                 "add{l} {$src2, $dst|$dst, $src2}",
                 [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;

llvm-svn: 40033
2007-07-19 01:14:50 +00:00
Steve Naroff fbd098332c Work towards fixing crasher with compound literals...
Before this commit, we crashed in ParseBinOp...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang -parse-ast-check compound_literal.c
SemaExpr.cpp:1298: failed assertion `(rhs != 0) && "ParseBinOp(): missing right expression"'

With this commit, we still crash in the newly added action ParseCompoundLiteral (which is progress:-)

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang -parse-ast-check compound_literal.c
SemaExpr.cpp:478: failed assertion `(Op != 0) && "ParseCompoundLiteral(): missing expression"'

The crash go away once the actions return AST nodes. I will do this in a separate commit.

llvm-svn: 40032
2007-07-19 01:06:55 +00:00
Evan Cheng 22b0c344db Only adjust esp around calls in presence of alloca.
llvm-svn: 40030
2007-07-19 00:42:58 +00:00
Chris Lattner 5fbd7e0264 Fix a crasher that Neil reported: Sema::GetTypeForDeclarator should never
return a null type.  If there is an error parsing the type, pick a new type
for error recovery purposes.

llvm-svn: 40029
2007-07-19 00:42:40 +00:00
Evan Cheng 7b5b06805a Only adjust esp around calls in presence of alloca.
llvm-svn: 40028
2007-07-19 00:42:05 +00:00
Chris Lattner 5e62929fed Make sure to initialize an ivar, patch by Benoit Boissinot.
llvm-svn: 40027
2007-07-19 00:11:19 +00:00
Chris Lattner 5c98379b1c Correctly respect C99 5.1.1.2p4 when searching for the first '(' of
a function-like macro invocation.  Patch contributed by Neil Booth.

llvm-svn: 40026
2007-07-19 00:07:36 +00:00
Devang Patel 8a1d1ac925 Fix typo.
llvm-svn: 40025
2007-07-18 23:50:19 +00:00
Devang Patel bb8ea8cefc Fix dominator info update to accommodate CFG changes.
This fixes PR1559.

llvm-svn: 40024
2007-07-18 23:48:20 +00:00
Devang Patel 86dff8f8be New test.
llvm-svn: 40023
2007-07-18 23:47:02 +00:00
Evan Cheng a8d152a22a Add comment.
llvm-svn: 40022
2007-07-18 23:34:48 +00:00
Evan Cheng dcc3451f8a New test.
llvm-svn: 40020
2007-07-18 21:39:16 +00:00
Evan Cheng 8941071ae1 Use MOV instead of LEA to restore ESP if callee-saved frame size is 0; if previous instruction updates esp, fold it in.
llvm-svn: 40018
2007-07-18 21:26:06 +00:00
Dan Gohman 68659280fa Add constructor overloads for LoadInst and StoreInst that insert at the
end of a BasicBlock and have an alignment parameter.

llvm-svn: 40016
2007-07-18 20:51:11 +00:00
Dan Gohman 776962a97a Implement initial memory alignment awareness for SSE instructions. Vector loads
and stores that have a specified alignment of less than 16 bytes now use
instructions that support misaligned memory references.

llvm-svn: 40015
2007-07-18 20:23:34 +00:00
Owen Anderson e21f270858 Fix an issue where assignments that caused a SmallPtrSet to become non-small
would result in calling realloc() on a null pointer.  Instead, if we encounter
this situation, make a normal call to malloc().

llvm-svn: 40014
2007-07-18 19:54:15 +00:00
Chris Lattner 0f0019c36e implement i-c-e correct evaluation for sizeof/alignof, remove some obsolete fixme's.
llvm-svn: 40012
2007-07-18 18:38:36 +00:00
Chris Lattner 647fb22611 implement sizeof/alignof support for structs, unions and complex.
This allows us to compile this:

struct abc { char A; double D; };

int foo() {
  return sizeof(struct abc);
  return __alignof__(struct abc);
}

Into:

        ret i32 16
        ret i32 8

llvm-svn: 40010
2007-07-18 18:26:58 +00:00