Commit Graph

27467 Commits

Author SHA1 Message Date
Dan Gohman
29582d1223 Revert r66004 for now; it's causing a variety of test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 03:54:19 +00:00
Dan Gohman
12bbc52aa7 Teach the x86 backend to eliminate "test" instructions by using the EFLAGS
result from add, sub, inc, and dec instructions in simple cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66004 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:33:24 +00:00
Dale Johannesen
0744f09efc Revert unintended commmit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:09:48 +00:00
Dale Johannesen
d9c05d7711 Skip ptr-to-ptr bitcasts when counting in another case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:06:53 +00:00
Dale Johannesen
cdb16aa5ab Always skip ptr-to-ptr bitcasts when counting,
per Chris' suggestion.  Slightly faster.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:53:05 +00:00
Evan Cheng
599a6a88ce Fix PR3701. 1. X86 target renamed eflags register to flags. This matches what llvm-gcc generates so codegen knows flags register is being clobbered by inline asm. 2. BURR scheduler should also check if inline asm nodes can clobber "live" physical registers. Previously it was only checking target nodes with implicit defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:41:49 +00:00
Devang Patel
7f6179d1d8 If a global constant is dead then global's debug info should not prevent the optimizer in deleting the global. And while deleting global, delete global's debug info also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:22:23 +00:00
Dale Johannesen
0d6596b7bf Make my earlier patch to skip debug intrinsics
when counting work; it was only off by 1.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:20:34 +00:00
Bill Wendling
36ae6c1827 The DAG combiner was performing a BT combine. The BT combine had a value of -1,
so it changed it into a 31 via the TLO.ShrinkDemandedConstant() call. Then it
would go through the DAG combiner again. This time it had a value of 31, which
was turned into a -1 by TLI.SimplifyDemandedBits(). This would ping pong
forever.

Teach the TLO.ShrinkDemandedConstant() call not to lower a value if the demanded
value is an XOR of all ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 00:18:06 +00:00
Dale Johannesen
127a7936de Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead.  Fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 23:30:00 +00:00
Dale Johannesen
4ded40a44d Instruction counters must skip the bitcasts that
feed into llvm.dbg.declare nodes, as well as
the debug directives themselves.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 22:36:47 +00:00
Devang Patel
9adb01cbc3 Recursively remove dead argument while removing llvm.dbg.declare intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 21:31:02 +00:00
Dale Johannesen
4945c65784 When removing a store to an alloca that has only one
use, check also for the case where it has two uses,
the other being a llvm.dbg.declare.  This is needed so
debug info doesn't affect codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 21:26:39 +00:00
Chris Lattner
44e3dd1672 don't #include a header into the middle of an anon namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 20:10:23 +00:00
Dan Gohman
09a2609e20 Add '(implicit EFLAGS)' for AND, OR, XOR, NEG, INC, and DEC
instructions. These aren't used yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:53:46 +00:00
Bob Wilson
f2950b0051 Use early exit to reduce indentation. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:26:27 +00:00
Bill Wendling
1c85503e38 Remove accidental check-ins in r65960. :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:25:16 +00:00
Bill Wendling
3aaf5d9933 Use > instead of >=. We want to promote aggregates of 128-bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:18:49 +00:00
Bill Wendling
5a377cb27b Reapply r65755, but reversing "<" to ">=".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 12:12:58 +00:00
Mikhail Glushenkov
c834bbf558 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 10:04:23 +00:00
Mikhail Glushenkov
eba2cb0d5a 80-column violation + trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 07:22:23 +00:00
Zhou Sheng
7e4286eb7c Ignore the debug info intrinsics when adding instructions into alias sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 06:02:04 +00:00
Dan Gohman
0f8b53f19d Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 02:55:14 +00:00
Dale Johannesen
acb51a3037 Don't count DebugInfo instructions in another limit
(lest they affect codegen).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 01:43:03 +00:00
Dale Johannesen
bd8e650876 When sinking an insn in InstCombine bring its debug
info with it.
Don't count debug info insns against the scan maximum
in FindAvailableLoadedValue (lest they affect codegen).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 01:09:07 +00:00
Devang Patel
cd11991203 Ignore debug info intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 00:28:44 +00:00
Devang Patel
cf42ee42b1 If branch conditions' one successor is dominating another non-latch successor then this loop's iteration space can not be restricted. In this example block bb5 is always executed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 23:39:14 +00:00
Bob Wilson
24e338e8a3 Generalize BuildVectorSDNode::isConstantSplat to use APInts and handle
arbitrary vector sizes.  Add an optional MinSplatBits parameter to specify
a minimum for the splat element size.  Update the PPC target to use the
revised interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 23:24:16 +00:00
Nate Begeman
0b82f77e66 Fix the calculation for how big the allocated stub needs to be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 23:10:14 +00:00
Devang Patel
73df3c9721 Remove all dbg symobls, including those with circular references.
This is ugly, but I can't figure out a quick way out of this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 22:50:58 +00:00
Chris Lattner
893a0f9f0e Fix main executable path name resolution on FreeBSD, patch by
Ed Schouten!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 22:17:15 +00:00
Duncan Sands
5b7cfb02f7 Fix PR3694: add an instcombine micro-optimization that helps
clean up when using variable length arrays in llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:18:21 +00:00
Mikhail Glushenkov
f188178a2f Reorganize llvmc code.
Move the code from 'llvmc/driver' into a new CompilerDriver library, and change
the build system accordingly. Makes it easier for projects using LLVM to build
their own llvmc-based drivers.

Tested with objdir != srcdir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:01:14 +00:00
Nate Begeman
cbd88adea6 Fix a problem with DAGCombine on 64b targets where folding
extracts + build_vector into a shuffle would fail, because the
type of the new build_vector would not be legal.  Try harder to
create a legal build_vector type.  Note: this will be totally 
irrelevant once vector_shuffle no longer takes a build_vector for
shuffle mask.

New:
_foo:
	xorps	%xmm0, %xmm0
	xorps	%xmm1, %xmm1
	subps	%xmm1, %xmm1
	mulps	%xmm0, %xmm1
	addps	%xmm0, %xmm1
	movaps	%xmm1, 0

Old:
_foo:
	xorps	%xmm0, %xmm0
	movss	%xmm0, %xmm1
	xorps	%xmm2, %xmm2
	unpcklps	%xmm1, %xmm2
	pshufd	$80, %xmm1, %xmm1
	unpcklps	%xmm1, %xmm2
	pslldq	$16, %xmm2
	pshufd	$57, %xmm2, %xmm1
	subps	%xmm0, %xmm1
	mulps	%xmm0, %xmm1
	addps	%xmm0, %xmm1
	movaps	%xmm1, 0



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 23:44:07 +00:00
Gabor Greif
5e7d4d643d Another sentinel optimization. This one should always
be a win, since almost every interesting function has at least one Argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 17:13:15 +00:00
Gabor Greif
abd6f28a74 Reuse a technique (pioneered for BasicBlocks) of superposing ilist with
its sentinel. This is quite a win when a function really has a basic block.                  
When the function is just a declaration (and stays so) the old way did not
allocate a sentinel. So this change is most beneficial when the ratio of
function definition to declaration is high. I.e. linkers etc. Incidentally  
these are the most resource demanding applications, so I expect that the
reduced malloc traffic, locality and space savings outweigh the cost of
addition of two pointers to Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 16:38:10 +00:00
Bill Wendling
8fe40819ae Temporarily revert r65755. It was causing failures in the self-hosting
testsuite:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/nancvt.ll
Failed with exit(1) at line 2
while running: grep 2147027116 nancvt.ll.tmp | count 3
count: expected 3 lines and got        0.
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/vec_ins_extract.ll
Failed with exit(1) at line 1
while running:  llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/vec_ins_extract.ll |  opt -scalarrepl -instcombine |   llc -march=x86 -mcpu=yonah | not /usr/bin/grep sub.*esp
      subl      $28, %esp
      subl      $28, %esp
child process exited abnormally

And more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 03:55:12 +00:00
Chris Lattner
af89a3f1d3 hoist the check for alloca size up so that it controls CanConvertToScalar
as well as isSafeAllocaToScalarRepl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 02:26:47 +00:00
Evan Cheng
870b80722f Minor optimization:
Look for situations like this:                                                                                                                                                              
%reg1024<def> = MOV r1                                                                                                                                                                      
%reg1025<def> = MOV r0                                                                                                                                                                      
%reg1026<def> = ADD %reg1024, %reg1025                                                                                                                                                      
r0            = MOV %reg1026                                                                                                                                                                
Commute the ADD to hopefully eliminate an otherwise unavoidable copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 02:03:43 +00:00
Chris Lattner
d2b6cb0a2b simplify handling "don't print top level name" processing, so that we get
stuff like %A = type { %A*} instead of an upref.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 01:16:21 +00:00
Bob Wilson
a27ea9e89f Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a new
method in a BuildVectorSDNode "pseudo-class".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 01:13:55 +00:00
Chris Lattner
f6f0bdfec3 Fix a pretty awesome bug that only happened in a strange case with anonymous
types.  This was reading the uint for the keyword after the token was advanced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 00:53:13 +00:00
Chris Lattner
884858608b walk type symbol table also, so we get:
type opaque		; type %0
	%C = type { %0, %0 }

instead of:

	%C = type { opaque, opaque }

when appropriate.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 00:32:33 +00:00
Chris Lattner
413fd2304d Fix a long-standing bug and misfeature of the disassembler: when dealing with a
stripped .bc file, it didn't make any attempt to try to reuse anonymous types.
This causes an amazing type explosion due to types getting duplicated everywhere
they are referenced and other problems.

This also caused correctness issues, because opaque types are unique for each time
they are uttered in the file.  This means that stripping a .bc file could produce
a .ll file that could not be assembled (e.g. 2009-02-28-StripOpaqueName.ll).

This patch fixes both of these issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 00:03:38 +00:00
Chris Lattner
e9fa33eb66 move type name population out of TypePrinting class into a static
AsmWriter.cpp method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 23:20:19 +00:00
Chris Lattner
87185e82f6 switch to densemap for pointer->word map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 23:03:55 +00:00
Chris Lattner
ae3042316f delete a bunch of duplicated type printing logic, using the type printing
stuff in AsmWriter.cpp for Type::getDescription().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 23:01:57 +00:00
Chris Lattner
8ab55b747d make this work when constructed with a null module*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 23:01:30 +00:00
Chris Lattner
d8030a7179 expose TypePrinting as a public API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 22:34:45 +00:00
Chris Lattner
30794269d5 rename 'Result' to 'OS' in CalcTypeName for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 21:27:31 +00:00