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

44425 Commits

Author SHA1 Message Date
Evan Cheng
e8dfbb5884 Add comment.
llvm-svn: 63506
2009-02-02 08:19:07 +00:00
Evan Cheng
483bbd1643 Teach LowerBRCOND to recognize (xor (setcc x), 1). The xor inverts the condition. It's normally transformed by the dag combiner, unless the condition is set by a arithmetic op with overflow.
llvm-svn: 63505
2009-02-02 08:07:36 +00:00
Chris Lattner
e15f499f9d reject things like: zext <4 x i32> %tmp to i256
llvm-svn: 63504
2009-02-02 07:40:17 +00:00
Chris Lattner
408b359e6e validation error fix.
llvm-svn: 63503
2009-02-02 07:33:15 +00:00
Chris Lattner
27bf492e30 Document type upreferences (PR3380), patch by Stein Roger Skafløtten
with enhancements and corrections by me.

llvm-svn: 63502
2009-02-02 07:32:36 +00:00
Chris Lattner
11cfab6d5b Fix PR3372
llvm-svn: 63501
2009-02-02 07:24:28 +00:00
Chris Lattner
6402178a04 reduce indentation, (~XorCST->getValue()).isSignBit() -> isMaxSignedValue()
llvm-svn: 63500
2009-02-02 07:15:30 +00:00
Chris Lattner
1cb94d541b reduce testcase.
llvm-svn: 63499
2009-02-02 06:55:45 +00:00
Mon P Wang
82e6b51c19 Preserve more SourceValue information.
llvm-svn: 63498
2009-02-02 06:37:55 +00:00
Torok Edwin
110a24e43e add 2 more testcases for -mattr=-sse (r63495).
--This line, and those below, will be ignaored--

A    test/CodeGen/X86/nosse-error1.ll
A    test/CodeGen/X86/nosse-error2.ll

llvm-svn: 63496
2009-02-01 18:24:20 +00:00
Torok Edwin
b4c9a6097f Implement -mno-sse: if SSE is disabled on x86-64, don't store XMM on stack for
var-args, and don't allow FP return values

llvm-svn: 63495
2009-02-01 18:15:56 +00:00
Duncan Sands
cac6cf74f9 Fix PR3453 and probably a bunch of other potential
crashes or wrong code with codegen of large integers:
eliminate the legacy getIntegerVTBitMask and
getIntegerVTSignBit methods, which returned their
value as a uint64_t, so couldn't handle huge types.

llvm-svn: 63494
2009-02-01 18:06:53 +00:00
Bill Wendling
518ecfa97c Forgot some more DebugLoc propagations.
llvm-svn: 63493
2009-02-01 11:19:36 +00:00
Owen Anderson
e7080fe2a9 Fix test failures causes by my previous commit.
llvm-svn: 63492
2009-02-01 08:41:54 +00:00
Owen Anderson
f403ec470e Fix an issue in PHI construction that was exposed by GCC 4.2 producing a different set iteration order for the reg_iterator.
llvm-svn: 63490
2009-02-01 07:06:00 +00:00
Evan Cheng
d650c9ecd7 Fix PR3423: Link llvm on ARM EABI machines. Patch by Robert Schuster.
llvm-svn: 63489
2009-02-01 06:42:27 +00:00
Dale Johannesen
4956419c77 DebugLoc propagation.
llvm-svn: 63488
2009-01-31 22:04:51 +00:00
Nick Lewycky
e25b96473e Reinstate this optimization to fold icmp of xor when possible. Don't try to
turn icmp eq a+x, b+x into icmp eq a, b if a+x or b+x has other uses. This
may have been increasing register pressure leading to the bzip2 slowdown.

llvm-svn: 63487
2009-01-31 21:30:05 +00:00
Dale Johannesen
98a9d2534b DebugLoc propagation. Done with file.
llvm-svn: 63486
2009-01-31 21:04:24 +00:00
Dale Johannesen
fe9622a384 DebugLoc propagation. Done with file.
llvm-svn: 63485
2009-01-31 20:01:02 +00:00
Chris Lattner
26698a600e Fix PR3452 (an infinite loop bootstrapping) by disabling the recent
improvements to the EvaluateInDifferentType code.  This code works 
by just inserted a bunch of new code and then seeing if it is 
useful.  Instcombine is not allowed to do this: it can only insert
new code if it is useful, and only when it is converging to a more
canonical fixed point.  Now that we iterate when DCE makes progress,
this causes an infinite loop when the code ends up not being used.

llvm-svn: 63483
2009-01-31 19:05:27 +00:00
Duncan Sands
74179a9dde Fix PR3401: when using large integers, the type
returned by getShiftAmountTy may be too small
to hold shift values (it is an i8 on x86-32).
Before and during type legalization, use a large
but legal type for shift amounts: getPointerTy;
afterwards use getShiftAmountTy, fixing up any
shift amounts with a big type during operation
legalization.  Thanks to Dan for writing the
original patch (which I shamelessly pillaged).

llvm-svn: 63482
2009-01-31 15:50:11 +00:00
Chris Lattner
c4729610fc now that all the pieces are in place, teach instcombine's
simplifydemandedbits to simplify instructions with *multiple
uses* in contexts where it can get away with it.  This allows
it to simplify the code in multi-use-or.ll into a single 'add 
double'.

This change is particularly interesting because it will cover
up for some common codegen bugs with large integers created due
to the recent SROA patch.  When working on fixing those bugs,
this should be disabled.

llvm-svn: 63481
2009-01-31 08:40:03 +00:00
Chris Lattner
85ecfee7f3 simplify/clarify control flow and improve comments, no functionality change.
llvm-svn: 63480
2009-01-31 08:24:16 +00:00
Chris Lattner
a899f8b75d make some fairly meaty internal changes to how SimplifyDemandedBits works.
Now, if it detects that "V" is the same as some other value, 
SimplifyDemandedBits returns the new value instead of RAUW'ing it immediately.
This has two benefits:
1) simpler code in the recursive SimplifyDemandedBits routine.
2) it allows future fun stuff in instcombine where an operation has multiple
   uses and can be simplified in one context, but not all.

#2 isn't implemented yet, this patch should have no functionality change.

llvm-svn: 63479
2009-01-31 08:15:18 +00:00
Chris Lattner
293fe58ff3 add accessors
llvm-svn: 63478
2009-01-31 07:34:19 +00:00
Chris Lattner
95fe6579dd minor cleanups
llvm-svn: 63477
2009-01-31 07:26:06 +00:00
Chris Lattner
abf34563ec make sure to set Changed=true when instcombine hacks on the code,
not doing so prevents it from properly iterating and prevents it
from deleting the entire body of dce-iterate.ll

llvm-svn: 63476
2009-01-31 07:04:22 +00:00
Mon P Wang
1cc0fd54b7 Used "-enable-unsafe-fp-math" to allow this transformation - (a * b -c) = c - a *b.
llvm-svn: 63475
2009-01-31 06:50:54 +00:00
Mon P Wang
2a0cce6b1c If unsafe FP optimization is not set, don't allow -(A-B) => B-A because
when A==B, -0.0 != +0.0.

llvm-svn: 63474
2009-01-31 06:07:45 +00:00
Bill Wendling
679d743429 Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
llvm-svn: 63473
2009-01-31 03:12:48 +00:00
Chris Lattner
235913be77 Simplify and generalize the SROA "convert to scalar" transformation to
be able to handle *ANY* alloca that is poked by loads and stores of 
bitcasts and GEPs with constant offsets.  Before the code had a number
of annoying limitations and caused it to miss cases such as storing into
holes in structs and complex casts (as in bitfield-sroa) where we had
unions of bitfields etc.  This also handles a number of important cases
that are exposed due to the ABI lowering stuff we do to pass stuff by
value.

One case that is pretty great is that we compile 
2006-11-07-InvalidArrayPromote.ll into:

define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
	%tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1)
	%tmp105 = bitcast <4 x i32> %tmp10 to i128
	%tmp1056 = zext i128 %tmp105 to i256	
	%tmp.upgrd.43 = lshr i256 %tmp1056, 96
	%tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32	
	ret i32 %tmp.upgrd.44
}

which turns into:

_func:
	subl	$28, %esp
	cvttps2dq	%xmm1, %xmm0
	movaps	%xmm0, (%esp)
	movl	12(%esp), %eax
	addl	$28, %esp
	ret

Which is pretty good code all things considering :).

One effect of this is that SROA will start generating arbitrary bitwidth 
integers that are a multiple of 8 bits.  In the case above, we got a 
256 bit integer, but the codegen guys assure me that it can handle the 
simple and/or/shift/zext stuff that we're doing on these operations.

This addresses rdar://6532315

llvm-svn: 63469
2009-01-31 02:28:54 +00:00
Dale Johannesen
067e8ef08f Move CurDebugLoc into SelectionDAGLowering.
llvm-svn: 63468
2009-01-31 02:22:37 +00:00
Gabor Greif
414be71cd6 back out my previous change, it exposes a latent bug. investigating
llvm-svn: 63463
2009-01-31 01:31:59 +00:00
Gabor Greif
90bf8d1c4b use precise accessors
llvm-svn: 63459
2009-01-31 00:58:14 +00:00
Dale Johannesen
58ff487b47 Propagate debug info in LegalizeFloatTypes.
Complete (modulo bugs).

llvm-svn: 63458
2009-01-31 00:43:08 +00:00
Dale Johannesen
dc351f5461 Propagate debug info. This file complete
(modulo bugs)

llvm-svn: 63457
2009-01-31 00:20:43 +00:00
Dale Johannesen
7231c1ead7 Propagate debug info through MakeLibCall and a
couple of things that use it.

llvm-svn: 63456
2009-01-31 00:11:23 +00:00
Bill Wendling
33e437d960 More DebugLoc propagation.
llvm-svn: 63454
2009-01-30 23:59:18 +00:00
Bill Wendling
191c1bcb0c More DebugLoc propagation.
llvm-svn: 63452
2009-01-30 23:36:47 +00:00
Bill Wendling
061530382c More DebugLoc propagation in LOAD etc. methods.
llvm-svn: 63451
2009-01-30 23:27:35 +00:00
Dale Johannesen
7eb7de0393 Fix build on case-sensitive filesystems (i.e. everybody else)
llvm-svn: 63448
2009-01-30 23:20:42 +00:00
Bill Wendling
8038d99071 More DebugLoc propagation in floating-point methods.
llvm-svn: 63446
2009-01-30 23:15:49 +00:00
Dale Johannesen
39738b1ff8 Make LowerCallTo and LowerArguments take a DebugLoc
argument.  Adjust all callers and overloaded versions.

llvm-svn: 63444
2009-01-30 23:10:59 +00:00
Bill Wendling
cebc5ac36d Standardize comments about folding xforms.
llvm-svn: 63443
2009-01-30 23:10:18 +00:00
Bill Wendling
67737da99b Get rid of the non-DebugLoc-ified getNOT() method.
llvm-svn: 63442
2009-01-30 23:03:19 +00:00
Bill Wendling
b3ece8cc6f Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63441
2009-01-30 22:57:07 +00:00
Bill Wendling
00f0882476 Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63440
2009-01-30 22:53:48 +00:00
Bill Wendling
bfa7cfd7c7 Propagate debug loc info for BIT_CONVERT.
llvm-svn: 63439
2009-01-30 22:44:24 +00:00
Bill Wendling
c05f48a66d Propagate debug loc info for more *_EXTEND methods.
llvm-svn: 63437
2009-01-30 22:33:24 +00:00