Commit Graph

8051 Commits

Author SHA1 Message Date
Chris Lattner
f716330c90 add pr#
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 05:57:47 +00:00
Chris Lattner
eed919b1ba Improve GVN to be able to forward substitute a small load
from a piece of a large store when both are in the same block.

This allows clang to compile the testcase in PR4216 to this code:

_test_bitfield:
	movl	4(%esp), %eax
	movl	%eax, %ecx
	andl	$-65536, %ecx
	orl	$32962, %eax
	andl	$40186, %eax
	orl	%ecx, %eax
	ret

This is not ideal, but is a whole lot better than the code produced
by llvm-gcc:

_test_bitfield:
	movw	$-32574, %ax
	orw	4(%esp), %ax
	andw	$-25350, %ax
	movw	%ax, 4(%esp)
	movw	7(%esp), %cx
	shlw	$8, %cx
	movzbl	6(%esp), %edx
	orw	%cx, %dx
	movzwl	%dx, %ecx
	shll	$16, %ecx
	movzwl	%ax, %eax
	orl	%ecx, %eax
	ret

and dramatically better than that produced by gcc 4.2:

_test_bitfield:
	pushl	%ebx
	call	L3
"L00000000001$pb":
L3:
	popl	%ebx
	movl	8(%esp), %eax
	leal	0(,%eax,4), %edx
	sarb	$7, %dl
	movl	%eax, %ecx
	andl	$7168, %ecx
	andl	$-7201, %ebx
	movzbl	%dl, %edx
	andl	$1, %edx
	sall	$5, %edx
	orl	%ecx, %ebx
	orl	%edx, %ebx
	andl	$24, %eax
	andl	$-58336, %ebx
	orl	%eax, %ebx
	orl	$32962, %ebx
	movl	%ebx, %eax
	popl	%ebx
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 05:57:11 +00:00
Evan Cheng
b0f5973bee Fix PR4986. "r1024 = insert_subreg r1024, undef, 2" cannot be turned in an implicit_def. Instead, it's an identity copy so it should be eliminated. Also make sure to update livevariable kill information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 04:32:32 +00:00
Chris Lattner
8111576521 fix a FileCheck bug where:
; CHECK: foo
; CHECK-NOT: foo
; CHECK: bar

would always fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 02:30:42 +00:00
Daniel Dunbar
06e483dae0 Move ARM and X86 specific AsmParser tests into separate subdirectories, and only
run if appropriate target is supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 00:05:30 +00:00
Daniel Dunbar
3d4138bd58 Work around a FileCheck bug, for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 23:30:31 +00:00
Chris Lattner
66364346e0 Revert r82404, it is causing a bootstrap miscompile. This is very very
scary, as it indicates a lurking bug. yay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 22:44:26 +00:00
Chris Lattner
6a089c3257 this was not supposed to be committed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 22:36:11 +00:00
Chris Lattner
f15380ba8a implement and document support for CHECK-NOT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 22:35:26 +00:00
Chris Lattner
386251341f improve memdep to eliminate bitcasts (and aliases, and noop geps)
early for the stated reasons: this allows it to find more 
equivalences and depend less on code layout.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 21:00:18 +00:00
Chris Lattner
771a5422e1 Move CoerceAvailableValueToLoadType earlier in GVN.cpp. Hook it up
so that nonlocal and partially redundant loads can use it as well.
The testcase shows examples of craziness this can handle.  This triggers
*many* times in 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 20:09:34 +00:00
Daniel Dunbar
2891dbba91 Teach 'make check-all' to build the site configuration for clang, if it is in tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 19:04:28 +00:00
Chris Lattner
bb6495cc67 enhance GVN to forward substitute a stored value to a load
(and load -> load) when the base pointers must alias but when
they are different types.  This occurs very very frequently in
176.gcc and other code that uses bitfields a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 19:03:47 +00:00
Nick Lewycky
149cbc2a24 Peer through zext and sext to eliminate them when it is safe to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:31:25 +00:00
Nick Lewycky
85958b059d Fold 'icmp eq (icmp), true' into an xor(icmp).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:21:39 +00:00
Chris Lattner
e895c61515 Add an intel syntax MCInstPrinter implementation. You can now
transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:17:49 +00:00
Nick Lewycky
04d7eed1d5 Rewrite this check so that it checks what it's supposed to and doesn't use
CHECK-NOT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:00:24 +00:00
Nick Lewycky
3105ebfaf7 Teach the constant folder how to not a cmpinst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:24:51 +00:00
Daniel Dunbar
3418579046 Add 'make check-all', which runs the LLVM tests along with the clang tests if
its in the standard location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:17:21 +00:00
Nick Lewycky
55a722bf6a Try turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
the hopes that the two bitcasts will merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 05:48:50 +00:00
Nick Lewycky
3892baac42 Clean up the usage of evaluateICmpRelation's return value.
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 04:27:06 +00:00
Dale Johannesen
39faac2531 When computing live intervals for earlyclobber operands,
we pushed the beginning of the interval back 1, so the
interval would overlap with inputs that die.  We were
also pushing the end of the interval back 1, though,
which means the earlyclobber didn't overlap with other
output operands.  Don't do this.  PR 4964.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 00:36:41 +00:00
Nick Lewycky
f4d1882743 Teach the constant folder how to handle a few simple i1 cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 00:04:02 +00:00
Evan Cheng
ce31910eae Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-19 09:51:03 +00:00
Dan Gohman
d268e00938 Delete the label names from this test to make it less fragile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 21:23:12 +00:00
Chris Lattner
228252f981 Make a new X8632_MachoTargetObjectFile TLOF implementation whose
getSymbolForDwarfGlobalReference is smart enough to know that it 
needs to register the stub it references with MachineModuleInfoMachO,
so that it gets emitted at the end of the file.

Move stub emission from X86ATTAsmPrinter::doFinalization to the
new X86ATTAsmPrinter::EmitEndOfAsmFile asmprinter hook.  The important
thing here is that EmitEndOfAsmFile is called *after* the ehframes are
emitted, so we get all the stubs.

This allows us to remove a gross hack from the asmprinter where it would
"just know" that it needed to output stubs for personality functions.
Now this is all driven from a consistent interface.

The testcase change is just reordering the expected output now that the
stubs come out after the ehframe instead of before.

This also unblocks other changes that Bill wants to make.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 20:22:52 +00:00
Dale Johannesen
8dffc819c5 Model the carry bit on ppc32. Without this we could
move a SUBFC (etc.) below the SUBFE (etc.) that consumed
the carry bit.  Add missing ADDIC8, noticed along the way.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 20:15:22 +00:00
Dan Gohman
e220c4b3d9 Add support for using the FLAGS result of or, xor, and and instructions
on x86, to avoid explicit test instructions. A few existing tests changed
due to arbitrary register allocation differences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:59:53 +00:00
Devang Patel
e8e0213cc3 Write and read metadata attachments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:26:43 +00:00
Anton Korobeynikov
c6f729ed55 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 16:57:42 +00:00
Chris Lattner
4aebc9d8c7 make this testcase check darwin32 also
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 23:56:41 +00:00
Chris Lattner
7ea9890962 rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 23:55:12 +00:00
Chris Lattner
20397179ad convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 23:54:26 +00:00
Chris Lattner
3aaf740424 rename file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 23:42:06 +00:00
Devang Patel
da795f82a8 A testcase!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 23:05:07 +00:00
Dan Gohman
1f96e67f78 Teach ScalarEvolution how to reason about no-wrap flags on loops
where the induction variable has a non-unit stride, such as {0,+,2}, and
there are expressions such as {1,+,2} inside the loop formed with
or or add nsw operators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 18:05:20 +00:00
Daniel Dunbar
f194d627d5 Remove test cases using -regalloc=simple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 06:37:07 +00:00
Evan Cheng
5cf732e3b1 Fix PR4910: Broken logic in coalescer means when a physical register liveness is being shortened, the sub-registers were not. The symptom is the register allocator could not find a free register for this particular test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 00:57:15 +00:00
Dan Gohman
46fb0dee03 Fix the comment in this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 16:33:59 +00:00
Dan Gohman
b6c3385a2d Don't sink gep operators through phi nodes if the result would require
more than one phi, since that leads to higher register pressure on
entry to the phi. This is especially problematic when the phi is in
a loop header, as it increases register pressure throughout the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 02:01:52 +00:00
Bob Wilson
9b379dc526 Convert more tests to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:58:02 +00:00
Chris Lattner
dffb6e5aee fix PR4984 by ensuring that fastisel adds properly sign extended GEP displacement
values to machineinstrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 18:27:02 +00:00
Chris Lattner
371b8fc41c rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 18:23:37 +00:00
Chris Lattner
25519ddc2d convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 18:23:23 +00:00
Sandeep Patel
85111a9c07 Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 17:53:11 +00:00
Chris Lattner
db486a6d53 several major improvements to the sparc backend: support for weak linkage
and PIC codegen.  Patch by Venkatraman Govindaraju!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 17:46:24 +00:00
Dan Gohman
e3394d4a49 When a constant's type is refined, update the constant in place
instead of cloning and RAUWing it.

 - Make AbstractTypeUser a friend of Value so that it can offer
   its subclasses a way to update a Value's type in place. This
   is better than a universally visible setType method on Value,
   and it's sufficient for the immediate need.

 - Eliminate the constant "convert" functions. This eliminates a
   lot of logic duplication, and fixes a complicated bug where a
   constant can't actually be cloned during the type refinement
   process because some of the types that its folder needs are
   half-destroyed, being in the middle of refinement themselves.

 - Move the getValType functions from being static overloaded
   functions in Constants.cpp to be members of class template
   specializations in ConstantsContext.h. This means that the
   code ends up getting instantiated twice, however it also
   makes it possible to eliminate all "convert" functions, so
   it's not a big net code size increase. And if desired, the
   duplicate instantiations could be eliminated with some
   reorganization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 15:58:07 +00:00
Dan Gohman
5efe566d9e Use llvm-link -S instead of using llvm-dis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81860 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 15:38:31 +00:00
Dan Gohman
a5f4dbf111 Restore a comment that was lost in the merge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 15:09:54 +00:00
Chris Lattner
813fc422aa convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 06:34:29 +00:00