Commit Graph

6657 Commits

Author SHA1 Message Date
Devang Patel
6360089d63 Remove dead code, again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:27:49 +00:00
Devang Patel
425b64ecef Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:25:47 +00:00
Devang Patel
d234e59e57 Add DW_AT_declaration for class methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:21:46 +00:00
Bill Wendling
5c71acfb06 Propagate debug location info for the token factor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:13:16 +00:00
Bill Wendling
35247c3513 Add DebugLoc propagation to some of the methods in DAG combiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 00:45:56 +00:00
Owen Anderson
3ef4549d9d Correct the algorithms for choosing spill and restore points so that we don't try to insert loads/stores between call frame setup and the actual call.
This fixes the last known failure for the pre-alloc-splitter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 22:13:06 +00:00
Dan Gohman
15b3830bcd Explicitly add PseudoSourceValue information when lowering
BUILD_VECTOR and conversions to stack operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 21:02:43 +00:00
Dan Gohman
1cc6b8ee78 Make a few things const, fix some comments, and simplify
some assertions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 19:49:27 +00:00
Evan Cheng
d5a4802708 Local register allocator shouldn't assume only the entry and landing pad basic blocks have live-ins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 18:37:30 +00:00
Dan Gohman
2c65c3dfe6 Fix two typos that Duncan spotted in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 16:18:12 +00:00
Dan Gohman
197e88f796 In the case of an extractelement on an insertelement value,
the element indices may be equal if either one is not a
constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 16:10:46 +00:00
Bill Wendling
56ab1a2815 Revert r63273. This was already implemented by Dale. There's no need for my
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 09:01:55 +00:00
Owen Anderson
c0f3a0353c Fix an issue where restores could be inserted after a terminator instruction,
and an iterator invalidation issue.

FreeBench/pifft no longer miscompiles with these fixes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 08:22:06 +00:00
Owen Anderson
4bfc209721 Comments are good. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 05:41:02 +00:00
Owen Anderson
45e6855ea2 Add support for aggressive load-use-store folding. This takes care of the
vast majority of code size regressions introduced by pre-alloc-splitting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 05:28:55 +00:00
Bill Wendling
6e1bb38fb8 - Add DebugLoc to getTargetNode().
- Modify TableGen to add the DebugLoc when calling getTargetNode.

(The light-weight wrappers are only temporary. The non-DebugLoc version will be
removed once the whole debug info stuff is finished with.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 05:27:31 +00:00
Evan Cheng
5a3c6a87b0 Exit with nice warnings when register allocator run out of registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 02:20:59 +00:00
Dan Gohman
e5af2d3a22 Make x86's BT instruction matching more thorough, and add some
dagcombines that help it match in several more cases. Add
several more cases to test/CodeGen/X86/bt.ll. This doesn't
yet include matching for BT with an immediate operand, it
just covers more register+register cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 01:59:02 +00:00
Evan Cheng
7ddee0ad24 A slight compile time optimization. If the caller knows there isn't a free register getReg() should not call getFreeReg().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 01:13:00 +00:00
Dale Johannesen
e8c17335c5 Add DebugLoc-sensitive versions of many node creation
functions.  Currently omitted:  memcpy, memmove, memset.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 00:47:48 +00:00
Evan Cheng
42cc6e33ec Fix comment about removeRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 00:06:09 +00:00
Bill Wendling
7ade28cd62 Add DebugLoc to the getNode() methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:17:52 +00:00
Dale Johannesen
3edb43e620 Add DebugLoc-aware constructors for SDNode derived
classes (those that reasonably have a DebugLoc
associated with them).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:18:29 +00:00
Devang Patel
f923574856 Do not forget to derived type while constructing an array type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:08:20 +00:00
Mon P Wang
f7eef6811c Fixed extract element when the result needs to be promoted and the input widened.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63217 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 18:53:39 +00:00
Dan Gohman
f560ffae1f Make isOperationLegal do what its name suggests, and introduce a
new isOperationLegalOrCustom, which does what isOperationLegal
previously did.

Update a bunch of callers to use isOperationLegalOrCustom
instead of isOperationLegal. In some case it wasn't obvious
which behavior is desired; when in doubt I changed then to
isOperationLegalOrCustom as that preserves their previous
behavior.

This is for the second half of PR3376.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 17:46:25 +00:00
Duncan Sands
0b3aa26384 Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 14:42:54 +00:00
Duncan Sands
1465d61bdd Rename getAnalysisToUpdate to getAnalysisIfAvailable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 13:14:17 +00:00
Dan Gohman
f83c81acbe Use ValueType::bitsLT to simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 03:10:52 +00:00
Dan Gohman
77f7a5771e Use ZERO_EXTEND instead of ANY_EXTEND when promoting
shift amounts, to avoid implicitly assuming that
target architectures will ignore the high bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 02:58:31 +00:00
Devang Patel
7009d24e81 Add type DIE into appropriate context DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 23:22:55 +00:00
Dale Johannesen
06efc02854 Add a DebugLoc field and some simple accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 23:20:29 +00:00
Evan Cheng
aaeea9e64f Refine DebugLoc per review comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 21:15:07 +00:00
Dan Gohman
ce9bc12c6f Add an assertion to the form of SelectionDAG::getConstant that takes
a uint64_t to verify that the value is in range for the given type,
to help catch accidental overflow. Fix a few places that relied on
getConstant implicitly truncating the value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 20:39:34 +00:00
Dan Gohman
daac99cdfb Delete redundant return statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 19:23:22 +00:00
Owen Anderson
26562de2ef Make the pre-split-limit option more useful by using a per-function counter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 05:01:15 +00:00
Devang Patel
ad165bec1d Assorted debug info fixes.
- DW_AT_bit_size is only suitable for bitfields.
- Encode source location info for derived types.
- Source location and type size info is not useful for subroutine_type (info is included in respective DISubprogram) and array_type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 00:45:04 +00:00
Evan Cheng
b9f66cfadf No need to keep size of DebugLocations vector separately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 23:47:30 +00:00
Scott Michel
210de72cd7 Make the Dwarf macro information section optional; CellSPU's assembler
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 22:32:51 +00:00
Owen Anderson
b4b8436381 Reapply r63025 and r63026, with fixes for the failing testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:57:31 +00:00
Duncan Sands
5bb11b89dd Fix PR3393, which amounts to a bug in the expensive
checking logic.  Rather than make the checking more
complicated, I've tweaked some logic to make things
conform to how the checking thought things ought to
be, since this results in a simpler "mental model".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:54:18 +00:00
Bill Wendling
826f093517 Also revert r63206
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:30:17 +00:00
Bill Wendling
34b946b8fb Temporarily revert r63025 until the testsuite failures can be fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:27:03 +00:00
Anton Korobeynikov
36c826ad95 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 :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 19:26:01 +00:00
Owen Anderson
d7250517b0 Get rid of a bunch of dead code now that interval reconstruction is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 19:18:06 +00:00
Owen Anderson
8af1e761f8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 19:12:06 +00:00
Evan Cheng
b964f33873 Silence a bogus compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 18:33:51 +00:00
Evan Cheng
c4b1abd81e Actually source file has already been uniquified into an id during isel. Eliminate the StringMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 07:53:42 +00:00
Evan Cheng
d0adbb5b7d Add data structure to define and track debug location during codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 07:41:49 +00:00
Dan Gohman
e7852d0144 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 04:35:06 +00:00
Dan Gohman
399461095b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 16:29:12 +00:00
Dan Gohman
74692c0d65 Whitespace tidiments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 16:21:38 +00:00
Dan Gohman
e77f89de8c Move the N->use_empty() assert from DeleteNode to
DeleteNodeNotInCSEMaps, since DeleteNode just calls
DeleteNodeNotInCSEMaps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 16:20:37 +00:00
Evan Cheng
d498c8f2c8 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>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 03:53:59 +00:00
Nate Begeman
9b99485074 Fix an indent and a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 22:12:48 +00:00
Owen Anderson
32ca8657b8 Some cleanups. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 10:07:43 +00:00
Evan Cheng
8191371f87 Refactor code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 23:27:33 +00:00
Devang Patel
3b64c6bc29 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 22:33:47 +00:00
Devang Patel
80303aade2 Empty DIType represents void. In this case no need to construct any type DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 19:13:31 +00:00
Dan Gohman
a90c8e690b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62860 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 19:10:37 +00:00
Evan Cheng
c16d37ead0 Only check if coalescing is worthwhile when the result is targeting a more restrictive register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 05:48:59 +00:00
Owen Anderson
9ce499ab36 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 03:28:53 +00:00
Evan Cheng
8c08d8c77c Cross register class coalescing. Not yet enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 02:15:19 +00:00
Devang Patel
a608687f3e Code did not follow associated comment. not a good idea.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 01:25:58 +00:00
Devang Patel
49f38cb32f Set appropriate tag for the composite type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 01:19:09 +00:00
Owen Anderson
956ec27a99 Add an initial pass at dead spill/restore removal for pre alloc splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 00:23:32 +00:00
Chris Lattner
bbfa244b2f do not sign extend characters input to isprint. This improves
compatibility with VC++.  Patch by Max Burke!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 23:38:45 +00:00
Bob Wilson
67ba22318b 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 22:05:48 +00:00
Dan Gohman
760f86f339 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 21:58:43 +00:00
Bob Wilson
4c24546238 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 17:39:32 +00:00
Sanjiv Gupta
fcc6f1556e Few targets like the tiny little PIC16 have only 16-bit pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 10:14:21 +00:00
Evan Cheng
536ab130ec 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 09:10:11 +00:00
Chris Lattner
e70909b8c9 fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 07:21:55 +00:00
Dan Gohman
764fd0cbc8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 15:17:51 +00:00
Duncan Sands
9fbc7e2e7a Cleanup whitespace and comments, and tweak some
prototypes, in operand type legalization.  No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 09:00:29 +00:00
Owen Anderson
d3be46214c I accidentally removed this check in an earlier commit, which cause breakage in the pre alloc splitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 08:18:03 +00:00
Scott Michel
d1e8d9c0a5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 04:58:48 +00:00
Sanjiv Gupta
bb326bbe88 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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 04:48:39 +00:00
Owen Anderson
6cf7c390ec Be more aggressive about renumbering vregs after splitting them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 00:13:28 +00:00
Devang Patel
476615934a Encode member accessibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 00:08:04 +00:00
Devang Patel
2a574669f3 Appropriately mark fowrad decls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 22:27:02 +00:00
Evan Cheng
a894ae130b 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 21:25:12 +00:00
Bill Wendling
e9a7286087 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 21:17:57 +00:00
Devang Patel
2be5893a04 Fix struct member's debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 21:02:02 +00:00
Devang Patel
6906ba52f0 Need only one set of debug info versions enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 19:22:03 +00:00
Evan Cheng
04ee5a1d92 Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 19:12:24 +00:00
Devang Patel
9ec50ab3f8 Fix global variable's address in a DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 18:55:39 +00:00
Devang Patel
eab4a2e8ac Enable debug info for enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 18:35:14 +00:00
Devang Patel
ce31b027e7 Enable debug info for composite types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 18:13:03 +00:00
Evan Cheng
e08eb9ca1d Refactor code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 06:44:16 +00:00
Bill Wendling
6c53334b90 Shift types need to match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 06:10:42 +00:00
Dan Gohman
f5add58549 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 01:06:45 +00:00
Devang Patel
c2997f4a34 Do not use DenseMap because the iterator is invalidated while constructing types. After all there was a reason why std::map was used initially!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 00:58:55 +00:00
Evan Cheng
d0deec20f6 Make linear scan's trivial coalescer slightly more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 00:16:18 +00:00
Devang Patel
b79b5359fb Verify debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 23:21:49 +00:00
Dan Gohman
c533612949 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 22:39:36 +00:00
Dan Gohman
dbe664adcd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 21:44:21 +00:00
Sanjiv Gupta
15c94d08ab Few targets like PIC16 wants libcall generation for illegal type i16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18 18:25:27 +00:00
Mon P Wang
e3bc6ae92a Simplify extract element based on comments from Duncan Sands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18 06:43:40 +00:00
Devang Patel
2d1768ca52 Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 08:05:14 +00:00
Devang Patel
5aac3d3707 Refactor code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 08:01:33 +00:00
Devang Patel
7ab2450674 Assign argument type to appropriate DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 06:57:25 +00:00
Devang Patel
7e55b3a663 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 06:51:37 +00:00
Devang Patel
2d91d18ba1 Disable composite type debug info for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 05:05:12 +00:00
Mon P Wang
7ac9cdfc99 Simplify extract element of a scalar to vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:07:25 +00:00
Dan Gohman
f7119393a9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:10:20 +00:00
Dan Gohman
49bb50e0b6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:57:43 +00:00
Dan Gohman
b6a6164832 Use the getNode() accessor instead of accessing the Node
member directly, which is private as of r55504.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:47:21 +00:00
Dan Gohman
8554449e31 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:37:14 +00:00
Chris Lattner
df874eed56 new nodes should be added to the worklist, not old nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:15:56 +00:00
Devang Patel
07354e532b Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:07:53 +00:00
Evan Cheng
e57187cbe3 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 20:57:18 +00:00
Devang Patel
99ec3538b8 Use lightweight DebugInfo objects directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:28:14 +00:00
Devang Patel
7103c6a993 Align source code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 18:01:58 +00:00
Dan Gohman
79ce4cea47 Fix a "comparison between signed and unsigned integer expressions"
warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 17:55:08 +00:00
Mikhail Glushenkov
2388a588bd 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 07:02:28 +00:00
Mikhail Glushenkov
5c1799b293 Delete trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 06:53:46 +00:00
Devang Patel
5be935536f Validate debug info values only if DwarfDebug is initialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 02:15:14 +00:00
Devang Patel
61c6bf37ef Any debug info symbol is only valid if atleast one compile unit is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 01:49:46 +00:00
Dan Gohman
2836c283bb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 01:33:36 +00:00
Devang Patel
153745cc1f Do not stumble over forward declared struct member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 00:50:53 +00:00
Devang Patel
cf3a4487c0 Validate dbg_* intrinsics before lowering them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 23:41:32 +00:00
Mon P Wang
fa9c5eac33 Added missing support to widen an operand from a bit convert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62285 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 22:43:38 +00:00
Dan Gohman
fc54c55296 Generalize the HazardRecognizer interface so that it can be used
to support MachineInstr-based scheduling in addition to
SDNode-based scheduling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62284 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 22:18:12 +00:00
Dan Gohman
c475c3608a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 22:01:38 +00:00
Rafael Espindola
bb46f52027 Add the private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 20:18:42 +00:00
Devang Patel
f193ff0590 Use lightweight DebugInfo objects directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 19:26:23 +00:00
Dan Gohman
79ce276083 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 19:20:50 +00:00
Devang Patel
0e5200f3fd Use variable's context to identify respective DbgScope.
Use light weight DebugInfo object directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 18:25:17 +00:00
Dan Gohman
65b7f27bb7 Make getWidenVectorType const; this file was missed in the
previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 17:39:39 +00:00
Dan Gohman
e9530ecae4 More consts on TargetLowering references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 16:58:17 +00:00
Dan Gohman
0d137d7f35 Use const with TargetLowering references in a few more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 16:43:02 +00:00
Gabor Greif
b67e6b3b65 minor refactoring: use a more specific API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 11:10:44 +00:00
Devang Patel
4548d97399 Do not construct debug scope if RootScope *is* null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-14 01:34:32 +00:00
Devang Patel
bbdc8207d5 Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 23:54:55 +00:00
Devang Patel
e2051627b8 Keep "has debug info" big in MachineModuleInfo to avoid circular dependency between AsmPrinter and CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 23:02:17 +00:00
Devang Patel
35fe7344ae Undo previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 22:54:57 +00:00
Devang Patel
c48c550e13 Use DwarfWriter to record dbg variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 21:44:10 +00:00
Devang Patel
bb8c5959c8 Use dwarf writer to decide whether the module has debug info or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 21:25:00 +00:00
Dan Gohman
fd246e5f84 Use assertions to check for conditions that should never happen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 20:25:24 +00:00
Dan Gohman
bc0b56732a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 20:24:13 +00:00
Dan Gohman
a1f50e2c2c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 19:08:45 +00:00
Duncan Sands
2ecf88d175 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 15:17:14 +00:00
Duncan Sands
1bec3dd28a Fix some typos. Also, the WidenedVectors map
was not being cleaned by ExpungeNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 14:42:39 +00:00
Duncan Sands
042fb3199f Correct a comment - this is not a sign extension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 14:04:14 +00:00
Evan Cheng
167650d411 Un-tabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 06:08:37 +00:00
Evan Cheng
1d8a76d7d5 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 03:57:45 +00:00
Devang Patel
83489bb770 Use DebugInfo interface to lower dbg_* intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 00:35:13 +00:00
Devang Patel
7bb89ed33c Start using DebugInfo API to emit debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 00:20:51 +00:00
Devang Patel
3f7833a273 Emit debug info, only if at least one compile unit is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 23:09:42 +00:00
Devang Patel
72b663575f 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.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 23:05:55 +00:00
Devang Patel
f6bac3e4bd Avoid cast<>, use light weith wrapper directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 22:58:14 +00:00
Devang Patel
f3ee514419 Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 22:54:42 +00:00
Duncan Sands
ceb4d1aecb Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 20:38:59 +00:00
Devang Patel
ccca7fe6a3 Add DwarfWriter interface to mainipulate source location info.
( May be this info should be directly handled by the dwarf writer ? )


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 19:17:34 +00:00
Devang Patel
481ff5be9d Clear debug info at the end of function processing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 18:48:36 +00:00
Devang Patel
e9bfb0feca There is no need to maintain separate labelid list in the dwarf writer. It is not a good idea.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 18:41:00 +00:00
Evan Cheng
c29a56dedb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62074 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 03:19:55 +00:00
Owen Anderson
e1762c9826 More two-address fixes. This gets lua working with join-creation enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 03:10:40 +00:00
Evan Cheng
9aacec1f26 CheckForPhysRegDependency should not return copy cost. It's not used. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-11 08:53:35 +00:00
Devang Patel
9795da5aa8 Reduce initial small vector sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-10 02:42:49 +00:00
Devang Patel
0dc969e1ab Fix thinko. Create parent scope if parent descriptor is *not* null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-10 02:34:18 +00:00
Evan Cheng
5c3c5a4d9c Duplicated node may produce a non-physical register def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 22:44:02 +00:00
Evan Cheng
84036a77a3 Minor debug output tweak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 20:42:34 +00:00
Devang Patel
6e7a1617ac Request DwarfWriter. This will be used to handle dbg_* intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 19:11:50 +00:00
Misha Brukman
9b8f542e27 Removed trailing whitespace from Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 16:44:42 +00:00
Devang Patel
eb3fc28914 Convert DwarfWriter into a pass.
Now Users request DwarfWriter through getAnalysisUsage() instead of creating an instance of DwarfWriter object directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 23:40:34 +00:00
Dan Gohman
5d5ee80ea8 Delete unnecessary parens around return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 22:19:34 +00:00
Devang Patel
9f8fcfc018 Add DebugInfo based APIs to record source line info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 17:19:22 +00:00
Misha Brukman
ce07e99dd6 * Moved author attribution to CREDITS.TXT
* Removed trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 16:40:25 +00:00
Misha Brukman
2a835f947a * Alphabetized #includes
* Removed trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 15:50:22 +00:00
Devang Patel
2ec78c4a63 Add APIs to record regions and variables.
Again, shamelessly copied from MMI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61912 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 02:49:34 +00:00
Devang Patel
7a6e5a3531 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 02:33:41 +00:00
Dan Gohman
25fd4037a7 Remove redundant 'else's. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 22:30:55 +00:00
Evan Cheng
8f90b6eb2f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 02:08:57 +00:00
Dan Gohman
2c91d102ec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 22:53:52 +00:00
Devang Patel
5d31598954 Set up DwarfDebug using DebugInfo API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 21:07:30 +00:00
Bill Wendling
5fe1fac1dd Forgot that this was needed for Linux. This should fix the builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 19:13:55 +00:00
Owen Anderson
200ee7f521 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 07:53:32 +00:00
Dan Gohman
ce0d4b7a77 Update these argument lists for the isNormalMemory
argument. This doesn't affect current functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:28:56 +00:00
Dan Gohman
fd2163bcf7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:19:04 +00:00
Devang Patel
78eb6ad633 Construct subprogram DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:21:35 +00:00
Devang Patel
c452324f60 Construct global variable DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:11:11 +00:00
Devang Patel
d1ca925093 Construct compile unit dies using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:03:32 +00:00
Bill Wendling
d60de51878 Revert r61415 and r61484. Duncan was correct that these weren't needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:53:45 +00:00
Dan Gohman
a80c859df3 Don't call setDepthDirty/setHeightDirty when adding an edge
with latency 0, since it doesn't affect the depth or height.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:40:26 +00:00
Devang Patel
8526cc03a5 Extract source location info from DebugInfo.
Add methods to add source location info in a DIE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:35:52 +00:00
Devang Patel
48d190f4d7 Add type DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:47:57 +00:00
Devang Patel
f421533661 Construct composite type DIE using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:55:51 +00:00
Dan Gohman
11df7e5157 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:40:39 +00:00
Devang Patel
e520273172 s/ConstructType/ConstructTypeDIE/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:07:53 +00:00
Devang Patel
86ae142c51 Construct stuct field DIEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 18:59:44 +00:00
Devang Patel
c69bf2c832 Construct enumerator DIE using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 18:38:38 +00:00
Devang Patel
68afdc3ab0 Construct array/vector type DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 18:33:01 +00:00
Owen Anderson
d0ed240e30 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 18:32:26 +00:00
Dan Gohman
d68a07650c Tidy up #includes, deleting a bunch of unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:59:02 +00:00
Devang Patel
08f053f5d1 Construct basic and derived type DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:57:47 +00:00
Devang Patel
ca03c2705e subsume ConstructPointerType()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:45:59 +00:00
Devang Patel
9ede3f2f29 subsume ConstructBasicType().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:44:11 +00:00
Devang Patel
8a84e4402a squash warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:31:22 +00:00