Commit Graph

23150 Commits

Author SHA1 Message Date
Dan Gohman
399101a599 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:17:26 +00:00
Dale Johannesen
bbcb34cafb Put const weak stuff in appropriate section on Darwin.
g++.dg/abi/key2.C



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:16:59 +00:00
Dan Gohman
31e5bdccf2 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:12:03 +00:00
Evan Cheng
5bbaf01b84 X86CodeEmitter should not set PIC style to None at initialization time. This will break codegen if relocation model is changed to PIC_ later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 23:55:24 +00:00
Dan Gohman
b64aa119d8 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 23:43:22 +00:00
Dan Gohman
fdfef0da6b Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 22:30:09 +00:00
David Greene
abe93d95e8 When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 21:16:33 +00:00
David Greene
cff860801e Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51439 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 21:12:21 +00:00
Gabor Greif
785c6af979 transform more loops to iterator form, detabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51436 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 19:24:54 +00:00
Evan Cheng
c36c0ab44b Add missing patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 18:56:56 +00:00
Gabor Greif
de2d74b213 Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:43:33 +00:00
Chris Lattner
687a4cb295 fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:29:38 +00:00
Chris Lattner
f6a048c3a8 Add support for multiple-return values in inline asm. This should
get inline asm working as well as it did previously with the CBE
with the new MRV support for inline asm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51420 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:19:37 +00:00
Chris Lattner
ea21ad4926 Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here: 
test/CodeGen/X86/asm-indirect-mem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 04:46:38 +00:00
Chris Lattner
05a24e5efe Free and vaarg are not really volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 03:23:06 +00:00
Chris Lattner
19d9d4364e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 03:22:42 +00:00
Chris Lattner
29d929363d Use 'continue' to reduce nesting in this loop. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 00:53:38 +00:00
Evan Cheng
f4ea510371 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 22:34:12 +00:00
Bill Wendling
40db5d4539 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 21:20:07 +00:00
Nate Begeman
f049e07eb8 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 16:34:48 +00:00
Gabor Greif
33e456d5f3 suppress gcc3.4.6's <no value returned> warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 14:07:30 +00:00
Dan Gohman
010ee2d955 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 00:54:12 +00:00
Chris Lattner
eb0fdc150a Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 22:05:28 +00:00
Dan Gohman
f35c8822a3 Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
now that instcombine also has ComputeNumSignBits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 21:01:12 +00:00
Dan Gohman
c84941be0a Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 20:59:51 +00:00
Dan Gohman
1fdfa6aabf Code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51345 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 20:56:33 +00:00
Evan Cheng
8e8de684c7 movsd and movq do not require 16-byte alignment. This fixes vec_set-5.ll on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51327 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 18:24:47 +00:00
Evan Cheng
7a0f1851ec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51306 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 08:13:21 +00:00
Evan Cheng
b0a6f62c9b Don't spill dead def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 08:10:37 +00:00
Matthijs Kooijman
6e7b322d36 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 07:26:45 +00:00
Chris Lattner
3d28b1b35b 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 05:46:13 +00:00
Chris Lattner
851627892d fix two issues Neil noticed, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 03:50:52 +00:00
Chris Lattner
28a8dbc35f Add a bool to isEdgeFeasible that tells it whether to treat unknown
value as undef or untracked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51295 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 03:39:39 +00:00
Dan Gohman
638e378f2c Fix ExecutionEngine's constant code to work properly when structs and arrays
will become first-class types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 03:20:09 +00:00
Dan Gohman
ca756ae886 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51292 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 03:01:48 +00:00
Evan Cheng
a125e62117 runOnMachineFunction should set IsPIC because relocation model may have been changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 01:56:59 +00:00
Dan Gohman
76d402beb9 Make AssociativeOpt static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 01:14:05 +00:00
Devang Patel
52abbf5d8a Do not erase induction variable increment if it is used outside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 22:23:55 +00:00
Dan Gohman
45b4e48b18 Add a ComputeNumSignBits function for use by instcombine, based on the
code in SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 22:14:15 +00:00
Dale Johannesen
c215b3ef5d Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 21:38:18 +00:00
Chris Lattner
7be1c454c9 switch to Type::getFPMantissaWidth instead of reinventing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 21:17:23 +00:00
Chris Lattner
0a2d74bd53 minor cleanups, teach instcombine that sitofp/uitofp cannot
produce a negative zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51272 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:27:56 +00:00
Chris Lattner
0c7a9a04e7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51271 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:25:04 +00:00
Chris Lattner
a540623ab1 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 :).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:18:56 +00:00
Chris Lattner
9d60ba9d28 remove debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:03:53 +00:00
Chris Lattner
5e0d71877c 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:01:56 +00:00
Duncan Sands
ec00fcb33d Fix PR2341 - when the length is 4 use an i32 not
an i16!  Cleaned up trailing whitespace while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51240 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 09:27:24 +00:00
Gordon Henriksen
e46924bdf7 Reverting accidental commit of generated files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 05:57:12 +00:00
Gordon Henriksen
83eaae19ad Remove a duplicative binding. Patch by Mahadevan R.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 05:47:10 +00:00
Nate Begeman
1d6e4091f6 Teach GVN to not assert on vector comparisons
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-18 19:49:05 +00:00