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

38834 Commits

Author SHA1 Message Date
Chris Lattner
fd83f89e21 rewrite the validity checking for memory promotion to be simpler,
more aggressive, and more correct.  Verify that we only attempt to
promote loads and stores.

llvm-svn: 51406
2008-05-22 03:22:42 +00:00
Chris Lattner
f2a62165ee minor edits
llvm-svn: 51405
2008-05-22 03:06:14 +00:00
Chris Lattner
a34f7317e9 Use 'continue' to reduce nesting in this loop. No functionality change.
llvm-svn: 51399
2008-05-22 00:53:38 +00:00
Dan Gohman
2804408839 Add a Type::isSingleValueType method. This will be used by code
that currently uses Type::isFirstClassType and depends on it
returning false for struct or array types.

This commit doesn't change the behavior of Type::isFirstClassType.

llvm-svn: 51396
2008-05-21 23:35:53 +00:00
Evan Cheng
8e02953de8 Fix PR2343. An *interesting* coalescer bug.
BB1:                                                                                                                                                  
  vr1025 = copy vr1024                                                                                                                                
  ..                                                                                                                                                  
BB2:                                                                                                                                                  
  vr1024 = op                                                                                                                                         
         = op vr1025                                                                                                                                     
  <loop eventually branch back to BB1>

Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.

llvm-svn: 51394
2008-05-21 22:34:12 +00:00
Bill Wendling
7ec2aad450 Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't
64-bit clean shouldn't warn if #including Path.h and specifying
-Wshorten-64-to-32.

llvm-svn: 51393
2008-05-21 21:20:07 +00:00
Gabor Greif
06c4e61e6b update a comment
llvm-svn: 51390
2008-05-21 18:57:33 +00:00
Gabor Greif
3df566d9ec adapt to new API
llvm-svn: 51387
2008-05-21 18:30:15 +00:00
Evan Cheng
272fb86c64 Rename -no-lazy to -disable-lazy-compilation.
llvm-svn: 51386
2008-05-21 18:20:21 +00:00
Nate Begeman
26bb02a23a Fix a couple issues with the JIT and multiple modules:
1. The "JITState" object creates a PassManager with the ModuleProvider that the
   jit is created with.  If the ModuleProvider is removed and deleted, the
   PassManager is invalid.

2. The Global maps in the JIT were not invalidated with a ModuleProvider was 
   removed.  This could lead to a case where the Module would be freed, and a 
   new Module with Globals at the same addresses could return invalid results.

llvm-svn: 51384
2008-05-21 16:34:48 +00:00
Gabor Greif
4a39cea7e7 resurrect lost tests by renaming them to not end with .tr
llvm-svn: 51375
2008-05-21 14:48:24 +00:00
Gabor Greif
aa0a5c230c suppress gcc3.4.6's <no value returned> warnings
llvm-svn: 51372
2008-05-21 14:07:30 +00:00
Dan Gohman
ad548e93f7 When LSR is replacing an instruction, call
ScalarEvolution::deleteValueFromRecords on it before doing the
replaceAllUsesWith, because ScalarEvolution looks at the instruction's
users to find SCEV references to the instruction's SCEV object in its
internal maps.

Move all of LSR's loop-related state clearing after processing the loop
and before cleaning up dead PHI nodes. This eliminates all of LSR's SCEV
references just before the calls to ScalarEvolution::deleteValueFromRecords
so that when ScalarEvolution drops its own SCEV references, the reference
counts will reach zero and the SCEVs will be deleted immediately.

These changes fix some compiler aborts involving ScalarEvolution holding
onto and reusing SCEV objects for instructions that have been deleted.
No regression test unfortunately; because the symptoms were due to
dangling pointers, reduced testcases ended up being fairly arbitrary.

llvm-svn: 51359
2008-05-21 00:54:12 +00:00
Bill Wendling
f4cc5ad69a Reverting r51218 because of breakage on PPC32.
llvm-svn: 51358
2008-05-20 23:54:27 +00:00
Gabor Greif
b03785f0cd Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.
llvm-svn: 51357
2008-05-20 22:07:21 +00:00
Chris Lattner
821dc30131 Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.

llvm-svn: 51356
2008-05-20 22:05:28 +00:00
Dan Gohman
7d78d53d2a Oops, commit the version of this test that actually works.
llvm-svn: 51351
2008-05-20 21:19:36 +00:00
Dan Gohman
b48d4a75f6 Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
now that instcombine also has ComputeNumSignBits.

llvm-svn: 51350
2008-05-20 21:01:12 +00:00
Gabor Greif
807c2df887 sabre brings to my attention that the 'tr' suffix is also obsolete
llvm-svn: 51349
2008-05-20 21:00:03 +00:00
Dan Gohman
d545f5b229 Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.

llvm-svn: 51348
2008-05-20 20:59:51 +00:00
Dan Gohman
287e750e64 Code simplification.
llvm-svn: 51345
2008-05-20 20:56:33 +00:00
Chris Lattner
7d9e5793c5 Clarify that and/or/xor/sdiv etc all allow vectors.
llvm-svn: 51335
2008-05-20 20:48:21 +00:00
Chris Lattner
4bec425e1d Clarify copyright transfer when you don't own the copyright of
the contributed code.

llvm-svn: 51329
2008-05-20 20:06:53 +00:00
Gabor Greif
d8a4dbb5da Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
llvm-svn: 51328
2008-05-20 19:52:04 +00:00
Evan Cheng
d694e78e36 movsd and movq do not require 16-byte alignment. This fixes vec_set-5.ll on Linux.
llvm-svn: 51327
2008-05-20 18:24:47 +00:00
Chris Lattner
02cace1d88 "The two generated files in the AsmParser.vcproj are pointing to the
wrong directory, this is the patch to fix it (also attached)."

Patch by 'OvermindDL1'

llvm-svn: 51323
2008-05-20 17:27:57 +00:00
Matthijs Kooijman
bfd128375e Clarify the testing documentation a bit and solve two HTML validator warnings.
llvm-svn: 51313
2008-05-20 10:28:55 +00:00
Evan Cheng
55e3957c96 More local spiller complexity!
If local spiller optimization turns some instruction into an identity copy, it will be removed. If the output register happens to be dead (and source is obviously killed), transfer the kill / dead information to last use / def in the same MBB.

llvm-svn: 51306
2008-05-20 08:13:21 +00:00
Evan Cheng
408425f0e0 Don't spill dead def.
llvm-svn: 51305
2008-05-20 08:10:37 +00:00
Matthijs Kooijman
9247675761 Fix typo.
llvm-svn: 51303
2008-05-20 07:26:45 +00:00
Chris Lattner
b387fd90fc Teach instcombine 4 new xforms:
(add (sext x), cst) --> (sext (add x, cst'))
  (add (sext x), (sext y)) --> (sext (add int x, y))
  (add double (sitofp x), fpcst) --> (sitofp (add int x, intcst))
  (add double (sitofp x), (sitofp y)) --> (sitofp (add int x, y))

This generally reduces conversions.  For example MiBench/telecomm-gsm
gets these simplifications:

HACK2: 	%tmp67.i142.i.i = sext i16 %tmp6.i141.i.i to i32		; <i32> [#uses=1]
	%tmp23.i139.i.i = sext i16 %tmp2.i138.i.i to i32		; <i32> [#uses=1]
	%tmp8.i143.i.i = add i32 %tmp67.i142.i.i, %tmp23.i139.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i121.i.i = sext i16 %tmp6.i120.i.i to i32		; <i32> [#uses=1]
	%tmp23.i118.i.i = sext i16 %tmp2.i117.i.i to i32		; <i32> [#uses=1]
	%tmp8.i122.i.i = add i32 %tmp67.i121.i.i, %tmp23.i118.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i.i190.i = sext i16 %tmp6.i.i189.i to i32		; <i32> [#uses=1]
	%tmp23.i.i187.i = sext i16 %tmp2.i.i186.i to i32		; <i32> [#uses=1]
	%tmp8.i.i191.i = add i32 %tmp67.i.i190.i, %tmp23.i.i187.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i173.i.i.i = sext i16 %tmp6.i172.i.i.i to i32		; <i32> [#uses=1]
	%tmp23.i170.i.i.i = sext i16 %tmp2.i169.i.i.i to i32		; <i32> [#uses=1]
	%tmp8.i174.i.i.i = add i32 %tmp67.i173.i.i.i, %tmp23.i170.i.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i152.i.i.i = sext i16 %tmp6.i151.i.i.i to i32		; <i32> [#uses=1]
	%tmp23.i149.i.i.i = sext i16 %tmp2.i148.i.i.i to i32		; <i32> [#uses=1]
	%tmp8.i153.i.i.i = add i32 %tmp67.i152.i.i.i, %tmp23.i149.i.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i.i.i.i = sext i16 %tmp6.i.i.i.i to i32		; <i32> [#uses=1]
	%tmp23.i.i5.i.i = sext i16 %tmp2.i.i.i.i to i32		; <i32> [#uses=1]
	%tmp8.i.i7.i.i = add i32 %tmp67.i.i.i.i, %tmp23.i.i5.i.i		; <i32> [#uses=3]


This also fixes a bug in ComputeNumSignBits handling select and
makes it more aggressive with and/or.

llvm-svn: 51302
2008-05-20 05:46:13 +00:00
Chris Lattner
323a985507 fix two issues Neil noticed, thanks!
llvm-svn: 51296
2008-05-20 03:50:52 +00:00
Chris Lattner
5c3ce73720 Add a bool to isEdgeFeasible that tells it whether to treat unknown
value as undef or untracked.

llvm-svn: 51295
2008-05-20 03:39:39 +00:00
Dan Gohman
e6bb320822 Fix ExecutionEngine's constant code to work properly when structs and arrays
will become first-class types.

llvm-svn: 51293
2008-05-20 03:20:09 +00:00
Dan Gohman
c2bd39553c Refine the fix in r51169 to only apply when the operand val being
replaced is a PHI. This prevents it from inserting uses before defs
in the case that it isn't a PHI and it depends on other instructions
later in the block. This fixes the 447.dealII regression on x86-64.

llvm-svn: 51292
2008-05-20 03:01:48 +00:00
Evan Cheng
e95fc3e83d runOnMachineFunction should set IsPIC because relocation model may have been changed.
llvm-svn: 51291
2008-05-20 01:56:59 +00:00
Dan Gohman
3f6b53dba0 Make AssociativeOpt static.
llvm-svn: 51290
2008-05-20 01:14:05 +00:00
Dan Gohman
7681889f75 Run vortex-bug as x86-64, which is what the original bug was triggered on.
llvm-svn: 51289
2008-05-20 00:54:39 +00:00
Steve Naroff
a1c616ae1d Silence a warning about "*/" outside a comment.
llvm-svn: 51287
2008-05-20 00:46:15 +00:00
Devang Patel
9f385d71c2 Do not erase induction variable increment if it is used outside the loop.
llvm-svn: 51280
2008-05-19 22:23:55 +00:00
Dan Gohman
2d2351f037 Add a ComputeNumSignBits function for use by instcombine, based on the
code in SelectionDAG.

llvm-svn: 51279
2008-05-19 22:14:15 +00:00
Dale Johannesen
e6977495aa Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.

llvm-svn: 51277
2008-05-19 21:38:18 +00:00
Chris Lattner
859485412b switch to Type::getFPMantissaWidth instead of reinventing it.
llvm-svn: 51275
2008-05-19 21:17:23 +00:00
Chris Lattner
f6ed78c9c7 add a helper method.
llvm-svn: 51274
2008-05-19 21:17:01 +00:00
Chris Lattner
92599bcc72 minor cleanups, teach instcombine that sitofp/uitofp cannot
produce a negative zero.

llvm-svn: 51272
2008-05-19 20:27:56 +00:00
Chris Lattner
63c384df1e convert fptosi(sitofp x) -> x if the fp value has enough bits in its mantissa
to accurately represent the integer.  This triggers 9 times in 471.omnetpp,
though 8 of those seem to be inlined from the same place.

llvm-svn: 51271
2008-05-19 20:25:04 +00:00
Chris Lattner
1435b94f62 Fold FP comparisons where one operand is converted from an integer
type and the other operand is a constant into integer comparisons.
This happens surprisingly frequently (e.g. 10 times in 471.omnetpp),
which are things like this:

	%tmp8283 = sitofp i32 %tmp82 to double	
	%tmp1013 = fcmp ult double %tmp8283, 0.0

Clearly comparing tmp82 against i32 0 is cheaper here.

this also triggers 8 times in gobmk, including this one:

	%tmp375376 = sitofp i32 %tmp375 to double
	%tmp377 = fcmp ogt double %tmp375376, 8.150000e+01

which is comparing an integer against 81.5 :).

llvm-svn: 51268
2008-05-19 20:18:56 +00:00
Bill Wendling
1866fa680f Remove warnings about unused parameters and shadowed variables.
llvm-svn: 51266
2008-05-19 20:15:12 +00:00
Chris Lattner
ad02ff166e remove debug output
llvm-svn: 51264
2008-05-19 20:03:53 +00:00
Chris Lattner
510a6b249c be more aggressive about transforming add -> or when the operands have no
intersecting bits.  This triggers all over the place, for example in lencode,
with adds of stuff like:

	%tmp580 = mul i32 %tmp579, 2	
	%tmp582 = and i32 %b8, 1
and

	%tmp28 = shl i32 %abs.i, 1		
	%sign.0 = select i1 %tmp23, i32 1, i32 0
and
	%tmp344 = shl i32 %tmp343, 2	
	%tmp346 = and i32 %tmp96, 3

etc.

llvm-svn: 51263
2008-05-19 20:01:56 +00:00