Commit Graph

68633 Commits

Author SHA1 Message Date
Duncan Sands
0d7ce5ffa4 There is no need for isAssociative to take the type as an argument anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 13:10:23 +00:00
Duncan Sands
8e4f4390bc Discourage people from using isWeakForLinker when they should be using
mayBeOverridden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 10:57:01 +00:00
Oscar Fuentes
784a176bc3 New cmake option LLVM_APPEND_VC_REV for controlling when the VC
revision id is appended to the LLVM version string. Defaults to
OFF.

Until now the VC revision id was always appended to the revision
string whenever cmake was invoked (either explicitly or implicitly
because a cmake source file changed). This was causing massive
recompilations because config.h are reconfigured with the new contents
of PACKAGE_VERSION.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 09:47:13 +00:00
Oscar Fuentes
ec33e8dcd6 Update cmake library dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122239 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 09:47:08 +00:00
Chris Lattner
2b9375e44b fix PR8807 by making transformConstExprCastCall aware of byval arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 08:36:38 +00:00
Chris Lattner
ab215bc371 various cleanups for transformConstExprCastCall
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 08:25:06 +00:00
Chris Lattner
0b66f63a26 when eliding a byval copy due to inlining a readonly function, we have
to make sure that the reused alloca has sufficient alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 08:10:40 +00:00
Chris Lattner
e7ae705c32 pull byval processing out to its own helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 07:57:41 +00:00
Chris Lattner
018fb767b9 fix PR8769, a miscompilation by inliner when inlining a function with a byval
argument.  The generated alloca has to have at least the alignment of the
byval, if not, the client may be making assumptions that the new alloca won't
satisfy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 07:45:28 +00:00
Chris Lattner
572335915f merge two tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 07:39:57 +00:00
Chris Lattner
b0af8ce1d9 filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122232 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 07:38:24 +00:00
Cameron Zwarich
2100d21f39 MachineVerifier should count landing pad successors as basic blocks rather than
out-edges. Fixes PR8824.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122228 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 04:19:48 +00:00
Cameron Zwarich
0b13d7db28 Teach MachineVerifier that early clobber defs begin at USE slots and other defs
begin at DEF slots. Fixes the second half of PR8813.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 03:15:20 +00:00
Cameron Zwarich
5e61f9916e Add a missing check from r122218.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 02:59:51 +00:00
Chris Lattner
315b6f77bc temporarily disable this: PR8823.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 02:11:23 +00:00
Chris Lattner
5c3d4f0fc9 implement type legalization promotion support for SMULO and UMULO, giving
ARM (and other 32-bit-only) targets support for i8 and i16 overflow 
multiplies.  The generated code isn't great, but this at least fixes
CodeGen/Generic/overflow.ll when running on ARM hosts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 02:05:39 +00:00
Chris Lattner
23a0199f05 now that addc/adde are gone, "ADDC" in the X86 backend uses EFLAGS results,
the same as setcc.  Optimize ADDC(0,0,FLAGS) -> SET_CARRY(FLAGS).  This is
a step towards finishing off PR5443.  In the testcase in that bug we now  get:

	movq	%rdi, %rax
	addq	%rsi, %rax
	sbbq	%rcx, %rcx
	testb	$1, %cl
	setne	%dl
	ret

instead of:

	movq	%rdi, %rax
	addq	%rsi, %rax
	movl	$0, %ecx
	adcq	$0, %rcx
	testq	%rcx, %rcx
	setne	%dl
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 01:37:09 +00:00
Cameron Zwarich
636f15ff04 Don't assume that an instruction ending a register's live range always reads
the register; it may be a dead def instead. Fixes PR8820.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 01:22:37 +00:00
Chris Lattner
39ffcb7b62 We lower setb to sbb with the hope that the and will go away, when it
doesn't, match it back to setb.

On a 64-bit version of the testcase before we'd get:

	movq	%rdi, %rax
	addq	%rsi, %rax
	sbbb	%dl, %dl
	andb	$1, %dl
	ret

now we get:

	movq	%rdi, %rax
	addq	%rsi, %rax
	setb	%dl
	ret




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 01:16:03 +00:00
Mon P Wang
b085181258 Test case for r122215 when InstCombine optimizes memset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 01:06:23 +00:00
Mon P Wang
55fb9b0fcf Avoid dropping the address space when InstCombine optimizes memset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 01:05:30 +00:00
Chris Lattner
d8ff7eca8c use for loop over types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 01:03:27 +00:00
Chris Lattner
5b85654844 Change the X86 backend to stop using the evil ADDC/ADDE/SUBC/SUBE nodes (which
their carry depenedencies with MVT::Flag operands) and use clean and beautiful
EFLAGS dependences instead.

We do this by changing the modelling of SBB/ADC to have EFLAGS input and outputs
(which is what requires the previous scheduler change) and change X86 ISelLowering
to custom lower ADDC and friends down to X86ISD::ADD/ADC/SUB/SBB nodes.

With the previous series of changes, this causes no changes in the testsuite, woo.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:59:46 +00:00
Chris Lattner
4d8455ea4d update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:56:59 +00:00
Chris Lattner
37944985a5 Fix a bug in the scheduler's handling of "unspillable" vregs.
Imagine we see:

EFLAGS = inst1
EFLAGS = inst2 FLAGS
gpr = inst3 EFLAGS

Previously, we would refuse to schedule inst2 because it clobbers
the EFLAGS of the predecessor.  However, it also uses the EFLAGS
of the predecessor, so it is safe to emit.  SDep edges ensure that
the right order happens already anyway.

This fixes 2 testsuite crashes with the X86 patch I'm going to
commit next.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:55:43 +00:00
Mon P Wang
e273690d7a Add comment for testcase for 122206
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:54:26 +00:00
Chris Lattner
142d21c861 the result of CheckForLiveRegDef is dead, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:51:56 +00:00
Chris Lattner
5078293cc2 reduce indentation, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:50:16 +00:00
Cameron Zwarich
8ec88ba588 Ignore debug values when performing MachineVerifier liveness checks. Fixes
PR8822.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 00:08:10 +00:00
Mon P Wang
a0fd0d5b27 Prevents PerformShuffleCombine from creating a node with an illegal type after legalize types
has run, e.g., prevent creating an i64 node from a v2i64 when i64 is not a legal type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 23:55:53 +00:00
Cameron Zwarich
1b031ddede Early clobber operands are allowed to be defined at use indices. This fixes one
half of PR8813.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 23:50:53 +00:00
Chris Lattner
f2a97ed13d fix an oversight caught by Frits!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 23:24:04 +00:00
Bruno Cardoso Lopes
48461f6da3 Update the Target Feature Matrix for Mips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 22:41:43 +00:00
Cameron Zwarich
fb69f6037d Fix PR8815 by checking for an explicit clobber def tied to a use operand in
ConnectedVNInfoEqClasses::Classify().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 22:12:45 +00:00
Chris Lattner
c19d1c3ba2 improve the setcc -> setcc_carry optimization to happen more
consistently by moving it out of lowering into dag combine.

Add some missing patterns for matching away extended versions of setcc_c.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 22:08:31 +00:00
Cameron Zwarich
22d67cf6ac Fix PR8811 by teaching MachineVerifier about optional defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 21:37:23 +00:00
Cameron Zwarich
c44270dd6f StrongPHIElimination will never run before TwoAddressInstructionPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 21:32:29 +00:00
Chris Lattner
481eebc931 simplify some code to just reuse a setcc if we can instead of
going through the CSE maps to get it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 21:23:48 +00:00
Nick Lewycky
9d38acb254 Use the new way of silencing this warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:57:14 +00:00
Nick Lewycky
476b242fe7 Add missing standard headers. Patch by Joerg Sonnenberger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:43:38 +00:00
Nick Lewycky
2402123413 Add missing std:: prefixes to some calls. C++ doesn't require that <cfoo>
headers provide symbols outside namespace std and the LLVM coding standards
state that we should prefix all of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122192 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:42:43 +00:00
Chris Lattner
da60588402 teach MaskedValueIsZero how to analyze ADDE. This is
enough to teach it that ADDE(0,0) is known 0 except the 
low bit, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:38:28 +00:00
Chris Lattner
459f4f8c25 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:24:28 +00:00
Chris Lattner
2a786eb030 now that generic vector types aren't selected onto MMX operations,
we don't need -disable-mmx anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:19:20 +00:00
Chris Lattner
6f948be128 now that generic vector types aren't selected onto MMX registers, these
tests don't need -disable-mmx.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:12:58 +00:00
Chris Lattner
e019ec168b reduce copy/paste programming with the power of for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:07:10 +00:00
Chris Lattner
a34b3cf953 X86 supports i8/i16 overflow ops (except i8 multiplies), we should
generate them.  

Now we compile:

define zeroext i8 @X(i8 signext %a, i8 signext %b) nounwind ssp {
entry:
  %0 = tail call %0 @llvm.sadd.with.overflow.i8(i8 %a, i8 %b)
  %cmp = extractvalue %0 %0, 1
  br i1 %cmp, label %if.then, label %if.end

into:

_X:                                     ## @X
## BB#0:                                ## %entry
	subl	$12, %esp
	movb	16(%esp), %al
	addb	20(%esp), %al
	jo	LBB0_2

Before we were generating:

_X:                                     ## @X
## BB#0:                                ## %entry
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	movb	12(%ebp), %al
	testb	%al, %al
	setge	%cl
	movb	8(%ebp), %dl
	testb	%dl, %dl
	setge	%ah
	cmpb	%cl, %ah
	sete	%cl
	addb	%al, %dl
	testb	%dl, %dl
	setge	%al
	cmpb	%al, %ah
	setne	%al
	andb	%cl, %al
	testb	%al, %al
	jne	LBB0_2




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:03:11 +00:00
Chris Lattner
8dd3417384 add a general coverage test for overflow intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:01:13 +00:00
Chris Lattner
74b64611c4 move a transformation to a more logical place, simplifying it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 19:43:52 +00:00
Chris Lattner
e5cbdca3bd recognize an unsigned add with overflow idiom into uadd.
This resolves a README entry and technically resolves PR4916,
but we still get poor code for the testcase in that PR because
GVN isn't CSE'ing uadd with add, filed as PR8817.

Previously we got:

_test7:                                 ## @test7
	addq	%rsi, %rdi
	cmpq	%rdi, %rsi
	movl	$42, %eax
	cmovaq	%rsi, %rax
	ret

Now we get:

_test7:                                 ## @test7
	addq	%rsi, %rdi
	movl	$42, %eax
	cmovbq	%rsi, %rax
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 19:37:52 +00:00