Commit Graph

6494 Commits

Author SHA1 Message Date
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