1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

6599 Commits

Author SHA1 Message Date
Bill Wendling
3bf060ee33 Also revert r63206
llvm-svn: 63041
2009-01-26 21:30:17 +00:00
Bill Wendling
3cf6d13f21 Temporarily revert r63025 until the testsuite failures can be fixed.
llvm-svn: 63040
2009-01-26 21:27:03 +00:00
Anton Korobeynikov
39dee7256d During bittest switch lowering emit shift in the test block, which should (theoretically)
allow us to generate more efficient code. We don't do this now though :)

llvm-svn: 63027
2009-01-26 19:26:01 +00:00
Owen Anderson
9bcbf6b882 Get rid of a bunch of dead code now that interval reconstruction is enabled.
llvm-svn: 63026
2009-01-26 19:18:06 +00:00
Owen Anderson
834f011a63 Fix an issue where LiveIntervals was trying to be smart about removing kill
markers, and ended up foiling the interval reconstruction.

This allows us to turn on reconstruction in the pre alloc splitter, which
fixes a number of miscompilations.

llvm-svn: 63025
2009-01-26 19:12:06 +00:00
Evan Cheng
cdf60c96c8 Silence a bogus compiler warning.
llvm-svn: 63021
2009-01-26 18:33:51 +00:00
Evan Cheng
300df6af4f Actually source file has already been uniquified into an id during isel. Eliminate the StringMap.
llvm-svn: 63009
2009-01-26 07:53:42 +00:00
Evan Cheng
9fda834684 Add data structure to define and track debug location during codegen.
llvm-svn: 63008
2009-01-26 07:41:49 +00:00
Dan Gohman
4abaebae0c Take the next steps in making SDUse more consistent with LLVM Use, and
tidy up SDUse and related code.
 - Replace the operator= member functions with a set method, like
   LLVM Use has, and variants setInitial and setNode, which take
   care up updating use lists, like LLVM Use's does. This simplifies
   code that calls these functions.
 - getSDValue() is renamed to get(), as in LLVM Use, though most
   places can either use the implicit conversion to SDValue or the
   convenience functions instead.
 - Fix some more node vs. value terminology issues.

Also, eliminate the one remaining use of SDOperandPtr, and
SDOperandPtr itself.

llvm-svn: 62995
2009-01-26 04:35:06 +00:00
Dan Gohman
15770b411b Eliminate the loop that searches through each of the operands
of each use in the SelectionDAG ReplaceAllUses* functions. Thanks
to Chris for spotting this opportunity.

Also, factor out code from all 5 of the ReplaceAllUses* functions
into AddNonLeafNodeToCSEMaps, which is now renamed
AddModifiedNodeToCSEMaps to more accurately reflect its purpose.

llvm-svn: 62964
2009-01-25 16:29:12 +00:00
Dan Gohman
1302160ad4 Whitespace tidiments.
llvm-svn: 62963
2009-01-25 16:21:38 +00:00
Dan Gohman
1de7d569cf Move the N->use_empty() assert from DeleteNode to
DeleteNodeNotInCSEMaps, since DeleteNode just calls
DeleteNodeNotInCSEMaps.

llvm-svn: 62962
2009-01-25 16:20:37 +00:00
Evan Cheng
4ebe9b79fa Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue.
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1028                                                                                                                                            
%reg1030<def> = ADD8rr %reg1028<kill>, %reg1029<kill>, %EFLAGS<imp-def,dead>                                                                                                         

In this case, it might not be possible to coalesce the second MOV8rr                                                                                                                 
instruction if the first one is coalesced. So it would be profitable to                                                                                                              
commute it:                                                                                                                                                                          
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1029                                                                                                                                            
%reg1030<def> = ADD8rr %reg1029<kill>, %reg1028<kill>, %EFLAGS<imp-def,dead>

llvm-svn: 62954
2009-01-25 03:53:59 +00:00
Nate Begeman
48f3fe9199 Fix an indent and a typo.
llvm-svn: 62940
2009-01-24 22:12:48 +00:00
Owen Anderson
78b6a961bb Some cleanups. No functional changes.
llvm-svn: 62917
2009-01-24 10:07:43 +00:00
Evan Cheng
93b798e690 Refactor code. No functionality change.
llvm-svn: 62893
2009-01-23 23:27:33 +00:00
Devang Patel
d980abaae2 Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.
DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way.

DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by  a project, irrespective of whether the project used makefile, Xcode or something else.

llvm-gcc patch is next.

llvm-svn: 62888
2009-01-23 22:33:47 +00:00
Devang Patel
37b2017172 Empty DIType represents void. In this case no need to construct any type DIE.
llvm-svn: 62861
2009-01-23 19:13:31 +00:00
Dan Gohman
c971f3cf5b Fold x-0 to x in unsafe-fp-math mode. This comes up in the
testcase from PR3376, and in fact is sufficient to completely
avoid the problem in that testcase.

There's an underlying problem though; TLI.isOperationLegal
considers Custom to be Legal, which might be ok in some
cases, but that's what DAGCombiner is using in many places
to test if something is legal when LegalOperations is true.
When DAGCombiner is running after legalize, this isn't
sufficient. I'll address this in a separate commit.

llvm-svn: 62860
2009-01-23 19:10:37 +00:00
Evan Cheng
8ef6b2d75e Only check if coalescing is worthwhile when the result is targeting a more restrictive register class.
llvm-svn: 62837
2009-01-23 05:48:59 +00:00
Owen Anderson
8c41157459 Stage two of fixing pre-alloc-splitting's code size issues: filter out restores that are just
going to be re-spilled again.

This also helps performance.  Pre-alloc-splitting now seems to be an overall win on SPEC.

llvm-svn: 62834
2009-01-23 03:28:53 +00:00
Evan Cheng
7cdc6e4f8c Cross register class coalescing. Not yet enabled.
llvm-svn: 62832
2009-01-23 02:15:19 +00:00
Devang Patel
86e54f5636 Code did not follow associated comment. not a good idea.
llvm-svn: 62828
2009-01-23 01:25:58 +00:00
Devang Patel
b638679d9d Set appropriate tag for the composite type.
llvm-svn: 62827
2009-01-23 01:19:09 +00:00
Owen Anderson
b9426381f3 Add an initial pass at dead spill/restore removal for pre alloc splitting.
llvm-svn: 62821
2009-01-23 00:23:32 +00:00
Chris Lattner
c843f0f484 do not sign extend characters input to isprint. This improves
compatibility with VC++.  Patch by Max Burke!

llvm-svn: 62813
2009-01-22 23:38:45 +00:00
Bob Wilson
d79e684d1e Fix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1"
to "C ^ 1" is only valid when C is known to be either 0 or 1.  Most of the
similar foldings in this function only handle "i1" types, but this one appears
intentionally written to handle larger integer types.  If C has an integer
type larger than "i1", this needs to check if the high bits of a boolean
are known to be zero.  I also changed the comment to describe this folding as
"C ^ 1" instead of "~C", since that is what the code does and since the latter
would only be valid for "i1" types.  The good news is that most LLVM targets
use TargetLowering::ZeroOrOneBooleanContent so this change will not disable
the optimization; the bad news is that I've been unable to come up with a
testcase to demonstrate the problem.

I have also removed a "FIXME" comment for folding "select C, X, 0" to "C & X",
since the code looks correct to me.  It could be made more aggressive by not
limiting the type to "i1", but that would then require checking for
TargetLowering::ZeroOrNegativeOneBooleanContent.  Similar changes could be
done for the other SELECT foldings, but it was decided to be not worth the
trouble and complexity (see e.g., r44663).

llvm-svn: 62790
2009-01-22 22:05:48 +00:00
Dan Gohman
a6e5948fce Don't create ISD::FNEG nodes after legalize if they aren't legal.
Simplify x+0 to x in unsafe-fp-math mode. This avoids a bunch of
redundant work in many cases, because in unsafe-fp-math mode,
ISD::FADD with a constant is considered free to negate, so the
DAGCombiner often negates x+0 to -0-x thinking it's free, when
in reality the end result is -x, which is more expensive than x.

Also, combine x*0 to 0.

This fixes PR3374.

llvm-svn: 62789
2009-01-22 21:58:43 +00:00
Bob Wilson
186046e657 Add SelectionDAG::getNOT method to construct bitwise NOT operations,
corresponding to the "not" and "vnot" PatFrags.  Use the new method
in some places where it seems appropriate.

llvm-svn: 62768
2009-01-22 17:39:32 +00:00
Sanjiv Gupta
7173c05b38 Few targets like the tiny little PIC16 have only 16-bit pointers.
llvm-svn: 62763
2009-01-22 10:14:21 +00:00
Evan Cheng
c971801ae1 Eliminate a couple of fields from TargetRegisterClass: SubRegClasses and SuperRegClasses. These are not necessary. Also eliminate getSubRegisterRegClass and getSuperRegisterRegClass. These are slow and their results can change if register file names change. Just use TargetLowering::getRegClassFor() to get the right TargetRegisterClass instead.
llvm-svn: 62762
2009-01-22 09:10:11 +00:00
Chris Lattner
92f592ad8b fix a typo
llvm-svn: 62761
2009-01-22 07:21:55 +00:00
Dan Gohman
d021a20409 Simplify ReduceLoadWidth's logic: it doesn't need several different
special cases after producing the new reduced-width load, because the
new load already has the needed adjustments built into it. This fixes
several bugs due to the special cases, including PR3317.

llvm-svn: 62692
2009-01-21 15:17:51 +00:00
Duncan Sands
392dc77fc6 Cleanup whitespace and comments, and tweak some
prototypes, in operand type legalization.  No
functionality change.

llvm-svn: 62680
2009-01-21 09:00:29 +00:00
Owen Anderson
d1a2413f88 I accidentally removed this check in an earlier commit, which cause breakage in the pre alloc splitter.
llvm-svn: 62678
2009-01-21 08:18:03 +00:00
Scott Michel
c80e71ac35 CellSPU:
- Ensure that (operation) legalization emits proper FDIV libcall when needed.
- Fix various bugs encountered during llvm-spu-gcc build, along with various
  cleanups.
- Start supporting double precision comparisons for remaining libgcc2 build.
  Discovered interesting DAGCombiner feature, which is currently solved via
  custom lowering (64-bit constants are not legal on CellSPU, but DAGCombiner
  insists on inserting one anyway.)
- Update README.

llvm-svn: 62664
2009-01-21 04:58:48 +00:00
Sanjiv Gupta
074553c4fb Allow targets to legalize operations (with illegal operands) that produces multiple values. For example, a load with an illegal operand (a load produces two values, a value and chain).
llvm-svn: 62663
2009-01-21 04:48:39 +00:00
Owen Anderson
10ad717dc8 Be more aggressive about renumbering vregs after splitting them.
llvm-svn: 62639
2009-01-21 00:13:28 +00:00
Devang Patel
c129e798c7 Encode member accessibility.
llvm-svn: 62638
2009-01-21 00:08:04 +00:00
Devang Patel
bb4362571a Appropriately mark fowrad decls.
llvm-svn: 62625
2009-01-20 22:27:02 +00:00
Evan Cheng
5bea79c062 Fix PR3243: a LiveVariables bug. When HandlePhysRegKill is checking whether the last reference is also the last def (i.e. dead def), it should also check if last reference is the current machine instruction being processed. This can happen when it is processing a physical register use and setting the current machine instruction as sub-register's last ref.
llvm-svn: 62617
2009-01-20 21:25:12 +00:00
Bill Wendling
cf901346da Use "SINT_TO_FP" instead of "UINT_TO_FP" when getting the exponent. This was
causing the limited precision stuff to produce the wrong result for values in
the range [0, 1).

llvm-svn: 62615
2009-01-20 21:17:57 +00:00
Devang Patel
4c79c8be26 Fix struct member's debug info.
llvm-svn: 62610
2009-01-20 21:02:02 +00:00
Devang Patel
ccc3162f69 Need only one set of debug info versions enum.
llvm-svn: 62602
2009-01-20 19:22:03 +00:00
Evan Cheng
b3c82db63d Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.
llvm-svn: 62600
2009-01-20 19:12:24 +00:00
Devang Patel
10f2f03c68 Fix global variable's address in a DIE.
llvm-svn: 62596
2009-01-20 18:55:39 +00:00
Devang Patel
7f6ef3bdd6 Enable debug info for enums.
llvm-svn: 62594
2009-01-20 18:35:14 +00:00
Devang Patel
6bd9ebdef8 Enable debug info for composite types.
llvm-svn: 62589
2009-01-20 18:13:03 +00:00
Evan Cheng
58488a481f Refactor code. No functionality change.
llvm-svn: 62573
2009-01-20 06:44:16 +00:00
Bill Wendling
5685c90e04 Shift types need to match.
llvm-svn: 62571
2009-01-20 06:10:42 +00:00
Dan Gohman
ff4c4ab39f Fix a dagcombine to not generate loads of non-round integer types,
as its comment says, even in the case where it will be generating
extending loads. This fixes PR3216.

llvm-svn: 62557
2009-01-20 01:06:45 +00:00
Devang Patel
6a88f8849b Do not use DenseMap because the iterator is invalidated while constructing types. After all there was a reason why std::map was used initially!
llvm-svn: 62555
2009-01-20 00:58:55 +00:00
Evan Cheng
5ee5ba12be Make linear scan's trivial coalescer slightly more aggressive.
llvm-svn: 62547
2009-01-20 00:16:18 +00:00
Devang Patel
7c2157602d Verify debug info.
llvm-svn: 62545
2009-01-19 23:21:49 +00:00
Dan Gohman
02b5657666 Remove SDNode's virtual destructor. This makes it impossible for
SDNode subclasses to keep state that requires non-trivial
destructors, however it was already effectively impossible,
since the destructor isn't actually ever called. There currently
aren't any SDNode subclasses affected by this, and in general
it's desireable to keep SDNode objects light-weight.

This eliminates the last virtual member function in the SDNode
class, so it eliminates the need for a vtable pointer, making
SDNode smaller.

llvm-svn: 62539
2009-01-19 22:39:36 +00:00
Dan Gohman
af4e583c93 Fix SelectionDAG::ReplaceAllUsesWith to behave correctly when
uses are added to the From node while it is processing From's
use list, because of automatic local CSE. The fix is to avoid
visiting any new uses.

Fix a few places in the DAGCombiner that assumed that after
a RAUW call, the From node has no users and may be deleted.

This fixes PR3018.

llvm-svn: 62533
2009-01-19 21:44:21 +00:00
Sanjiv Gupta
5a5af71ca2 Few targets like PIC16 wants libcall generation for illegal type i16.
llvm-svn: 62467
2009-01-18 18:25:27 +00:00
Mon P Wang
27ea1af89f Simplify extract element based on comments from Duncan Sands.
llvm-svn: 62459
2009-01-18 06:43:40 +00:00
Devang Patel
4a7a53217b Remove tabs.
llvm-svn: 62423
2009-01-17 08:05:14 +00:00
Devang Patel
97cd6a4a7c Refactor code
llvm-svn: 62421
2009-01-17 08:01:33 +00:00
Devang Patel
2fc394ddfd Assign argument type to appropriate DIE.
llvm-svn: 62412
2009-01-17 06:57:25 +00:00
Devang Patel
24e250ee74 Remove dead code.
llvm-svn: 62410
2009-01-17 06:51:37 +00:00
Devang Patel
732220a09f Disable composite type debug info for now.
llvm-svn: 62406
2009-01-17 05:05:12 +00:00
Mon P Wang
563134282c Simplify extract element of a scalar to vector.
llvm-svn: 62383
2009-01-17 00:07:25 +00:00
Dan Gohman
3d0633627d Instead of adding dependence edges between terminator instructions
and every other instruction in their blocks to keep the terminator
instructions at the end, teach the post-RA scheduler how to operate
on ranges of instructions, and exclude terminators from the range
of instructions that get scheduled.

Also, exclude mid-block labels, such as EH_LABEL instructions, and
schedule code before them separately from code after them. This
fixes problems with the post-RA scheduler moving code past
EH_LABELs.

llvm-svn: 62366
2009-01-16 22:10:20 +00:00
Dan Gohman
9636e74701 If an anti-dependence uses a non-allocatable register, set AntiDepReg
to 0, to ensure that the subsequent code doesn't try to break the
dependence.

llvm-svn: 62365
2009-01-16 21:57:43 +00:00
Dan Gohman
4dc9f47c97 Use the getNode() accessor instead of accessing the Node
member directly, which is private as of r55504.

llvm-svn: 62364
2009-01-16 21:47:21 +00:00
Dan Gohman
733d817b4d Fix the check for an empty basic block to check for an empty SUnits
array instead, since this is what the scheduler actually cares about.
And remove a check that is unnecessary, since it can assume that
SUnits isn't empty.

llvm-svn: 62362
2009-01-16 21:37:14 +00:00
Chris Lattner
cfaf556999 new nodes should be added to the worklist, not old nodes.
llvm-svn: 62359
2009-01-16 21:15:56 +00:00
Devang Patel
9ecd23c14d Fix comments.
llvm-svn: 62358
2009-01-16 21:07:53 +00:00
Evan Cheng
c4d19d6e8c CreateVirtualRegisters does trivial copy coalescing. If a node def is used by a single CopyToReg, it reuses the virtual register assigned to the CopyToReg. This won't work for SDNode that is a clone or is itself cloned. Disable this optimization for those nodes or it can end up with non-SSA machine instructions.
llvm-svn: 62356
2009-01-16 20:57:18 +00:00
Devang Patel
6f83d4b68f Use lightweight DebugInfo objects directly.
llvm-svn: 62341
2009-01-16 19:28:14 +00:00
Devang Patel
627bb2afb9 Align source code.
llvm-svn: 62328
2009-01-16 18:01:58 +00:00
Dan Gohman
e4265cdbb9 Fix a "comparison between signed and unsigned integer expressions"
warning.

llvm-svn: 62327
2009-01-16 17:55:08 +00:00
Mikhail Glushenkov
49be18cfc6 Registry.h should not depend on CommandLine.h.
Split Support/Registry.h into two files so that we have less to
recompile every time CommandLine.h is changed.

llvm-svn: 62312
2009-01-16 07:02:28 +00:00
Mikhail Glushenkov
5000223556 Delete trailing whitespace.
llvm-svn: 62307
2009-01-16 06:53:46 +00:00
Devang Patel
434239cc4f Validate debug info values only if DwarfDebug is initialized.
llvm-svn: 62298
2009-01-16 02:15:14 +00:00
Devang Patel
befef54e67 Any debug info symbol is only valid if atleast one compile unit is seen.
llvm-svn: 62294
2009-01-16 01:49:46 +00:00
Dan Gohman
c5b1dbdb4e Initial hazard recognizer support in post-pass scheduling. This includes
a new toy hazard recognizier heuristic which attempts to direct the
scheduler to avoid clumping large groups of loads or stores too densely.

llvm-svn: 62291
2009-01-16 01:33:36 +00:00
Devang Patel
f0e1e4cc51 Do not stumble over forward declared struct member.
llvm-svn: 62288
2009-01-16 00:50:53 +00:00
Devang Patel
1ee58c7d8c Validate dbg_* intrinsics before lowering them.
llvm-svn: 62286
2009-01-15 23:41:32 +00:00
Mon P Wang
e235ba591f Added missing support to widen an operand from a bit convert.
llvm-svn: 62285
2009-01-15 22:43:38 +00:00
Dan Gohman
3e0dcbbd15 Generalize the HazardRecognizer interface so that it can be used
to support MachineInstr-based scheduling in addition to
SDNode-based scheduling.

llvm-svn: 62284
2009-01-15 22:18:12 +00:00
Dan Gohman
23a5f63b21 Simplify the MachineLICM pass by having it only traverse outer
loops, hoisting instructions all the way out in one step rather
than hoisting them one nest level at a time. Also, make a few
other code simplifications. This speeds up MachineLICM
by several fold.

llvm-svn: 62283
2009-01-15 22:01:38 +00:00
Rafael Espindola
0aba6c9435 Add the private linkage.
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Devang Patel
97d45c48c5 Use lightweight DebugInfo objects directly.
llvm-svn: 62276
2009-01-15 19:26:23 +00:00
Dan Gohman
6fcee67989 Move a few containers out of ScheduleDAGInstrs::BuildSchedGraph
and into the ScheduleDAGInstrs class, so that they don't get
destructed and re-constructed for each block. This fixes a
compile-time hot spot in the post-pass scheduler.

To help facilitate this, tidy and do some minor reorganization
in the scheduler constructor functions.

llvm-svn: 62275
2009-01-15 19:20:50 +00:00
Devang Patel
307fac7f3a Use variable's context to identify respective DbgScope.
Use light weight DebugInfo object directly.

llvm-svn: 62269
2009-01-15 18:25:17 +00:00
Dan Gohman
273ef2ab9f Make getWidenVectorType const; this file was missed in the
previous commit.

llvm-svn: 62266
2009-01-15 17:39:39 +00:00
Dan Gohman
791e6c24db More consts on TargetLowering references.
llvm-svn: 62262
2009-01-15 16:58:17 +00:00
Dan Gohman
9dd6a69768 Use const with TargetLowering references in a few more places.
llvm-svn: 62260
2009-01-15 16:43:02 +00:00
Gabor Greif
feac7ccdbd minor refactoring: use a more specific API
llvm-svn: 62256
2009-01-15 11:10:44 +00:00
Devang Patel
cf0db71b85 Do not construct debug scope if RootScope *is* null.
llvm-svn: 62209
2009-01-14 01:34:32 +00:00
Devang Patel
1da8253b35 Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info.
llvm-svn: 62199
2009-01-13 23:54:55 +00:00
Devang Patel
ba388f3905 Keep "has debug info" big in MachineModuleInfo to avoid circular dependency between AsmPrinter and CodeGen.
llvm-svn: 62191
2009-01-13 23:02:17 +00:00
Devang Patel
7a618394f6 Undo previous checkin.
llvm-svn: 62190
2009-01-13 22:54:57 +00:00
Devang Patel
e0f23e966d Use DwarfWriter to record dbg variables.
llvm-svn: 62185
2009-01-13 21:44:10 +00:00
Devang Patel
ab5ef6abf1 Use dwarf writer to decide whether the module has debug info or not.
llvm-svn: 62184
2009-01-13 21:25:00 +00:00
Dan Gohman
f94a4aba16 Use assertions to check for conditions that should never happen.
llvm-svn: 62178
2009-01-13 20:25:24 +00:00
Dan Gohman
9e9858781c The list-td and list-tdrr schedulers don't yet support physreg
scheduling dependencies. Add assertion checks to help catch
this.

It appears the Mips target defaults to list-td, and it has a
regression test that uses a physreg dependence. Such code was
liable to be miscompiled, and now evokes an assertion failure.

llvm-svn: 62177
2009-01-13 20:24:13 +00:00
Dan Gohman
c7fe713e72 Avoid referring to edge D after the Succs or Preds arrays have
been modified, to avoid trouble in the (unlikely) scenario that
D is a reference to an element in one of those arrays.

llvm-svn: 62173
2009-01-13 19:08:45 +00:00
Duncan Sands
975f2428ba When replacing uses and the same node is reached
via two paths, process it once not twice, d'oh!
Analysis, testcase and original patch thanks to
Mon Ping Wang.

llvm-svn: 62169
2009-01-13 15:17:14 +00:00
Duncan Sands
439d97a6cb Fix some typos. Also, the WidenedVectors map
was not being cleaned by ExpungeNode.

llvm-svn: 62167
2009-01-13 14:42:39 +00:00
Duncan Sands
8267463dec Correct a comment - this is not a sign extension.
llvm-svn: 62166
2009-01-13 14:04:14 +00:00
Evan Cheng
6fd76e738c Un-tabify.
llvm-svn: 62151
2009-01-13 06:08:37 +00:00
Evan Cheng
a706a020bc FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block.
llvm-svn: 62144
2009-01-13 03:57:45 +00:00
Devang Patel
eed0505ed8 Use DebugInfo interface to lower dbg_* intrinsics.
llvm-svn: 62127
2009-01-13 00:35:13 +00:00
Devang Patel
13a43a3789 Start using DebugInfo API to emit debug info.
llvm-svn: 62125
2009-01-13 00:20:51 +00:00
Devang Patel
68ef0f4ecb Emit debug info, only if at least one compile unit is seen.
llvm-svn: 62118
2009-01-12 23:09:42 +00:00
Devang Patel
4379343f92 If multiple compile units are seen then emit them independently. In other words, do not force all DIEs into first, whatever it is, compile unit.
Note, multiple compile unit support is not well tested (it did not work correctly until now anyway.)

llvm-svn: 62116
2009-01-12 23:05:55 +00:00
Devang Patel
283436f4b9 Avoid cast<>, use light weith wrapper directly.
llvm-svn: 62115
2009-01-12 22:58:14 +00:00
Devang Patel
261d3cb2af Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon.
llvm-svn: 62114
2009-01-12 22:54:42 +00:00
Duncan Sands
bcdbfb63dc Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Devang Patel
27f9c78c56 Add DwarfWriter interface to mainipulate source location info.
( May be this info should be directly handled by the dwarf writer ? )

llvm-svn: 62096
2009-01-12 19:17:34 +00:00
Devang Patel
149d412a0e Clear debug info at the end of function processing.
llvm-svn: 62092
2009-01-12 18:48:36 +00:00
Devang Patel
89a815941c There is no need to maintain separate labelid list in the dwarf writer. It is not a good idea.
llvm-svn: 62090
2009-01-12 18:41:00 +00:00
Evan Cheng
5e17ea36e1 Fix PR3241: Currently EmitCopyFromReg emits a copy from the physical register to a virtual register unless it requires an expensive cross class copy. That means we are only treating "expensive to copy" register dependency as physical register dependency.
Also future proof the scheduler to handle "normal" physical register dependencies. The code is not exercised yet.

llvm-svn: 62074
2009-01-12 03:19:55 +00:00
Owen Anderson
e6451daef4 More two-address fixes. This gets lua working with join-creation enabled.
llvm-svn: 62073
2009-01-12 03:10:40 +00:00
Evan Cheng
e280fcfbbc CheckForPhysRegDependency should not return copy cost. It's not used. No functionality change.
llvm-svn: 62036
2009-01-11 08:53:35 +00:00
Devang Patel
a350457725 Reduce initial small vector sizes.
llvm-svn: 62023
2009-01-10 02:42:49 +00:00
Devang Patel
77332761ef Fix thinko. Create parent scope if parent descriptor is *not* null.
llvm-svn: 62022
2009-01-10 02:34:18 +00:00
Evan Cheng
411c48b7d2 Duplicated node may produce a non-physical register def.
llvm-svn: 62015
2009-01-09 22:44:02 +00:00
Evan Cheng
7a918ea197 Minor debug output tweak.
llvm-svn: 62005
2009-01-09 20:42:34 +00:00
Devang Patel
7fd7643d23 Request DwarfWriter. This will be used to handle dbg_* intrinsics.
llvm-svn: 61999
2009-01-09 19:11:50 +00:00
Misha Brukman
71c7e40966 Removed trailing whitespace from Makefiles.
llvm-svn: 61991
2009-01-09 16:44:42 +00:00
Devang Patel
747d4b38ad Convert DwarfWriter into a pass.
Now Users request DwarfWriter through getAnalysisUsage() instead of creating an instance of DwarfWriter object directly.

llvm-svn: 61955
2009-01-08 23:40:34 +00:00
Dan Gohman
321b716d84 Delete unnecessary parens around return values.
llvm-svn: 61950
2009-01-08 22:19:34 +00:00
Devang Patel
97863f513c Add DebugInfo based APIs to record source line info.
llvm-svn: 61928
2009-01-08 17:19:22 +00:00
Misha Brukman
ae1566f744 * Moved author attribution to CREDITS.TXT
* Removed trailing whitespace

llvm-svn: 61927
2009-01-08 16:40:25 +00:00
Misha Brukman
cada42bb4e * Alphabetized #includes
* Removed trailing whitespace

llvm-svn: 61926
2009-01-08 15:50:22 +00:00
Devang Patel
3125e21ae4 Add APIs to record regions and variables.
Again, shamelessly copied from MMI.

llvm-svn: 61912
2009-01-08 02:49:34 +00:00
Devang Patel
0db006ea38 Add APIs to manage scope using DebugInfo interface.
This is a shameless copy of similar APIs from MachineModuleInfo. The copy from MMI will be deleted in near future.

llvm-svn: 61908
2009-01-08 02:33:41 +00:00
Dan Gohman
3579548f68 Remove redundant 'else's. No functionality change.
llvm-svn: 61891
2009-01-07 22:30:55 +00:00
Evan Cheng
a70ecc2f51 The coalescer does not coalesce a virtual register to a physical register if any of the physical register's sub-register live intervals overlaps with the virtual register. This is overly conservative. It prevents a extract_subreg from being coalesced away:
v1024 = EDI  // not killed
      =
      = EDI

One possible solution is for the coalescer to examine the sub-register live intervals in the same manner as the physical register. Another possibility is to examine defs and uses (when needed) of sub-registers. Both solutions are too expensive. For now, look for "short virtual intervals" and scan instructions to look for conflict instead.

This is a small win on x86-64. e.g. It shaves 403.gcc by ~80 instructions.

llvm-svn: 61847
2009-01-07 02:08:57 +00:00
Dan Gohman
b19f5073f9 Fix a bug in ComputeLinearIndex computation handling multi-level
aggregate types. Don't increment the current index after reaching
the end of a struct, as it will already be pointing at
one-past-the end. This fixes PR3288.

llvm-svn: 61828
2009-01-06 22:53:52 +00:00
Devang Patel
6c23870973 Set up DwarfDebug using DebugInfo API.
llvm-svn: 61822
2009-01-06 21:07:30 +00:00
Bill Wendling
0a611529e5 Forgot that this was needed for Linux. This should fix the builds.
llvm-svn: 61819
2009-01-06 19:13:55 +00:00
Owen Anderson
1f1e4ab65a The phi construction algorithm used for interval reconstruction is complicated by
two address instructions.  We need to keep track of things we've processed AS USES
independetly of whether we've processed them as defs.

This fixes all known miscompilations when reconstruction is turned on.

llvm-svn: 61802
2009-01-06 07:53:32 +00:00
Dan Gohman
595c38acb0 Update these argument lists for the isNormalMemory
argument. This doesn't affect current functionality.

llvm-svn: 61779
2009-01-06 01:28:56 +00:00
Dan Gohman
1cdb677fc8 Use a latency value of 0 for the artificial edges inserted by
AddPseudoTwoAddrDeps. This lets the scheduling infrastructure
avoid recalculating node heights. In very large testcases this
was a major bottleneck. Thanks to Roman Levenstein for finding
this!

As a side effect, fold-pcmpeqd-0.ll is now scheduled better
and it no longer requires spilling on x86-32.

llvm-svn: 61778
2009-01-06 01:19:04 +00:00
Devang Patel
b06184d4a2 Construct subprogram DIEs using DebugInfo.
llvm-svn: 61772
2009-01-05 23:21:35 +00:00
Devang Patel
9f27e8354b Construct global variable DIEs using DebugInfo.
llvm-svn: 61771
2009-01-05 23:11:11 +00:00
Devang Patel
7d98385702 Construct compile unit dies using DebugInfo.
llvm-svn: 61768
2009-01-05 23:03:32 +00:00
Bill Wendling
891f9abdbb Revert r61415 and r61484. Duncan was correct that these weren't needed.
llvm-svn: 61765
2009-01-05 22:53:45 +00:00
Dan Gohman
f6ab374c28 Don't call setDepthDirty/setHeightDirty when adding an edge
with latency 0, since it doesn't affect the depth or height.

llvm-svn: 61762
2009-01-05 22:40:26 +00:00
Devang Patel
dc395b96fb Extract source location info from DebugInfo.
Add methods to add source location info in a DIE.

llvm-svn: 61761
2009-01-05 22:35:52 +00:00
Devang Patel
b54d136d11 Add type DIEs using DebugInfo.
llvm-svn: 61757
2009-01-05 21:47:57 +00:00
Devang Patel
94ba049403 Construct composite type DIE using DebugInfo.
llvm-svn: 61741
2009-01-05 19:55:51 +00:00
Dan Gohman
9938898e44 TargetLowering.h #includes SelectionDAGNodes.h, so it doesn't need its
own OpActionsCapacity magic number; it can just use ISD::BUILTIN_OP_END,
as long as it takes care to round up when needed.

llvm-svn: 61733
2009-01-05 19:40:39 +00:00
Devang Patel
beb5774035 s/ConstructType/ConstructTypeDIE/g
llvm-svn: 61731
2009-01-05 19:07:53 +00:00
Devang Patel
c1998b026f Construct stuct field DIEs.
llvm-svn: 61729
2009-01-05 18:59:44 +00:00
Devang Patel
de65ed6370 Construct enumerator DIE using DebugInfo.
llvm-svn: 61726
2009-01-05 18:38:38 +00:00
Devang Patel
c4c51439bf Construct array/vector type DIEs using DebugInfo.
llvm-svn: 61724
2009-01-05 18:33:01 +00:00
Owen Anderson
28649f1598 Get rid of sentinel insertion in interval reconstruction. It just masked the
problem, rather than fixing it.  The problem has now been fixed the right way.

llvm-svn: 61723
2009-01-05 18:32:26 +00:00
Dan Gohman
8271066844 Tidy up #includes, deleting a bunch of unnecessary #includes.
llvm-svn: 61715
2009-01-05 17:59:02 +00:00
Devang Patel
38d7f4dc2c Construct basic and derived type DIEs using DebugInfo.
llvm-svn: 61714
2009-01-05 17:57:47 +00:00
Devang Patel
bf19721647 subsume ConstructPointerType()
llvm-svn: 61711
2009-01-05 17:45:59 +00:00
Devang Patel
24288bc651 subsume ConstructBasicType().
llvm-svn: 61709
2009-01-05 17:44:11 +00:00
Devang Patel
689e130117 squash warnings.
llvm-svn: 61707
2009-01-05 17:31:22 +00:00
Chris Lattner
30de396459 elf writer really wants the size of the global, not the size
of the pointer to the global.

llvm-svn: 61630
2009-01-04 20:19:20 +00:00
Bill Wendling
61bdc3d99e The llvm::ELFWriter::EmitGlobal() method is calling the
llvm::PATypeHolder::get() method when LLVM is self-hosted in Release
mode. Before the parser changed, there was a definition of llvm::PAHolder::get()
in llvmAsmParser.y. This was probably a bug that no-one noticed.

Explicitly #include the Type.h file as a temporary fix for now.

llvm-svn: 61620
2009-01-04 01:47:14 +00:00
Dan Gohman
2a079de3f5 Fix a DAGCombiner abort on an invalid shift count constant. This fixes PR3250.
llvm-svn: 61613
2009-01-03 19:22:06 +00:00
Dan Gohman
8dc1513b6c CommuteNodesToReducePressure() is now removed.
llvm-svn: 61612
2009-01-03 19:19:30 +00:00
Dan Gohman
6a518de5f5 Remove the code from the scheduler that commuted two-address
instructions to avoid copies, because TwoAddressInstructionPass
also does this optimization.  The scheduler's version didn't
account for live-out values, which resulted in spurious commutes
and missed opportunities.

Now, TwoAddressInstructionPass handles all the opportunities,
instead of just those that the scheduler missed. The result is
usually the same, though there are occasional trivial differences
resulting from the avoidance of spurious commutes.

llvm-svn: 61611
2009-01-03 18:01:46 +00:00
Duncan Sands
0fca32114b Factorize (and generalize) the code promoting SELECT
and BRCOND conditions.  Reorder a few methods while
there.

llvm-svn: 61547
2009-01-01 20:36:20 +00:00
Duncan Sands
07002edaca Remove trailing spaces.
llvm-svn: 61545
2009-01-01 19:56:02 +00:00
Duncan Sands
190d6bc636 Fix PR3274: when promoting the condition of a BRCOND node,
promote from i1 all the way up to the canonical SetCC type.
In order to discover an appropriate type to use, pass
MVT::Other to getSetCCResultType.  In order to be able to
do this, change getSetCCResultType to take a type as an
argument, not a value (this is also more logical).

llvm-svn: 61542
2009-01-01 15:52:00 +00:00
Owen Anderson
ccde9db05a Get live interval reconstruction several steps closer to working.
llvm-svn: 61514
2008-12-31 02:00:25 +00:00
Bill Wendling
067c48f7a6 Linux wants the FDE initial location and address range to be forced to 32-bit.
Darwin doesn't. Make this optional for platforms.

llvm-svn: 61484
2008-12-29 22:12:11 +00:00
Bill Wendling
4749654506 The FDE initial location and address range data should be free to be 64-bit
(quad) on a 64-bit platform. This fixes a problem with EH frames on Darwin.

llvm-svn: 61483
2008-12-29 21:51:42 +00:00
Duncan Sands
ef77539014 Add braces, as suggested by a gcc warning.
llvm-svn: 61465
2008-12-29 08:05:02 +00:00
Scott Michel
5bb7db3872 Teach LeaglizeDAG that i64 mul can be a libcall.
llvm-svn: 61463
2008-12-29 03:21:37 +00:00
Owen Anderson
e5b1fb3c25 Fix up kill/dead marking in the new live interval reconstruction code.
llvm-svn: 61460
2008-12-28 23:35:13 +00:00
Owen Anderson
e21f8339f8 Add prototype code for recomputing a live interval's ranges and valnos through recursive phi construction.
llvm-svn: 61458
2008-12-28 21:48:48 +00:00
Bill Wendling
044248aad1 Darwin likes for the EH frame to be non-local.
llvm-svn: 61420
2008-12-24 08:05:17 +00:00
Bill Wendling
6add893a14 GCC doesn't emit DW_EH_PE_sdata4 for the FDE encoding on Darwin. I'm not sure
about other platforms.

llvm-svn: 61415
2008-12-24 05:25:49 +00:00
Dale Johannesen
88e47fa0e4 Change comments so everybody can understand them, hopefully.
llvm-svn: 61405
2008-12-23 23:47:22 +00:00
Dale Johannesen
e1a3d2da49 Add another permutation where we should get rid of a-a.
llvm-svn: 61401
2008-12-23 23:01:27 +00:00
Anton Korobeynikov
328347152a Restore debug printing
llvm-svn: 61398
2008-12-23 22:26:18 +00:00
Anton Korobeynikov
f4a9c57b23 Sometimes APInt syntax is really ugly... :(
llvm-svn: 61397
2008-12-23 22:26:01 +00:00
Anton Korobeynikov
a2055f8f17 Indent stuff properly
llvm-svn: 61396
2008-12-23 22:25:45 +00:00
Anton Korobeynikov
9559c8c377 Initial checkin of APInt'ififcation of switch lowering
llvm-svn: 61395
2008-12-23 22:25:27 +00:00
Devang Patel
1a9c404ed2 Fix typo.
Silence unused variable warning.

llvm-svn: 61391
2008-12-23 21:55:38 +00:00
Devang Patel
28420198a6 Silience unused warnings.
llvm-svn: 61390
2008-12-23 21:55:04 +00:00
Dan Gohman
a0f1fc06c4 Clean up the atomic opcodes in SelectionDAG.
This removes all the _8, _16, _32, and _64 opcodes and replaces each
group with an unsuffixed opcode. The MemoryVT field of the AtomicSDNode
is now used to carry the size information. In tablegen, the size-specific
opcodes are replaced by size-independent opcodes that utilize the
ability to compose them with predicates.

This shrinks the per-opcode tables and makes the code that handles
atomics much more concise.

llvm-svn: 61389
2008-12-23 21:37:04 +00:00
Dan Gohman
6bee7ef264 Rename BuildSchedUnits to BuildSchedGraph, and refactor the
code in ScheduleDAGSDNodes' BuildSchedGraph into separate functions.

llvm-svn: 61376
2008-12-23 18:36:58 +00:00
Dan Gohman
1c1b281cd5 Use isTerminator() instead of isBranch()||isReturn() in
several places. isTerminator() returns true for a superset
of cases, and includes things like FP_REG_KILL, which are
nither return or branch but aren't safe to move/remat/etc.

llvm-svn: 61373
2008-12-23 17:28:50 +00:00
Dan Gohman
b4060b4995 Avoid an unnecessary call to allnodes_size(), which is linear.
llvm-svn: 61372
2008-12-23 17:24:50 +00:00
Dan Gohman
c742da2e94 Minor code simplifications.
llvm-svn: 61371
2008-12-23 17:22:32 +00:00
Dale Johannesen
425b44516f One more permutation of subtracting off a base value.
llvm-svn: 61361
2008-12-23 01:59:54 +00:00
Dan Gohman
fd906f6a07 Refactor a bunch of code out of AsmPrinter::EmitGlobalConstant into separate
functions.

llvm-svn: 61345
2008-12-22 21:14:27 +00:00
Dan Gohman
112572e95e Optimize setDepthDirty and setHeightDirty a little, as they showed
up on a profile.

llvm-svn: 61344
2008-12-22 21:11:33 +00:00
Dan Gohman
ab5072f624 Use SmallVector's pop_back_val.
llvm-svn: 61277
2008-12-20 16:42:33 +00:00
Dan Gohman
8c5bea15ca Use the correct Preds and Succs lists in setHeightDirty()
and setDepthDirty(), respectively. This fixes PR3241.

llvm-svn: 61276
2008-12-20 16:34:57 +00:00
Dan Gohman
e75b2ce6e2 Use ~0u instead of -1u as the special value, to hopefully avoid
warnings on compilers that warn about such things.

llvm-svn: 61263
2008-12-19 22:23:43 +00:00
Evan Cheng
da55c4ffb7 Fix PR3149. If an early clobber def is a physical register and it is tied to an input operand, it effectively extends the live range of the physical register. Currently we do not have a good way to represent this.
172     %ECX<def> = MOV32rr %reg1039<kill>
180     INLINEASM <es:subl $5,$1
        sbbl $3,$0>, 10, %EAX<def>, 14, %ECX<earlyclobber,def>, 9, %EAX<kill>,
36, <fi#0>, 1, %reg0, 0, 9, %ECX<kill>, 36, <fi#1>, 1, %reg0, 0
188     %EAX<def> = MOV32rr %EAX<kill>
196     %ECX<def> = MOV32rr %ECX<kill>
204     %ECX<def> = MOV32rr %ECX<kill>
212     %EAX<def> = MOV32rr %EAX<kill>
220     %EAX<def> = MOV32rr %EAX
228     %reg1039<def> = MOV32rr %ECX<kill>

The early clobber operand ties ECX input to the ECX def.

The live interval of ECX is represented as this:
%reg20,inf = [46,47:1)[174,230:0)  0@174-(230) 1@46-(47)

The right way to represent this is something like
%reg20,inf = [46,47:2)[174,182:1)[181:230:0)  0@174-(182) 1@181-230 @2@46-(47)

Of course that won't work since that means overlapping live ranges defined by two val#.

The workaround for now is to add a bit to val# which says the val# is redefined by a early clobber def somewhere. This prevents the move at 228 from being optimized away by SimpleRegisterCoalescing::AdjustCopiesBackFrom.

llvm-svn: 61259
2008-12-19 20:58:01 +00:00
Chris Lattner
27c3b1df00 Fix some release-assert warnings
llvm-svn: 61244
2008-12-19 17:03:38 +00:00
Rafael Espindola
7593f0004f Fix bug 3202.
The EH_frame and .eh symbols are now private, except for darwin9 and earlier.
The patch also fixes the definition of PrivateGlobalPrefix on pcc linux.

llvm-svn: 61242
2008-12-19 10:55:56 +00:00
Bill Wendling
d4a3c71eb1 Perform this loop only when the -debug flag is specified.
llvm-svn: 61238
2008-12-19 02:09:57 +00:00
Dan Gohman
3991753a76 Initialize the ImplicitDefed member, to avoid getting stale
data from a previous block.

llvm-svn: 61237
2008-12-19 00:46:20 +00:00
Dan Gohman
42b2f38113 Teach LowerSubregs to preserve kill/dead information when lowering
subreg instructions.

llvm-svn: 61220
2008-12-18 22:14:08 +00:00
Dan Gohman
ca2ab1f2c8 Make LowerSubregs' debug output for EXTRACT_SUBREG consistent with
that of INSERT_SUBREG and SUBREG_TO_REG.

llvm-svn: 61218
2008-12-18 22:11:34 +00:00
Dan Gohman
7000e62d3a Fix a copy+pasto in an assertion message.
llvm-svn: 61217
2008-12-18 22:07:25 +00:00
Dan Gohman
34e47d552b Fix indentation level.
llvm-svn: 61216
2008-12-18 22:06:01 +00:00
Dan Gohman
47de8c174c Print subreg information in MachineInstr::dump.
llvm-svn: 61213
2008-12-18 21:51:27 +00:00
Mon P Wang
84ad2a383d Added support for vector widening.
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Dan Gohman
fae8a30dce Give MachineLICM a name, for -time-passes etc.
llvm-svn: 61184
2008-12-18 01:37:56 +00:00
Dan Gohman
6b4f972c9f Move post-RA scheduling before branch folding for now, because branch
folding's tail merging doesn't currently preserve liveness information
which post-RA scheduling requires.

llvm-svn: 61183
2008-12-18 01:36:42 +00:00
Owen Anderson
9a489bf18a Re-apply r61158 in a form that no longer breaks tests.
llvm-svn: 61182
2008-12-18 01:27:19 +00:00
Owen Anderson
5f1bc95673 Revert r61158 for now, as it caused some test failures.
llvm-svn: 61159
2008-12-17 22:17:27 +00:00
Owen Anderson
446162d848 Fix miscompilations caused by renumbering, and enable it as part of prealloc splitting.
llvm-svn: 61158
2008-12-17 22:06:59 +00:00
Mon P Wang
bc3622287b Fix expansion of vsetcc to set the high bit for true instead of 1.
llvm-svn: 61129
2008-12-17 08:49:47 +00:00
Dan Gohman
a8796f4908 Double the amount of memory reserved for SUnits. This is a
temporary workaround for an obscure bug. When node cloning is
used, it is possible that more SUnits will be created, and
if the SUnits std::vector has to reallocate, it will
invalidate all the graph edges.

llvm-svn: 61122
2008-12-17 04:30:46 +00:00
Dan Gohman
6ee60e3ac3 Use getDepth() and getHeight() instead of accessing the
Depth and Height members directly, as they may not be
current.

llvm-svn: 61121
2008-12-17 04:25:52 +00:00
Eli Friedman
4aae828bf8 Fix for PR3225: disable a broken optimization in
DAGTypeLegalizer::ExpandShiftWithKnownAmountBit.

In terms of restoring the optimization, the best fix here isn't 
obvious... any ideas?

llvm-svn: 61119
2008-12-17 03:35:17 +00:00
Dale Johannesen
e348900657 A new dag combine; several permutations of this
are there under ADD, this one was missing.

llvm-svn: 61107
2008-12-16 22:13:49 +00:00
Owen Anderson
36aba82416 Add code to renumber split intervals into new vregs. This is disabled for now until I finish working out some iterator invalidation issues.
llvm-svn: 61104
2008-12-16 21:35:08 +00:00
Dan Gohman
38316f49bd Eliminate the loop that walks the critical path. Instead, just track the
position in the critical path during the main instruction walk.  This
eliminates the need for the CritialAntiDep DenseMap.

llvm-svn: 61096
2008-12-16 19:27:52 +00:00
Dan Gohman
f8f5625748 Preserve SourceValue information when lowering produces multiple loads from
different offsets within the same stack slot.

llvm-svn: 61093
2008-12-16 18:25:36 +00:00
Evan Cheng
96d87db03b We have decided not to support inline asm where an output operand with a matching input operand with incompatible type (i.e. either one is a floating point and the other is an integer or the sizes of the types differ). SelectionDAGBuild will catch these and exit with an error.
llvm-svn: 61092
2008-12-16 18:21:39 +00:00
Dan Gohman
10eb3ccaeb Enable anti-dependence breaking by default when post-RA scheduling is enabled.
llvm-svn: 61078
2008-12-16 06:21:45 +00:00
Dan Gohman
9f37a0296b When breaking an anti-dependency, don't use a register which has seen
one of its aliases defined. This is conservative, but tricky subreg
corner cases are outside the primary aim of this pass.

llvm-svn: 61077
2008-12-16 06:20:58 +00:00
Dan Gohman
c3e24d559b Add initial support for back-scheduling address computations,
especially in the case of addresses computed from loop induction
variables.

llvm-svn: 61075
2008-12-16 03:35:01 +00:00
Dan Gohman
e2cf452271 Remove some special-case logic in ScheduleDAGSDNodes's
latency computation code that is no longer needed with the
new method for handling latencies.

llvm-svn: 61074
2008-12-16 03:31:11 +00:00
Dan Gohman
40a40dd7c1 Fix some register-alias-related bugs in the post-RA scheduler liveness
computation code. Also, avoid adding output-depenency edges when both
defs are dead, which frequently happens with EFLAGS defs.

Compute Depth and Height lazily, and always in terms of edge latency
values. For the schedulers that don't care about latency, edge latencies
are set to 1.

Eliminate Cycle and CycleBound, and LatencyPriorityQueue's Latencies array.
These are all subsumed by the Depth and Height fields.

llvm-svn: 61073
2008-12-16 03:25:46 +00:00
Dan Gohman
67e694b0ea Add a simple target-independent heuristic to allow targets with no
instruction itinerary data to back-schedule loads.

llvm-svn: 61070
2008-12-16 02:38:22 +00:00
Dan Gohman
8ddcdef08a Move addPred and removePred out-of-line.
llvm-svn: 61067
2008-12-16 01:05:52 +00:00
Dan Gohman
23aae3bba9 Make addPred and removePred return void, since the return value is not
currently used by anything.

llvm-svn: 61066
2008-12-16 01:00:55 +00:00
Dan Gohman
d6ad3f6178 This getEdgeAttributes doesn't need a template argument.
llvm-svn: 61065
2008-12-16 00:55:00 +00:00
Mon P Wang
bb3c2994f0 Added support for splitting and scalarizing vector shifts.
llvm-svn: 61050
2008-12-15 21:44:00 +00:00
Dan Gohman
f3c46b3496 Fix printing of PseudoSourceValues in SDNode graphs.
llvm-svn: 61036
2008-12-15 17:28:10 +00:00
Mon P Wang
2f96113348 Added support to LegalizeType for expanding the operands of scalar to vector
and insert vector element.  Modified extract vector element to extend the
result to match the expected promoted type.

llvm-svn: 61029
2008-12-15 06:57:02 +00:00
Duncan Sands
ef671b5627 Reapply r60997, this time without forgetting that
target constants are allowed to have an illegal
type.

llvm-svn: 61006
2008-12-14 09:43:15 +00:00
Bill Wendling
380fbdc9f8 Temporarily revert r60997. It was causing this failure:
Running /Users/void/llvm/llvm.src/test/CodeGen/Generic/dg.exp ...
FAIL: /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll
Failed with exit(1) at line 1
while running:  llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll |  llc | /usr/bin/grep 68719476738
Assertion failed: ((TypesNeedLegalizing || getTypeAction(VT) == Legal) && "Illegal type introduced after type legalization?"), function HandleOp, file /Users/void/llvm/llvm.src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 493.
0   llc               0x0085392e char const* std::find<char const*, char>(char const*, char const*, char const&) + 98
1   llc               0x00853e63 llvm::sys::PrintStackTraceOnErrorSignal() + 593
2   libSystem.B.dylib 0x96cac09b _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1765097359
4   libSystem.B.dylib 0x96d24ec2 raise + 26
5   libSystem.B.dylib 0x96d3447f abort + 73
6   libSystem.B.dylib 0x96d26063 __assert_rtn + 101
7   llc               0x004f9018 llvm::cast_retty<llvm::SubprogramDesc, llvm::DebugInfoDesc*>::ret_type llvm::cast<llvm::Sub
...

llvm-svn: 61001
2008-12-13 23:53:00 +00:00
Duncan Sands
7cddec2a2f LegalizeDAG is not supposed to introduce illegal
types into the DAG if they were not already there.
Check this with an assertion.

llvm-svn: 60997
2008-12-13 22:33:38 +00:00
Mon P Wang
2880dc8e8c Remove assertion to allow promotion of a truncating store operand
llvm-svn: 60975
2008-12-13 08:16:43 +00:00
Mon P Wang
da91e0e191 Added basic support for expanding VSETCC
llvm-svn: 60974
2008-12-13 08:15:14 +00:00
Duncan Sands
1faa6258eb On big-endian machines it is wrong to do a full
width register load followed by a truncating
store for the copy, since the load will not place
the value in the lower bits.  Probably partial
loads/stores can never happen here, but fix it
anyway.

llvm-svn: 60972
2008-12-13 07:18:38 +00:00
Devang Patel
5b7938b1cc Do not print empty DW_AT_comp_dir.
llvm-svn: 60965
2008-12-12 21:57:54 +00:00
Duncan Sands
ddce2cb415 When expanding unaligned loads and stores do not make
use of illegal integer types: instead, use a stack slot
and copying via integer registers.  The existing code
is still used if the bitconvert is to a legal integer
type.

This fires on the PPC testcases 2007-09-08-unaligned.ll
and vec_misaligned.ll.  It looks like equivalent code
is generated with these changes, just permuted, but
it's hard to tell.

With these changes, nothing in LegalizeDAG produces
illegal integer types anymore.  This is a prerequisite
for removing the LegalizeDAG type legalization code.

While there I noticed that the existing code doesn't
handle trunc store of f64 to f32: it turns this into
an i64 store, which represents a 4 byte stack smash.
I added a FIXME about this.  Hopefully someone more
motivated than I am will take care of it.

llvm-svn: 60964
2008-12-12 21:47:02 +00:00
Evan Cheng
56d9fc70bd Fix add/sub expansion: don't create ADD / SUB with two results (seems like everyone is doing this these days :-). Patch by Daniel M Gessel!
llvm-svn: 60958
2008-12-12 18:49:09 +00:00
Duncan Sands
06ecf57a87 When using a 4 byte jump table on a 64 bit machine,
do an extending load of the 4 bytes rather than a
potentially illegal (type) i32 load followed by a
sign extend.

llvm-svn: 60945
2008-12-12 08:13:38 +00:00
Mon P Wang
53d0c96c6f Added support for SELECT v8i8 v4i16 for X86 (MMX)
Added support for TRUNC v8i16 to v8i8 for X86 (MMX)

llvm-svn: 60916
2008-12-12 01:25:51 +00:00
Bill Wendling
5d026e47c1 Redo the arithmetic with overflow architecture. I was changing the semantics of
ISD::ADD to emit an implicit EFLAGS. This was horribly broken. Instead, replace
the intrinsic with an ISD::SADDO node. Then custom lower that into an
X86ISD::ADD node with a associated SETCC that checks the correct condition code
(overflow or carry). Then that gets lowered into the correct X86::ADDOvf
instruction.

Similar for SUB and MUL instructions.

llvm-svn: 60915
2008-12-12 00:56:36 +00:00
Mon P Wang
f578029326 Avoid generating a convert_rndsat node when the src and dest type are the same.
llvm-svn: 60869
2008-12-11 03:30:13 +00:00
Bill Wendling
060f17c854 Clarify FIXME.
llvm-svn: 60867
2008-12-11 01:26:44 +00:00
Mon P Wang
80cfaeecfe Whitespace clean up (tabs with spaces)
llvm-svn: 60866
2008-12-11 00:44:22 +00:00
Mon P Wang
4448877ed7 Make fix for r60829 less conservative to allow the proper optimization for
vec_extract-sse4.ll.

llvm-svn: 60865
2008-12-11 00:26:16 +00:00
Bill Wendling
02555039a0 Add a newline after this debug output.
llvm-svn: 60861
2008-12-10 23:24:43 +00:00
Bill Wendling
292263313b If ADD, SUB, or MUL have an overflow bit that's used, don't do transformation on
them. The DAG combiner expects that nodes that are transformed have one value
result.

llvm-svn: 60857
2008-12-10 22:36:00 +00:00