Commit Graph

60243 Commits

Author SHA1 Message Date
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
Anders Carlsson 00a2759ca9 Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.
llvm-svn: 72410
2009-05-26 04:57:27 +00:00
Anders Carlsson 3b70b300b0 A block that returns a reference is an lvalue.
llvm-svn: 72409
2009-05-26 02:03:20 +00:00
Eli Friedman 895771aa4b Handle the edge case of a weak function with incomplete type correctly.
Found by code inspection; I haven't seen this in real-world code.

llvm-svn: 72408
2009-05-26 01:22:57 +00:00
Anders Carlsson b7e69b06b5 Remove a bunch of unused constructors
llvm-svn: 72407
2009-05-26 01:04:47 +00:00
Anders Carlsson 3562240952 Remove AstGuard.h from Xcode project.
llvm-svn: 72406
2009-05-26 00:57:47 +00:00
Eli Friedman 1fd785f564 Minor build system changes to make ABITest work correctly on Linux.
llvm-svn: 72405
2009-05-25 22:07:09 +00:00
Eli Friedman 1cae3df3cf Some minor corrections: don't use offsetof on a bitfield, and cast
printf operands to long to suppress warnings.

llvm-svn: 72404
2009-05-25 21:38:01 +00:00
Chris Lattner 02274a7171 make memdep use the getModRefInfo method for stores instead of the
low-level alias() method, allowing it to reason more aggressively
about pointers into constant memory.  PR4189

llvm-svn: 72403
2009-05-25 21:28:56 +00:00
Nick Lewycky 47be7d135c Audit the type constructors. Previously it was possible to create [0 x void]
or use labels as members of structures for example. Also included a couple of
whitespace fixes.

llvm-svn: 72402
2009-05-25 21:28:11 +00:00
Eli Friedman 7ab09572c6 Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.

llvm-svn: 72401
2009-05-25 21:27:19 +00:00
Chris Lattner 9b65031add add some late optimizations that GCC does. It thinks these are a win
even on Core2, not just AMD processors which was a surprise to me.

llvm-svn: 72396
2009-05-25 20:28:19 +00:00
Chris Lattner 9a3f3a5c3d fix typo
llvm-svn: 72395
2009-05-25 19:51:07 +00:00
Eli Friedman cf7530ff43 PR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
left out handling for stuff like (S())++ for the moment.

llvm-svn: 72394
2009-05-25 19:41:42 +00:00
Chris Lattner 23464b8f14 tweak non-null check to put the caret on the function, but underline the
argument.  This avoids the argument from being silenced when the argument is
the NULL macro, which is defined in a system header.  This also makes the output
a bit nicer, e.g.:

t.c:8:3: warning: null passed to a callee which requires a non-null argument
  func1(NULL, cp2, i1);
  ^     ~~~~

vs something like:

t.c:8:10: warning: argument is null where non-null is required
  func1(NULL, cp2, i1);
        ^

llvm-svn: 72393
2009-05-25 18:23:36 +00:00
Chris Lattner ae5342094a merge two tests.
llvm-svn: 72392
2009-05-25 18:20:11 +00:00
Chris Lattner c7516835c3 reword a warning for clarity
llvm-svn: 72391
2009-05-25 18:18:56 +00:00
Chris Lattner 31cadd77ef default -Wnonnull to on.
llvm-svn: 72390
2009-05-25 18:13:00 +00:00
Chris Lattner fe5b4250a8 move some format group options around in the file. Move NonNull group into
DiagnosticGroups.td, and add it as part of -Wformat (which gets it into -Wall).

llvm-svn: 72389
2009-05-25 18:10:41 +00:00
Chris Lattner 83bd8281e5 Fix a couple of bugs:
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
   of the # to unknown so that the preprocessor won't try to process it as
   a real #.  This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
   macro to say the definition ends with the foo, not the #.

This is a follow-on fix to r72283, and rdar://6916026

llvm-svn: 72388
2009-05-25 17:16:10 +00:00
Chris Lattner be31b7b534 we should eventually add -march=atom and the new atom movbe instruction.
llvm-svn: 72387
2009-05-25 16:34:44 +00:00
Chris Lattner 7ce761d204 improve comment, no functionality change.
llvm-svn: 72386
2009-05-25 16:23:08 +00:00
Chris Lattner fc39bccd2b fix this test to fail when the patch isn't applied.
llvm-svn: 72385
2009-05-25 16:14:52 +00:00
Nick Lewycky 4099c7c229 Fix the crash debugger to actually bisect globals once it's determined that it
can't just eliminate all global initializers.

llvm-svn: 72378
2009-05-25 06:29:56 +00:00
Nick Lewycky 6e090c9117 Add a bisection step on the list of instructions before doing the linear
simplification. It's not clear to me whether this can replace the first of the
linear instruction simplification stages or not, so I left it in.

llvm-svn: 72377
2009-05-25 05:30:00 +00:00
Dan Gohman 4d5435d46a Various comment fixes.
llvm-svn: 72376
2009-05-24 23:45:28 +00:00
Dan Gohman 8ca0885d69 Change ScalarEvolution::getSCEVAtScope to always return the original value
in the case where a loop exit value cannot be computed, instead of only in
some cases while using SCEVCouldNotCompute in others. This simplifies
getSCEVAtScope's callers.

llvm-svn: 72375
2009-05-24 23:25:42 +00:00
Eli Friedman ac149ee60a Add a comment which should hopefully make the purpose of this method a
bit clearer.

llvm-svn: 72374
2009-05-24 20:32:10 +00:00