Commit Graph

27453 Commits

Author SHA1 Message Date
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
Chris Lattner
0f7364b4aa do not embed the raw_ostream into TypePrinting, pass it as an argument to print etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 21:26:53 +00:00
Chris Lattner
583ffd8787 stop calling Type::getDescription().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 21:18:43 +00:00
Chris Lattner
6d4306e63c simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 21:11:05 +00:00
Chris Lattner
c287137ce7 Change WriteTypeSymbolic to not put a space out before types, also, remove
the old std::ostream version.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65720 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 21:05:51 +00:00
Chris Lattner
534361e7e1 make CalcTypeName take a stream instead of a string to concat onto,
eliminate redundant opaque handling code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:49:40 +00:00
Chris Lattner
a32c3e4b1d remove a bunch of nearly-duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:40:29 +00:00
Chris Lattner
36942d7383 fix indentation, remove dead integer case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:35:42 +00:00
Chris Lattner
b840cace77 pull calcTypeName into TypePrinting class, make its type stack
be a smallvector instead of vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:34:19 +00:00
Chris Lattner
b1b9d91a39 inline method into its only use and simplify the result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:31:14 +00:00
Chris Lattner
88344e63d4 simplify condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:28:50 +00:00
Chris Lattner
9cc3446e57 start refactoring the .ll printer: introduce a new TypePrinting class
and move all related stuff to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:25:14 +00:00
Chris Lattner
452e2627dc reject 0 element vectors with:
@a = internal constant void bitcast(<0 x i8> <> to void)
                                     ^

Fixes PR3685


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 18:12:41 +00:00
Evan Cheng
c8bb37a50a Last commit accidentially deleted this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 06:02:14 +00:00
Mon P Wang
9feb5dd568 Added another darwin subtarget
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 00:25:30 +00:00