Commit Graph

60660 Commits

Author SHA1 Message Date
Nate Begeman 624690c6b2 Adapt the x86 build_vector dagcombine to the current state of the legalizer.
build vectors with i64 elements will only appear on 32b x86 before legalize.
Since vector widening occurs during legalize, and produces i64 build_vector 
elements, the dag combiner is never run on these before legalize splits them
into 32b elements.

Teach the build_vector dag combine in x86 back end to recognize consecutive 
loads producing the low part of the vector.

Convert the two uses of TLI's consecutive load recognizer to pass LoadSDNodes
since that was required implicitly.

Add a testcase for the transform.

Old:
	subl	$28, %esp
	movl	32(%esp), %eax
	movl	4(%eax), %ecx
	movl	%ecx, 4(%esp)
	movl	(%eax), %eax
	movl	%eax, (%esp)
	movaps	(%esp), %xmm0
	pmovzxwd	%xmm0, %xmm0
	movl	36(%esp), %eax
	movaps	%xmm0, (%eax)
	addl	$28, %esp
	ret

New:
	movl	4(%esp), %eax
	pmovzxwd	(%eax), %xmm0
	movl	8(%esp), %eax
	movaps	%xmm0, (%eax)
	ret

llvm-svn: 72957
2009-06-05 21:37:30 +00:00
Evan Cheng 3158790e32 Changing allocation ordering from r3 ... r0 back to r0 ... r3. The order change no longer make sense after the coalescing changes we have made since then.
llvm-svn: 72955
2009-06-05 19:08:58 +00:00
Devang Patel 54707b420a Evan thinks NoImplicitFloat check is not required here.
llvm-svn: 72954
2009-06-05 18:48:29 +00:00
Dan Gohman 2bde90b3ee Fix a copy+pasto in an assertion string that Jay Foad noticed.
llvm-svn: 72953
2009-06-05 18:34:16 +00:00
Evan Cheng 7fce2cf0ba When merging multiple load / store instructions. Use the DebugLoc of the first one.
llvm-svn: 72952
2009-06-05 18:19:23 +00:00
Fariborz Jahanian 6845383426 Use of DeclContext for objc's ivars. No functionality
change. More to follow.

llvm-svn: 72951
2009-06-05 18:16:35 +00:00
Evan Cheng c154c1185c Code clean up: return vector by reference rather than by value. No functionality changes.
llvm-svn: 72950
2009-06-05 17:56:14 +00:00
Dan Gohman 63964b5821 Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
llvm-svn: 72949
2009-06-05 16:35:53 +00:00
Dan Gohman d9ef48a73e Remove some unnecessary #includes.
llvm-svn: 72948
2009-06-05 16:32:58 +00:00
Douglas Gregor fa93480937 Clean up Clang regression testing in CMake, so that we get more
logical output when running all of the Clang regression tests at once.

llvm-svn: 72947
2009-06-05 16:26:18 +00:00
Dan Gohman 5208dd899f Update the Verifier to be aware of the difference between Add and FAdd, etc.
llvm-svn: 72946
2009-06-05 16:10:00 +00:00
Douglas Gregor 0770532f5a First cut at regression testing Clang with CMake
llvm-svn: 72945
2009-06-05 16:00:31 +00:00
Anders Carlsson b3d05d6d11 Improvements to CXXExprWithTemporaries in preparation for fixing a bug with default arguments that have temporaries.
llvm-svn: 72944
2009-06-05 15:38:08 +00:00
Duncan Sands 8b9524eede On platforms like Sparc64 you need to pass -r to
gcc rather than directly to the linker: gcc will
then modify the linker options it generates (it
will not use --relax for example, incompatible
with -r, as it otherwise would).  This fixes the
sparc build.

llvm-svn: 72943
2009-06-05 15:05:19 +00:00
Sanjiv Gupta b794c12c7e Lower i16/i32 sdiv/udiv/srem/urem using libcalls.
llvm-svn: 72942
2009-06-05 14:43:12 +00:00
Sanjiv Gupta 7925c5fd3f Allow libcalls for i16 sdiv/udiv/rem operations.
llvm-svn: 72941
2009-06-05 14:41:10 +00:00
Eli Friedman 2468f8625a PR3443: Add stpcpy builtin (plus a few other related builtins). Yes,
we're still missing a mechanism to disable these in strict mode, but 
that's not a new issue.

llvm-svn: 72936
2009-06-05 08:20:10 +00:00
Daniel Dunbar 4be99ff767 ABI handling: Fix nasty thinko where IRgen could generate an out-of-bounds read
when generating a coercion for ABI handling purposes.
 - This may only manifest itself when building at -O0, but the practical effect
   is that other arguments may get clobbered.

 - <rdar://problem/6930451> [irgen] ABI coercion clobbers other arguments

llvm-svn: 72932
2009-06-05 07:58:54 +00:00
Eli Friedman 327f0b5593 Add driver support for -fsigned-char/-funsigned-char.
llvm-svn: 72930
2009-06-05 07:21:14 +00:00
Eli Friedman 6be4b393b9 Add -fsigned-char option to clang-cc.
llvm-svn: 72929
2009-06-05 07:12:17 +00:00
Eli Friedman 9ffd4a9b96 Move CharIsSigned from TargetInfo to LangOptions.
llvm-svn: 72928
2009-06-05 07:05:05 +00:00
Eli Friedman d7bcad67d4 Add a couple of FreeBSD-specific command-line options.
llvm-svn: 72927
2009-06-05 06:29:09 +00:00
Eli Friedman 302c4e1683 Address review comments for #pragma weak.
llvm-svn: 72926
2009-06-05 06:28:29 +00:00
Daniel Dunbar 635b8050c4 Add an XFAIL test to demonstrate references in Obj-C++, this currently crashes.
llvm-svn: 72923
2009-06-05 06:03:19 +00:00
Anders Carlsson 184cb4123e Make TemplateArgumentListBuilder take an ASTContext (because we're probably going to need it later). Move push_back to the .cpp file. If the passed in template argument is a type, assert that it's canonical.
llvm-svn: 72918
2009-06-05 05:31:27 +00:00
Anders Carlsson c8e7113a9f Make the TemplateArgumentList take a TemplateArgumentListBuilder.
llvm-svn: 72917
2009-06-05 04:47:51 +00:00
Anders Carlsson 1b28c3efe2 Change the specialization decls to take a TemplateArgumentListBuilder.
llvm-svn: 72916
2009-06-05 04:06:48 +00:00
Anders Carlsson 8aa89d4049 Add a helper class for building template argument lists.
llvm-svn: 72915
2009-06-05 03:43:12 +00:00
Eli Friedman 3c1291d384 Update test to work with the limited Sema for #pragma weak.
llvm-svn: 72914
2009-06-05 02:49:06 +00:00
Anders Carlsson 03c9e87410 Fix another crash and actually make the test case work.
llvm-svn: 72913
2009-06-05 02:45:24 +00:00
Eli Friedman 5ed5198a5a Start of a Sema implementation for #pragma weak. This isn't really the
right approach, but I'm still not sure what the best way to go about this is.

llvm-svn: 72912
2009-06-05 02:44:36 +00:00
Anders Carlsson dd096d888b Fix a case when the TemplateArgs vector can be empty.
llvm-svn: 72911
2009-06-05 02:12:32 +00:00
Daniel Dunbar dd050567c1 Fix -Asserts build warnings.
llvm-svn: 72910
2009-06-05 02:03:25 +00:00
Douglas Gregor b7ae10f764 Several improvements to template argument deduction:
- Once we have deduced template arguments for a class template partial
    specialization, we use exactly those template arguments for instantiating
    the definition of the class template partial specialization.
  - Added template argument deduction for non-type template parameters.
  - Added template argument deduction for dependently-sized array types.

With these changes, we can now implement, e.g., the remove_reference
type trait. Also, Daniel's Ackermann template metaprogram now compiles
properly.

llvm-svn: 72909
2009-06-05 00:53:49 +00:00
Eli Friedman 8df7462f69 Test for parsing #pragma weak.
llvm-svn: 72908
2009-06-05 00:50:43 +00:00
Eli Friedman f5867dd51a Add parser support for #pragma weak.
llvm-svn: 72907
2009-06-05 00:49:58 +00:00
Bruno Cardoso Lopes 12ad90a7a6 ELF Code Emitter now uses CurBufferPtr, BufferBegin and BufferEnd, as do JIT and
MachO Writer. This will change with the arrival of ObjectCodeEmitter and
BinaryObject

llvm-svn: 72906
2009-06-05 00:22:10 +00:00
Devang Patel 21dd8d4ae4 NoRedZone attribute test case.
llvm-svn: 72905
2009-06-04 23:45:55 +00:00
Dan Gohman 5c36f4f40c Fix an erroneous check for isFNeg; the FNeg case is handled
a few lines later on.

llvm-svn: 72904
2009-06-04 23:43:29 +00:00
Bill Wendling 72c9722c64 Fix these so that they work on non-x86 Darwin machines.
llvm-svn: 72903
2009-06-04 23:37:19 +00:00
Devang Patel 6e467b1a46 Set function attribute llvm::Attribute::NoRedZone appropriately.
llvm-svn: 72902
2009-06-04 23:32:02 +00:00
Eli Friedman 319ce956a9 Fix up this compatibility hack to be more compatible with gcc.
llvm-svn: 72901
2009-06-04 23:03:07 +00:00
Eli Friedman fd4b1559db Move a couple Darwin-specific defines into getDarwinDefines.
llvm-svn: 72900
2009-06-04 23:00:29 +00:00
Bill Wendling d6ac8bec21 Specify that this works for Darwin.
llvm-svn: 72899
2009-06-04 22:56:29 +00:00
Bill Wendling 5f0d6c4434 The DWARF unwind info was incorrect. While compiling with
`-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a
lot of function, and then they would be `0'. The linker (at least on Darwin)
needs to encode the stack size. In some cases, the stack size is too large to
directly encode. So the linker checks to see if there is a "subl $xxx,%esp"
instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If
so, the compact encoding records the offset in the function to where the stack
size is embedded. But because the `DW_CFA_advance_loc' instructions are missing,
it looks before the function and dies.

So, instead of emitting the EH debug label before the stack adjustment
operations, emit it afterwards, right before the frame move stuff.

llvm-svn: 72898
2009-06-04 22:52:30 +00:00
Dan Gohman a5b9645c4b Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Devang Patel 72a4d2fec1 Add new function attribute - noredzone.
Update code generator to use this attribute and remove DisableRedZone target option.
Update llc to set this attribute when -disable-red-zone command line option is used.

llvm-svn: 72894
2009-06-04 22:05:33 +00:00
Anders Carlsson beca75273a Use the correct indentation for DeclTemplate.cpp
llvm-svn: 72892
2009-06-04 21:48:59 +00:00
Dale Johannesen 37bc85f89a Fix FP_TO_UINT->i32 on ppc32 -mcpu=g5. This was
using Promote which won't work because i64 isn't
a legal type.  It's easy enough to use Custom, but
then we have the problem that when the type
legalizer is promoting FP_TO_UINT->i16, it has no
way of telling it should prefer FP_TO_SINT->i32
to FP_TO_UINT->i32.  I have uncomfortably hacked
this by making the type legalizer choose FP_TO_SINT
when both are Custom.
This fixes several regressions in the testsuite.

llvm-svn: 72891
2009-06-04 20:53:52 +00:00
Evan Cheng fa0ac19b82 RALinScan::attemptTrivialCoalescing() was returning a virtual register instead of the physical register it is allocated to. This resulted in virtual register(s) being added the live-in sets.
llvm-svn: 72890
2009-06-04 20:53:36 +00:00