Commit Graph

86670 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 63a622b768 Teach the x86 floating point stackifier to handle COPY instructions.
This pass runs before COPY instructions are passed to copyPhysReg, so we simply
translate COPY to the proper pseudo instruction. Note that copyPhysReg does not
handle floating point stack copies.

Once COPY is used everywhere, this can be cleaned up a bit, and most of the
pseudo instructions can be removed.

llvm-svn: 107899
2010-07-08 19:46:30 +00:00
Jakob Stoklund Olesen 930f8082c3 Implement X86InstrInfo::copyPhysReg
llvm-svn: 107898
2010-07-08 19:46:25 +00:00
Ted Kremenek 3245003251 Add missing whitespace.
llvm-svn: 107897
2010-07-08 19:43:08 +00:00
Douglas Gregor 9961ce9428 When performing substitution of template arguments within the body of
a template, be sure to include the template arguments from the
injected-class-name. Fixes PR7587.

llvm-svn: 107895
2010-07-08 18:37:38 +00:00
Sean Callanan 246549c50b Moved NDEBUG from a global setting to a specific
hack.

llvm-svn: 107894
2010-07-08 18:16:16 +00:00
Ted Kremenek 30ae68bd17 Update checker build.
llvm-svn: 107893
2010-07-08 18:08:18 +00:00
Bob Wilson 181e5af248 The NEONPreAllocPass should never have to assign fixed registers anymore.
This pass can go away entirely soon.

llvm-svn: 107892
2010-07-08 17:45:26 +00:00
Stephen Canon df69264765 Hand-tuning of single-precision soft-float comparison routines for ARM
llvm-svn: 107891
2010-07-08 17:45:05 +00:00
Bob Wilson 1eade1a327 For big-endian systems, VLD2/VST2 with 32-bit vector elements will swap the
words within the 64-bit D registers.  Use VLD1/VST1 with 64-bit elements
instead.

llvm-svn: 107890
2010-07-08 17:44:00 +00:00
Howard Hinnant 8c459a14a9 Marked subexpressions in a loop in basic posix working (only lightly tested so far)
llvm-svn: 107889
2010-07-08 17:43:58 +00:00
Jim Grosbach dd18ffa302 After r107880, findSurvivorReg() no longer needs to be public.
llvm-svn: 107887
2010-07-08 17:27:23 +00:00
Kevin Enderby 082d0fd7ad Added the darwin .weak_def_can_be_hidden directive.
llvm-svn: 107886
2010-07-08 17:22:42 +00:00
Argyrios Kyrtzidis 7e8996c7e6 Introduce PCHReader::GetTranslationUnitDecl() and use it instead of ReadDeclRecord when initializing.
ReadDeclRecord would hit assertion if the translation unit declaration was already loaded during
IdentifierInfo initialization.

llvm-svn: 107885
2010-07-08 17:13:02 +00:00
Argyrios Kyrtzidis 9f2d24a808 Support TemplateTemplateParmDecl for PCH.
llvm-svn: 107884
2010-07-08 17:12:57 +00:00
Gabor Greif d6c96c5a67 only dereference iterator once in the loop
(by caching the result we save a potentially expensive dereference)

also use typedefs to shorten type declarations

llvm-svn: 107883
2010-07-08 16:56:18 +00:00
Bob Wilson 6c25043493 Clean up a comment.
llvm-svn: 107882
2010-07-08 16:54:45 +00:00
Gabor Greif 59bea00737 remove unneeded parens
llvm-svn: 107881
2010-07-08 16:52:57 +00:00
Jim Grosbach c280fc7514 Clean up scavengeRegister() a bit to prefer available regs, which allows
the simplification of frame index register scavenging to not have to check
for available registers directly and instead just let scavengeRegister()
handle it.

llvm-svn: 107880
2010-07-08 16:49:26 +00:00
Jakob Stoklund Olesen 00264624a9 Convert EXTRACT_SUBREG to COPY when emitting machine instrs.
EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.

Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.

llvm-svn: 107879
2010-07-08 16:40:22 +00:00
Jakob Stoklund Olesen a1e883dcf6 Remove references to INSERT_SUBREG after de-SSA.
Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of
INSERT_SUBREG.

llvm-svn: 107878
2010-07-08 16:40:15 +00:00
Douglas Gregor f609386058 Bowing to popular demand, reduce the "comma at end of enumerator list"
ExtWarn to an Extension. Let the broken code propagate!

llvm-svn: 107875
2010-07-08 14:54:42 +00:00
John McCall b5081aff68 Apparently the {{$}} hack doesn't work on Windows; I am saddened but not
surprised.

llvm-svn: 107874
2010-07-08 13:17:29 +00:00
Argyrios Kyrtzidis a4ed18191c For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

llvm-svn: 107873
2010-07-08 13:09:53 +00:00
Argyrios Kyrtzidis 1985bb3b10 Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.
llvm-svn: 107872
2010-07-08 13:09:47 +00:00
Argyrios Kyrtzidis 00dda6accc Fix reading of UsingDecl from PCH.
llvm-svn: 107871
2010-07-08 13:09:41 +00:00
Argyrios Kyrtzidis ab446e1b57 Remove unused protected constructor of DeclRefExpr.
llvm-svn: 107870
2010-07-08 13:09:35 +00:00
Duncan Sands 242b885798 Use std::vector rather than SmallVector here because SmallVector
causes some versions of gcc to crash when building LLVM.

llvm-svn: 107869
2010-07-08 13:06:08 +00:00
Benjamin Kramer 0ae3f08c0d Merge the duplicated iabs optimization in DAGCombiner and let it detected a few more idioms.
llvm-svn: 107868
2010-07-08 12:09:56 +00:00
Duncan Sands e17a0a7072 Do not use std::stack because it causes obscure failures when
compiled with MSVC 2010 (PR7367).  Instead use a SmallVector.

llvm-svn: 107867
2010-07-08 11:54:27 +00:00
Benjamin Kramer 2321e6a4d4 Teach instcombine to transform
(X >s -1) ? C1 : C2 and (X <s  0) ? C2 : C1
into ((X >>s 31) & (C2 - C1)) + C1, avoiding the conditional.

This optimization could be extended to take non-const C1 and C2 but we better
stay conservative to avoid code size bloat for now.

for
int sel(int n) {
     return n >= 0 ? 60 : 100;
}

we now generate
  sarl  $31, %edi
  andl  $40, %edi
  leal  60(%rdi), %eax

instead of
  testl %edi, %edi
  movl  $60, %ecx
  movl  $100, %eax
  cmovnsl %ecx, %eax

llvm-svn: 107866
2010-07-08 11:39:10 +00:00
Chandler Carruth e51a119fc6 Wrap the new ext-warn on extraneous comma on the last entry of an enumerator
list in a diagnostic group so it can be turned on and off. A terrifying amount
of code, including large chunks of open source code, still do this so it's
important to be able to suppress it when necessary.

Doug, is this a reasonable compromise? I'd lean toward making it a normal
extension, but I don't feel strongly as long as we can turn the warnings off.

llvm-svn: 107865
2010-07-08 10:52:01 +00:00
Chandler Carruth dd1bc0f1b5 Add support for differentiating between attributes ignored when handled and
unknown attributes that we discard. Add a diagnostic group for unknown
attribute warnings to allow turning these off when we don't care. Also
consolidates the tests for this case.

llvm-svn: 107864
2010-07-08 09:42:26 +00:00
Duncan Sands b69d4ce5f3 Tweak documentation to mention Debug+Asserts.
llvm-svn: 107863
2010-07-08 08:31:28 +00:00
Duncan Sands 1567f0fa7e Tweak some docs now that the default build is called Debug+Asserts.
llvm-svn: 107862
2010-07-08 08:27:18 +00:00
Eric Christopher e796253217 A slight reworking of the custom patterns for x86-64 tpoff codegen and
correct the testcase for valid assembly.

Needs more tests.

llvm-svn: 107860
2010-07-08 07:36:46 +00:00
John McCall be349def4b Mark calls to 'throw()' functions as nounwind, and mark the functions nounwind
as well.

llvm-svn: 107858
2010-07-08 06:48:12 +00:00
Douglas Gregor 747eb7840a Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.

llvm-svn: 107857
2010-07-08 06:14:04 +00:00
Evan Cheng be1f7a931e r107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0.
llvm-svn: 107856
2010-07-08 06:01:49 +00:00
Jakob Stoklund Olesen 89a4e25007 Add TargetInstrInfo::copyPhysReg hook and use it from LowerSubregs.
This target hook is intended to replace copyRegToReg entirely, but for now it
calls copyRegToReg.

Any remaining calls to copyRegToReg wil be replaced by COPY instructions.

llvm-svn: 107854
2010-07-08 05:01:41 +00:00
Sean Callanan 6015095608 Updated to build against the latest LLVM release.
Also fixed our build to define NDEBUG; code that
uses LLVM headers without NDEBUG is
binary-incompatible with libraries built with
NDEBUG.

llvm-svn: 107853
2010-07-08 02:13:18 +00:00
Evan Cheng 25f9364cbd Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met:
1. The arguments are f32.
2. The arguments are loads and they have no uses other than the comparison.
3. The comparison code is EQ or NE.

e.g.
        vldr.32 s0, [r1]
        vldr.32 s1, [r0]
        vcmpe.f32       s1, s0
        vmrs    apsr_nzcv, fpscr
	beq     LBB0_2
=>
        ldr     r1, [r1]
        ldr     r0, [r0]
        cmp     r0, r1
        beq     LBB0_2

More complicated cases will be implemented in subsequent patches.

llvm-svn: 107852
2010-07-08 02:08:50 +00:00
Dale Johannesen e2289285ae Changes to ARM tail calls, mostly cosmetic.
Add explicit testcases for tail calls within the same module.
Duplicate some code to humor those who think .w doesn't apply on ARM.
Leave this disabled on Thumb1, and add some comments explaining why it's hard
and won't gain much.

llvm-svn: 107851
2010-07-08 01:18:23 +00:00
Dan Gohman e75704369d Revert 107840 107839 107813 107804 107800 107797 107791.
Debug info intrinsics win for now.

llvm-svn: 107850
2010-07-08 01:00:56 +00:00
Jim Grosbach 6533f24370 When processing frame index virtual registers, consider all available registers
(if there are any) and use the one which remains available for the longest
rather than just using the first one. This should help enable better re-use
of the loaded frame index values. rdar://7318760

llvm-svn: 107847
2010-07-08 00:38:54 +00:00
Chris Lattner efa3c824cc Fix the second half of PR7437: scalarrepl wasn't preserving
address spaces when SRoA'ing memcpy's.

llvm-svn: 107846
2010-07-08 00:27:05 +00:00
Chris Lattner 06801d7371 allow this to pass on 32-bit hosts.
llvm-svn: 107845
2010-07-08 00:23:21 +00:00
Johnny Chen acfbeff17e Test that debug symbols have the correct order as specified by the order file.
llvm-svn: 107844
2010-07-08 00:17:29 +00:00
Chris Lattner cb7696cf35 fix the clang side of PR7437: EmitAggregateCopy
was not producing a memcpy with the right address
spaces because of two places in it doing casts of
the arguments to i8, one of which that didn't
preserve the address space.

There is also an optimizer bug here.

llvm-svn: 107842
2010-07-08 00:07:45 +00:00
Chris Lattner 26b1a19842 filecheckize this test.
llvm-svn: 107841
2010-07-08 00:05:45 +00:00
Dan Gohman eb9164dc50 Don't forward-declare registers for static allocas, which we'll
prefer to materialize as local constants. This fixes the clang
bootstrap abort.

llvm-svn: 107840
2010-07-07 23:52:58 +00:00