Commit Graph

60320 Commits

Author SHA1 Message Date
Eli Friedman 2892d82378 Remove more special cases for opcodes.
llvm-svn: 72468
2009-05-27 12:20:41 +00:00
Eli Friedman 3b251705fd Remove special cases for more opcodes.
llvm-svn: 72467
2009-05-27 07:58:35 +00:00
Eli Friedman 0e49431422 Removing more special cases from LegalizeDAG.
llvm-svn: 72465
2009-05-27 07:32:27 +00:00
Eli Friedman 568839681c Eliminate more special cases for opcodes.
llvm-svn: 72464
2009-05-27 07:05:37 +00:00
Eli Friedman 751aa72b72 Fix up constant expression handling to deal with the address
of a reference correctly.

llvm-svn: 72463
2009-05-27 06:04:58 +00:00
Eli Friedman 55422ad068 Add IRGen support for local variables of reference type.
llvm-svn: 72462
2009-05-27 05:39:06 +00:00
Douglas Gregor 5178331379 Initial stab at a generalized operation for determining the
instantiation of a declaration from the template version (or version
that lives in a template) and a given set of template arguments. This
needs much, much more testing, but it suffices for simple examples
like

  typedef T* iterator;
  iterator begin();

llvm-svn: 72461
2009-05-27 05:35:12 +00:00
Douglas Gregor 2517f334b4 Don't drop the computed implicit conversions when building a call to
overloaded operator[] or overloaded postfix unary operator (++,
--). Thanks to Eli for finding this bug!

llvm-svn: 72460
2009-05-27 05:00:47 +00:00
Eli Friedman b909bf4937 Add IRGen support for return statements in functions with reference
type.

llvm-svn: 72459
2009-05-27 04:56:12 +00:00
Anders Carlsson 4034a95dc8 Handle operator call expressions where the callee is a member function.
llvm-svn: 72458
2009-05-27 04:18:27 +00:00
Anders Carlsson d8b7ae205e Functions that return references can be rvalues as well.
llvm-svn: 72457
2009-05-27 03:37:57 +00:00
Eli Friedman d6f2834496 Remove more special cases from LegalizeDAG.
llvm-svn: 72456
2009-05-27 03:33:44 +00:00
Eli Friedman b3554158c5 Remove unused argument.
llvm-svn: 72455
2009-05-27 02:21:29 +00:00
Eli Friedman a8f9a0261e Remove more opcode special cases.
llvm-svn: 72454
2009-05-27 02:16:40 +00:00
Dan Gohman 28a9f80811 Add braces around an array initializer.
llvm-svn: 72453
2009-05-27 02:07:15 +00:00
Dan Gohman 1789362d70 Teach SCEVExpander to avoid creating over-indexed GEP indices when
possible. For example, it now emits

  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %tmp, i64 1

instead of the equivalent but less obvious

  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19

llvm-svn: 72452
2009-05-27 02:00:53 +00:00
Dan Gohman 776e4c8d35 Teach BasicAliasAnalysis to understand constant gep indices that fall
beyond their associated static array type.

I believe that this fixes a legitimate bug, because BasicAliasAnalysis
already has code to check for this condition that works for non-constant
indices, however it was missing the case of constant indices. With this
change, it checks for both.

This fixes PR4267, and miscompiles of SPEC 188.ammp and 464.h264.href.

llvm-svn: 72451
2009-05-27 01:48:27 +00:00
Anders Carlsson ace7215dd4 Add another test.
llvm-svn: 72450
2009-05-27 01:46:48 +00:00
Anders Carlsson 4ae70ff9a3 Add support for emitting calls to functions that return references (as lvalues only for now)
llvm-svn: 72449
2009-05-27 01:45:47 +00:00
Mike Stump 3e97f3b35d Fix typo. I also fixed the hard to read case differences, so that no
one else is tempted to copy the style, incorrectly.

llvm-svn: 72448
2009-05-27 01:42:21 +00:00
Eli Friedman 21d349b3c5 Start of refactoring LegalizeDAG so that we don't need specialized
handling for every single opcode.

llvm-svn: 72447
2009-05-27 01:25:56 +00:00
Anders Carlsson 3a9463bfda Rename an EmitCallExpr function to EmitCall to make it clear that it doesn't emit an expr.
llvm-svn: 72446
2009-05-27 01:22:39 +00:00
Eli Friedman acb851a8c0 Don't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
FP_TO_XINT.  Necessary for some cleanups I'm working on.  Updated 
from the previous version (r72431) to fix a bug and make some things a 
bit clearer.

llvm-svn: 72445
2009-05-27 00:47:34 +00:00
Mike Stump de79ea2f51 Update comment.
llvm-svn: 72444
2009-05-26 23:35:31 +00:00
Dale Johannesen af4fa989e4 Testcase for (llvm-gcc-4.2) 72442 (PR 4242).
llvm-svn: 72443
2009-05-26 23:19:19 +00:00
Mike Stump 6adbd62790 And an additional testcase that also works.
llvm-svn: 72441
2009-05-26 23:10:55 +00:00
Douglas Gregor 408c619afc Template instantiation for "typeof" for both types and expressions.
llvm-svn: 72440
2009-05-26 22:09:24 +00:00
Mike Stump ec3cbfe8c6 Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).
llvm-svn: 72439
2009-05-26 22:03:21 +00:00
Douglas Gregor c44ba89397 A simple dynamic array class template, to be used as a test-bed for template instantiation
llvm-svn: 72437
2009-05-26 21:27:04 +00:00
Daniel Dunbar d96b117872 Back out r72431, it is causing a number of compilation crashes with clang.
llvm-svn: 72436
2009-05-26 21:27:02 +00:00
Stefanus Du Toit 96180b5387 Update CPU capabilities for AMD machines
- added processors k8-sse3, opteron-sse3, athlon64-sse3, amdfam10, and
barcelona with appropriate sse3/4a levels
- added FeatureSSE4A for amdfam10 processors
in X86Subtarget:
- added hasSSE4A
- updated AutoDetectSubtargetFeatures to detect SSE4A
- updated GetCurrentX86CPU to detect family 15 with sse3 as k8-sse3 and
family 10h as amdfam10

New processor names match those used by gcc.

Patch by Paul Redmond!

llvm-svn: 72434
2009-05-26 21:04:35 +00:00
Douglas Gregor 28ad4b5da1 Make sure that CodeGen sees template instantiations.
llvm-svn: 72433
2009-05-26 20:50:29 +00:00
Daniel Dunbar bee70bd1e7 Use .data() instead of &...[0].
- Just SmallVectors this time.

llvm-svn: 72432
2009-05-26 19:40:20 +00:00
Eli Friedman 8c7bff96ed Don't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
FP_TO_XINT.  Necessary for some cleanups I'm working on. 

llvm-svn: 72431
2009-05-26 19:18:56 +00:00
Torok Edwin 49db738833 For the new ar --plugin libLLVMgold.so to work we need libLTO linked with
pthreads, otherwise ar complains of unresolved references to pthread_mutex_*.
LTO doesn't actually use pthreads, but ManagedStatic does.

Fix this by linking in LIBS (that contains pthreads) for LTO and gold.
For now this links in more libs than needed (libffi for example), we can figure
out later how to link in those libs per-tool later.

llvm-svn: 72430
2009-05-26 19:11:47 +00:00
Mike Stump 25306cacc6 Esnure that if we have a volatile structure as the destination, that
we actually have a destination.

llvm-svn: 72429
2009-05-26 18:57:45 +00:00
Douglas Gregor 31cf12c0a6 When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.

llvm-svn: 72428
2009-05-26 18:54:04 +00:00
Jeffrey Yasskin 7d287cb7ed LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many
entries as there are basic blocks in the function.  LiveVariables::getVarInfo
creates a VarInfo struct for every register in the function, leading to
quadratic space use.  This patch changes the BitVector to a SparseBitVector,
which doesn't help the worst-case memory use but does reduce the actual use in
very long functions with short-lived variables.

llvm-svn: 72426
2009-05-26 18:27:15 +00:00
Daniel Dunbar fed44d215e Revert to using &...[0] for std::vector, apparently .data isn't generally
available (and it isn't necessary in this case).

llvm-svn: 72425
2009-05-26 18:00:25 +00:00
Dan Gohman 2a6606ca20 For the return type of SCEVUDivExpr, use the RHS' type instead of
that of the LHS. It doesn't matter for correctness, but the LHS
is more likely than the RHS to be a pointer type in exotic cases,
and it's more tidy to have it return the integer type.

llvm-svn: 72424
2009-05-26 17:44:05 +00:00
Dan Gohman fae6edc6f2 Give SCEVNaryExpr a doxygen comment.
llvm-svn: 72423
2009-05-26 17:42:32 +00:00
Dan Gohman 9fe212806b In cases where a pointer value is an operand of a multiplication or
division operation, don't attempt to use the operation's value as
the base of a getelementptr. This fixes PR4271.

llvm-svn: 72422
2009-05-26 17:41:16 +00:00
Daniel Dunbar 33794edae7 Use .data() vs &...[0]
llvm-svn: 72420
2009-05-26 17:13:50 +00:00
Daniel Dunbar 1518b64ddc When trying to pass an argument on the stack, assume LLVM will do the right
thing for non-aggregate types.
 - Otherwise we unnecessarily pin values to the stack and currently end up
   triggering a backend bug in one case.

 - This loose cooperation with LLVM to implement the ABI is pretty ugly.

 - <rdar://problem/6918722> [irgen] clang miscompile of many pointer varargs on
   x86-64

llvm-svn: 72419
2009-05-26 16:37:37 +00:00
Daniel Dunbar f7323f3f65 The driver/diagnostic client don't need to be on the heap.
llvm-svn: 72418
2009-05-26 16:15:44 +00:00
Anders Carlsson 09ac6f21c3 An Obj-C message send expression can never have a reference type.
llvm-svn: 72417
2009-05-26 15:22:25 +00:00
Douglas Gregor a30d046059 Simplify printing of the statistics for types.
llvm-svn: 72415
2009-05-26 14:40:08 +00:00
Eli Friedman 4a951bf2ad Delete a bunch of dead code from LegalizeDAG.
llvm-svn: 72414
2009-05-26 08:55:52 +00:00
Eli Friedman 5cd659fd32 Fix for PR4140: Add the start of a Linux toolchain (basically, just
barely enough to get the given usage of -print-file-name working).

llvm-svn: 72412
2009-05-26 07:52:18 +00:00
Evan Cheng 7061ee968c Eliminate VarInfo::UsedBlocks.
llvm-svn: 72411
2009-05-26 06:25:46 +00:00