Commit Graph

35014 Commits

Author SHA1 Message Date
Owen Anderson 74f833bce1 Make the heuristic for shrinking DenseMap smarter.
llvm-svn: 40114
2007-07-20 18:56:46 +00:00
Chris Lattner 9802144709 Fix a valgrind error noticed by Benoit Boissinot
llvm-svn: 40113
2007-07-20 18:48:28 +00:00
Chris Lattner e60b21c0b5 remove some old cruft
llvm-svn: 40111
2007-07-20 18:26:45 +00:00
Chris Lattner ab41b13c90 fix a nasty bug Owen noticed in a gcc warning.
llvm-svn: 40110
2007-07-20 18:13:33 +00:00
Devang Patel 8adae86688 Use SmallVector instead of std::vector.
llvm-svn: 40109
2007-07-20 18:04:54 +00:00
Chris Lattner ca8ebc095b improve comments, implement a trivial single-entry cache in
SourceManager::getInstantiationLoc.  With this change, every token
expanded from a macro doesn't get its own MacroID.  :)

This reduces # macro IDs in carbon.h from 16805 to 9197

llvm-svn: 40108
2007-07-20 18:00:12 +00:00
Chandler Carruth 5dfeb9940c Fixing some differences between CVS and SVN diff'ing. Reid fixed these already,
but I think it got lost in the conversion mess.

llvm-svn: 40107
2007-07-20 17:21:54 +00:00
Chris Lattner f14d03f515 Update project for LexerToken.h -> Token.h
llvm-svn: 40106
2007-07-20 17:01:09 +00:00
Chris Lattner 146762e7a4 At one point there were going to be lexer and parser tokens.
Since that point is now long gone, we should rename LexerToken to
Token, as it is the only kind of token we have.

llvm-svn: 40105
2007-07-20 16:59:19 +00:00
Chris Lattner 77e9de50a1 simplify the lexer ctor to take a SLoc instead of a sloc and a redundant buffer*.
llvm-svn: 40104
2007-07-20 16:52:03 +00:00
Chris Lattner dc5c055fd1 Reimplement SourceLocation. Instead of having a
fileid/offset pair, it now contains a bit discriminating between
mapped locations and file locations.  This separates the tables for
macros and files in SourceManager, and allows better separation of
concepts in the rest of the compiler.  This allows us to have *many*
macro instantiations before running out of 'addressing space'.

This is also more efficient, because testing whether something is a
macro expansion is now a bit test instead of a table lookup (which
also used to require having a srcmgr around, now it doesn't).

This is fully functional, but there are several refinements and
optimizations left.

llvm-svn: 40103
2007-07-20 16:37:10 +00:00
Dan Gohman e31a61eeca Optimize alignment of loads and stores.
llvm-svn: 40102
2007-07-20 16:34:21 +00:00
Dan Gohman 45863cc202 Update these regression tests to accomodate X86InstrSSE.td now using movups/movaps
for everything.

llvm-svn: 40101
2007-07-20 16:31:26 +00:00
Owen Anderson 4b9cedcea5 Have DenseMap auto-shrink itself on clear(). This improves the time to optimize
403.gcc from 15.2s to 14.3s.

llvm-svn: 40100
2007-07-20 16:15:24 +00:00
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