1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

27384 Commits

Author SHA1 Message Date
Bob Wilson
b75225556d Fix BuildVectorSDNode::isConstantSplat to handle one-element vectors.
It is an error to call APInt::zext with a size that is equal to the value's
current size, so use zextOrTrunc instead.

llvm-svn: 66039
2009-03-04 17:47:01 +00:00
Owen Anderson
fb7f64ea0d Add a restore folder, which shaves a dozen or so machineinstrs off oggenc. Update a testcase to check this.
llvm-svn: 66029
2009-03-04 08:52:31 +00:00
Evan Cheng
7d9019d0f3 Fix PR3666: isel calls to constant addresses.
llvm-svn: 66024
2009-03-04 06:48:53 +00:00
Eli Friedman
1bed40b86a PR3686: make the legalizer handle bitcast from i80 to x86 long double.
llvm-svn: 66021
2009-03-04 06:23:34 +00:00
Dan Gohman
6831e2c2a6 Revert r66004 for now; it's causing a variety of test failures.
llvm-svn: 66008
2009-03-04 03:54:19 +00:00
Dan Gohman
c6c669cc1e Teach the x86 backend to eliminate "test" instructions by using the EFLAGS
result from add, sub, inc, and dec instructions in simple cases.

llvm-svn: 66004
2009-03-04 02:33:24 +00:00
Dale Johannesen
8ca4d24371 Revert unintended commmit.
llvm-svn: 66001
2009-03-04 02:09:48 +00:00
Dale Johannesen
c6bfdb8253 Skip ptr-to-ptr bitcasts when counting in another case.
llvm-svn: 66000
2009-03-04 02:06:53 +00:00
Dale Johannesen
e184480072 Always skip ptr-to-ptr bitcasts when counting,
per Chris' suggestion.  Slightly faster.

llvm-svn: 65999
2009-03-04 01:53:05 +00:00
Evan Cheng
db402a7a49 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.
llvm-svn: 65996
2009-03-04 01:41:49 +00:00
Devang Patel
94ef615585 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.
llvm-svn: 65994
2009-03-04 01:22:23 +00:00
Dale Johannesen
a6f7a45366 Make my earlier patch to skip debug intrinsics
when counting work; it was only off by 1.

llvm-svn: 65993
2009-03-04 01:20:34 +00:00
Bill Wendling
93eeea0493 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.

llvm-svn: 65985
2009-03-04 00:18:06 +00:00
Dale Johannesen
e611f70764 Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead.  Fix this.

llvm-svn: 65979
2009-03-03 23:30:00 +00:00
Dale Johannesen
81b6cd8ce5 Instruction counters must skip the bitcasts that
feed into llvm.dbg.declare nodes, as well as
the debug directives themselves.

llvm-svn: 65976
2009-03-03 22:36:47 +00:00
Devang Patel
9b7c78086b Recursively remove dead argument while removing llvm.dbg.declare intrinsic.
llvm-svn: 65971
2009-03-03 21:31:02 +00:00
Dale Johannesen
ceed180d4c 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.

llvm-svn: 65970
2009-03-03 21:26:39 +00:00
Chris Lattner
db4a8af064 don't #include a header into the middle of an anon namespace.
llvm-svn: 65967
2009-03-03 20:10:23 +00:00
Dan Gohman
3c6c7754b2 Add '(implicit EFLAGS)' for AND, OR, XOR, NEG, INC, and DEC
instructions. These aren't used yet.

llvm-svn: 65965
2009-03-03 19:53:46 +00:00
Bob Wilson
17cf012d93 Use early exit to reduce indentation. No functional change.
llvm-svn: 65962
2009-03-03 19:26:27 +00:00
Bill Wendling
7fdda71ad7 Remove accidental check-ins in r65960. :-(
llvm-svn: 65961
2009-03-03 19:25:16 +00:00
Bill Wendling
8244b700bf Use > instead of >=. We want to promote aggregates of 128-bytes.
llvm-svn: 65960
2009-03-03 19:18:49 +00:00
Bill Wendling
a77bedb70b Reapply r65755, but reversing "<" to ">=".
llvm-svn: 65945
2009-03-03 12:12:58 +00:00
Mikhail Glushenkov
a4a724f737 Oops.
llvm-svn: 65942
2009-03-03 10:04:23 +00:00
Mikhail Glushenkov
1d23d4e16b 80-column violation + trailing whitespace.
llvm-svn: 65936
2009-03-03 07:22:23 +00:00
Zhou Sheng
1e7e86fec4 Ignore the debug info intrinsics when adding instructions into alias sets.
llvm-svn: 65934
2009-03-03 06:02:04 +00:00
Dan Gohman
51d4e8db6a Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.

llvm-svn: 65920
2009-03-03 02:55:14 +00:00
Dale Johannesen
d4a205b300 Don't count DebugInfo instructions in another limit
(lest they affect codegen).

llvm-svn: 65915
2009-03-03 01:43:03 +00:00
Dale Johannesen
33fa9dc8a9 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).

llvm-svn: 65910
2009-03-03 01:09:07 +00:00
Devang Patel
b69b449ce8 Ignore debug info intrinsics.
llvm-svn: 65908
2009-03-03 00:28:44 +00:00
Devang Patel
e98e6bc27c 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.
llvm-svn: 65902
2009-03-02 23:39:14 +00:00
Bob Wilson
5b276b6bc9 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.

llvm-svn: 65899
2009-03-02 23:24:16 +00:00
Nate Begeman
094f4d810f Fix the calculation for how big the allocated stub needs to be.
llvm-svn: 65895
2009-03-02 23:10:14 +00:00
Devang Patel
5220700e0d Remove all dbg symobls, including those with circular references.
This is ugly, but I can't figure out a quick way out of this.

llvm-svn: 65889
2009-03-02 22:50:58 +00:00
Chris Lattner
492d973ba0 Fix main executable path name resolution on FreeBSD, patch by
Ed Schouten!

llvm-svn: 65882
2009-03-02 22:17:15 +00:00
Duncan Sands
51ce06c788 Fix PR3694: add an instcombine micro-optimization that helps
clean up when using variable length arrays in llvm-gcc.

llvm-svn: 65832
2009-03-02 09:18:21 +00:00
Mikhail Glushenkov
3cde18e191 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.

llvm-svn: 65821
2009-03-02 09:01:14 +00:00
Nate Begeman
6b41d33726 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

llvm-svn: 65791
2009-03-01 23:44:07 +00:00
Gabor Greif
3f56efbf04 Another sentinel optimization. This one should always
be a win, since almost every interesting function has at least one Argument.

llvm-svn: 65778
2009-03-01 17:13:15 +00:00
Gabor Greif
dc34b050a2 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.

llvm-svn: 65776
2009-03-01 16:38:10 +00:00
Bill Wendling
0dd6d44518 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.

llvm-svn: 65758
2009-03-01 03:55:12 +00:00
Chris Lattner
7228db7662 hoist the check for alloca size up so that it controls CanConvertToScalar
as well as isSafeAllocaToScalarRepl.

llvm-svn: 65755
2009-03-01 02:26:47 +00:00
Evan Cheng
276f9b02c5 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.

llvm-svn: 65752
2009-03-01 02:03:43 +00:00
Chris Lattner
0cefb564d4 simplify handling "don't print top level name" processing, so that we get
stuff like %A = type { %A*} instead of an upref.

llvm-svn: 65748
2009-03-01 01:16:21 +00:00
Bob Wilson
7482f84ae6 Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a new
method in a BuildVectorSDNode "pseudo-class".

llvm-svn: 65747
2009-03-01 01:13:55 +00:00
Chris Lattner
a9611661b0 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.

llvm-svn: 65743
2009-03-01 00:53:13 +00:00
Chris Lattner
94224fe3d1 walk type symbol table also, so we get:
type opaque		; type %0
	%C = type { %0, %0 }

instead of:

	%C = type { opaque, opaque }

when appropriate.

llvm-svn: 65742
2009-03-01 00:32:33 +00:00
Chris Lattner
f270618038 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.

llvm-svn: 65738
2009-03-01 00:03:38 +00:00
Chris Lattner
1a7eac8434 move type name population out of TypePrinting class into a static
AsmWriter.cpp method.

llvm-svn: 65736
2009-02-28 23:20:19 +00:00
Chris Lattner
666bf65fa3 switch to densemap for pointer->word map.
llvm-svn: 65735
2009-02-28 23:03:55 +00:00