Commit Graph

9470 Commits

Author SHA1 Message Date
Evan Cheng
112e5e7eff Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 20:33:48 +00:00
Chris Lattner
ea16ea5901 Fix PR6673: updating the callback should not clear the map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:15:57 +00:00
Devang Patel
4a602caf2e Emit DW_AT_low_pc and DW_AT_high_pc attributes for TAG_compile_unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:11:36 +00:00
Devang Patel
0493f95a2c DW_AT_stmt_list attribute attached with a compile unit encodes offset of line number information for this compile unit in debug_line section. This offset is always zero when only one compile unit is emitted in a object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 22:38:48 +00:00
Evan Cheng
a69ec09364 Reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 21:24:33 +00:00
Jeffrey Yasskin
638fe8dd62 Fix a memory leak from DIE::addSiblingOffset() by adding the DIEValue
it allocates to DwarfDebug::DIEValues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 18:47:14 +00:00
Evan Cheng
fc91114a2e 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 18:40:50 +00:00
Jeffrey Yasskin
6b4c12db13 Free SavedLI even if SimpleRegisterCoalescing::JoinCopy() returns early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 01:47:49 +00:00
Bob Wilson
80d23705e6 Stop trying to merge identical jump tables. This had been inadvertently
disabled for several months (since svn r88806) and no one noticed.  My fix
for pr6543 yesterday reenabled it, but broke the ARM port's code for using
TBB/TBH.  Rather than adding a target hook to disable merging for Thumb2 only,
I'm just taking this out.  It is not common to have identical jump tables,
the code we used to merge them was O(N^2), and it only helps code size, not
performance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 19:05:41 +00:00
Mon P Wang
c1e5d491a0 Fixed a widening bug where we were not using the correct size for the load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:19:52 +00:00
Anton Korobeynikov
f0d500768d Get rid of target-specific nodes for fp16 <-> fp32 conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 22:35:37 +00:00
Dan Gohman
9553188fcc Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:49:47 +00:00
Bob Wilson
d1ec31dca5 Fix pr6543: svn r88806 changed MachineJumpTableInfo::getJumpTableIndex() to
always create a new jump table.  The intention was to avoid merging jump
tables in SelectionDAGBuilder, and to wait for the branch folding pass to
merge tables.  Unfortunately, the same getJumpTableIndex() method is also
used to merge tables in branch folding, so as a result of this change
branch tables are never merged.  Worse, the branch folding code is expecting
getJumpTableIndex to always return the index of an existing table, but with
this change, it never does so.  In at least some cases, e.g., pr6543, this
creates references to non-existent tables.

I've fixed the problem by adding a new createJumpTableIndex function, which
will always create a new table, and I've changed getJumpTableIndex to only
look at existing tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:42:41 +00:00
Dan Gohman
1584390e55 Add explicit braces to avoid ambiguous ‘else’.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:07:13 +00:00
Devang Patel
1ac2429d1f Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 16:41:16 +00:00
Jakob Stoklund Olesen
ec1176a206 Revert "Change coalescer complexity from N^2 to N logN by changing one letter."
This reverts commit 98776. It broke the llvm-gcc boot strap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:23:47 +00:00
Devang Patel
c3188ce0f1 Debug info intrinsic does not intefer during tail call optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 23:52:37 +00:00
Jakob Stoklund Olesen
0427b2ac45 Change coalescer complexity from N^2 to N logN by changing one letter.
Remove ugly hack that aborted the coalescer before using N^2 time.

This affects functions with very complicated live intervals for physical
registers, i.e. functions with thousands of function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 23:21:58 +00:00
Devang Patel
5b33f3148c Fix EmitSectionOffset incorrect argument. DwarfDebug is emitting debug info so isEH is always false. This was hiding until now from compilers because of default arguments. This was hiding from dwarf debug info users because for most of the platform isAbsoluteEHSectionOffsets() is same as isAbsoluteDebugSectionOffsets(). But Chris found it while updating dwarf printer to use MC*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 17:29:55 +00:00
Chris Lattner
77e7694026 fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 05:41:18 +00:00
Bob Wilson
a1bdfc3c7f Remove a check that can no longer be true, after r84803.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 23:40:32 +00:00
Evan Cheng
4507f089d4 Fix liveintervals handling of dbg_value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:51:27 +00:00
Chris Lattner
93b122d3c4 reapply r98656 unmodified, which exposed the asmprinter not
handling constant unions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:25:55 +00:00
Devang Patel
cbe1e31732 Ignore debug value instructions while analyzing BB for tail duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:02:07 +00:00
Daniel Dunbar
b85c7100c5 Revert r98656, its breaking all over the place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:35:34 +00:00
Chris Lattner
8b3b34f410 improve support for uniontype and ConstantUnion, patch by Tim Northover!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:15:03 +00:00
Bill Wendling
b0d27662ea Use getFirstTerminator().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 02:01:51 +00:00
Bill Wendling
8fe347a8b5 When checking if something's killed, don't rely simply on whether it's marked as
"used outside of the block". If the block ends in a return, then it won't be
used outside of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98599 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 01:05:35 +00:00
Chris Lattner
999aee24c7 Fix the third (and last known) case of code update problems due
to LLVM IR changes with addr label weirdness.  In the testcase, we
generate references to the two bb's when codegen'ing the first
function:

_test1:                                 ## @test1
	leaq	Ltmp0(%rip), %rax
..
	leaq	Ltmp1(%rip), %rax

Then continue to codegen the second function where the blocks
get merged.  We're now smart enough to emit both labels, producing
this code:

_test_fun:                              ## @test_fun
## BB#0:                                ## %entry
Ltmp1:                                  ## Block address taken
Ltmp0:
## BB#1:                                ## %ret
	movl	$-1, %eax
	ret

Rejoice.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:29:39 +00:00
Bill Wendling
505ad8bed3 Now that the default for Darwin platforms is to place the LSDA into the TEXT
section, remove the target-specific code that performs this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 21:09:38 +00:00
Chris Lattner
9cc0da9c29 Implement support for the case when a reference to a addr-of-bb
label is generated, but then the block is deleted.  Since the
value is undefined, we just emit the label right after the entry 
label of the function.  It might matter that the label is in the
same section as the function was afterall.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 20:39:00 +00:00
Chris Lattner
4c6741f707 use Mang->getSymbol() more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 20:37:38 +00:00
Devang Patel
001903485f Create SDDbgValue for dbg_value intrinsics and remember its connections with DAG nodes.
This is a work in progress. Patch by Dale Johannesen!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98568 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 19:15:44 +00:00
Chris Lattner
0220ba7995 Fix the case when a reference to an address taken BB is emitted in one
function, then the BB is RAUW'd before the definition is emitted.  There
are still two cases not being handled, but this should improve us back to
the situation before I touched anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 19:09:43 +00:00
Chris Lattner
88698f5dbc revert r98550, it isn't necessary or sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 18:42:01 +00:00
Devang Patel
90a48adf9c Emit dwarf variable info communicated by code generator through DBG_VALUE machine instructions.
This is a work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98556 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 18:33:46 +00:00
Chris Lattner
fc6e69bcb2 don't eliminate address-taken blocks here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 16:37:42 +00:00
Chris Lattner
ed7d10e100 SIGN_EXTEND from the same type as the dest is valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98548 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 16:15:56 +00:00
Chris Lattner
7fb5c2dbec sink the call to VT.getSizeInBits() down into its uses,
not all unary nodes necessarily have a simple result type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 16:05:15 +00:00
Chris Lattner
1f8008cf21 fix MCSectionELF to not leak memory, just like I did for MCSymbol.
MCSectionMachO is already fine (yay for fixed size arrays?),
MCSectionCOFF still leaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 06:23:52 +00:00
Chris Lattner
a833f6b061 remove dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 00:00:42 +00:00
Benjamin Kramer
1610d430be Remove pointless forward declaration, MSVC got confused by this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 22:00:28 +00:00
Duncan Sands
d2c817eff1 Turn calls to copysignl into an FCOPYSIGN node. Handle FCOPYSIGN nodes
with ppc_f128 type by having the type legalizer turn these back into a
call to copysignl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 21:08:40 +00:00
Evan Cheng
a8efe28a44 Rename SDDbgValue.h to SDNodeDbgValue.h for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 19:56:39 +00:00
Chris Lattner
c4a3f23b92 fix ShrinkDemandedOps to not leave dead nodes around,
fixing PR6607


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 19:46:02 +00:00
Chris Lattner
25e0ab9ae5 rewrite ShrinkDemandedOps to be faster and indent less,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 19:43:04 +00:00
Chris Lattner
552186dfd3 make -view-isel-dags print after the 'ShrinkDemandedOps' pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 19:27:55 +00:00
Anton Korobeynikov
927411b7ce Make default expansion for FP16 <-> FP32 nodes into libcalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98501 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:42:24 +00:00
Anton Korobeynikov
be5b032e4b Add DAG nodes to represent FP16 <-> FP32 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:42:15 +00:00
Chris Lattner
3b9d6216a4 fix AsmPrinter::GetBlockAddressSymbol to always return a unique
label instead of trying to form one based on the BB name (which
causes collisions if the name is empty).  This fixes PR6608


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 17:53:23 +00:00
Chris Lattner
63d7836267 get MMI out of the label uniquing business, just go to MCContext
to get unique assembler temporary labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:36:50 +00:00
Chris Lattner
8d9aaba84e don't use getDWLabel("label" anymore, always go through MMI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:18:13 +00:00
Chris Lattner
0397ada8ae remove now-dead code, all labels use MCSymbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:17:53 +00:00
Chris Lattner
25b68c6770 change SrcLineInfo to contain a label instead of a label ID.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:15:55 +00:00
Chris Lattner
2e9919a5e5 Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:12:40 +00:00
Chris Lattner
6ffcccab51 change the DBG_LABEL MachineInstr to always be created
with an MCSymbol instead of an immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 07:56:48 +00:00
Chris Lattner
9a38e67590 unbreak the build, grr symlinks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 07:36:49 +00:00
Chris Lattner
90f172aa80 Change this code to allocate temporary labels from mccontext,
not from MMI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 07:29:45 +00:00
Chris Lattner
aba9bcb9b6 switch GC_LABEL to use an MCSymbol operand instead of a label ID operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 07:27:07 +00:00
Chris Lattner
f14645cc64 Fix some EH failures on NNT I introduced in r98461
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 07:02:50 +00:00
Chris Lattner
21f9c8de53 fix a bug I introduced in r98459, causing some NNT failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 06:50:56 +00:00
Chris Lattner
7561d48095 change the LabelSDNode to be EHLabelSDNode and make it hold
an MCSymbol.  Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID.  Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 02:33:54 +00:00
Chris Lattner
18589de9b1 eliminate InvalidateLabel and LabelIDList from MMI and replace
them with a counter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 02:24:55 +00:00
Chris Lattner
b91306053d use Label->isDefined() instead of isLabelDeleted() now that we
consistently use MCSymbol and only call this predicate after
they should have been emitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 02:20:58 +00:00
Chris Lattner
1611273351 change EH related stuff (other than EH_LABEL) to use MCSymbol
instead of label ID's.  This cleans up and regularizes a bunch 
of code and makes way for future progress.

Unfortunately, this pointed out to me that JITDwarfEmitter.cpp
is largely copy and paste from DwarfException/MachineModuleInfo
and other places.  This is very sad and disturbing. :(

One major change here is that TidyLandingPads moved from being
called in DwarfException::BeginFunction to being called in
DwarfException::EndFunction.  There should not be any 
functionality change from doing this, but I'm not an EH expert.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 01:41:15 +00:00
Chris Lattner
1b2eb0e8a6 eliminate the now-unneeded context argument of MBB::getSymbol()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 21:04:28 +00:00
Chris Lattner
11d53c129f rearrange MCContext ownership. Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter.  Now MachineModuleInfo
creates it and owns it by value.  This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code.  This also allows MachineFunction to 
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 20:55:24 +00:00
Chris Lattner
72aaa3c798 add support for MCSymbols as operands to MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 08:14:18 +00:00
Chris Lattner
5e6cbe0eff simplify EmitFrameMoves to take BaseLabel in as a symbol
instead of as a stem+idx pair, simplify the "is a new 
location" check to use symbol comparison.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 08:05:25 +00:00
Chris Lattner
fb65807c34 factor some labels, simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 07:40:56 +00:00
Chris Lattner
206d61e62f various cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 07:26:18 +00:00
Chris Lattner
bc733f54c0 reimplement the string pool used for inlined function
entries to not thrash std::strings and MCSymbols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:17:42 +00:00
Chris Lattner
528a126d32 remove gone method, grr symlinks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:30:49 +00:00
Chris Lattner
deb0cba1ba inline the now-trivial implementation of GetGlobalValueSymbol into
some of its callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:09:07 +00:00
Chris Lattner
b87c305fa7 give Mangler access to TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 20:47:28 +00:00
Chris Lattner
73ff564d65 finally give Mangler a getSymbol method, which returns an MCSymbol
for a global instead of messing around with string buffers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:55:20 +00:00
Chris Lattner
0d941c15c0 remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:49:32 +00:00
Chris Lattner
5ef31a039d make the mangler take an MCContext instead of an MAI.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:44:54 +00:00
Chris Lattner
fdab14b105 remove MAI argument from createAsmStreamer since it
can get it from the context now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:28:53 +00:00
Chris Lattner
20e3280f3f fix a bug emitting .secrel32 that I introduced, PR6587, patch
by A.Mazur!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:10:35 +00:00
Jeffrey Yasskin
5c213dc78c Free DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness of
several fields to make it easier to figure out where bugs might be creeping in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 17:45:06 +00:00
Duncan Sands
0ac5d2d7ff Revert turning copysignl into a COPYSIGN node for the moment:
ppc calls copysignl with a 128 bit ppc long double, resulting
in a node that the type legalizer doesn't know how to expand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 17:41:34 +00:00
Duncan Sands
bb2f0c541c Now that it's supported, turn copysignl into a COPYSIGN node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 12:13:59 +00:00
Duncan Sands
5d54b4112d Fix PR6522: implement copysign expansion for x86 long double
(it seems that FreeBSD doesn't have copysignl).  Done by
removing a bunch of assumptions from the code.  This may also
help with sparc 128 bit floats.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 11:45:06 +00:00
Chris Lattner
b3e87b2262 fix PR6577, a bug in sdbuilder lowering select instructions
whose true value was not Val#0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 07:15:36 +00:00
Devang Patel
1b596e399b There is no need to create specification DIE for definitions at DIFile level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 23:44:52 +00:00
Jakob Stoklund Olesen
56698803d9 Extract methods from LocalRewriter::RewriteMBB bringing it down to 666 lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 23:04:34 +00:00
Chris Lattner
c18409aed8 change MCContext to always have an MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 22:53:35 +00:00
Chris Lattner
42263e2e40 fix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
where we used ot create an MCSymbol for ".".  Now emit an assembler
temporary label and reference it instead of "." textually.

rdar://7739457


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:55:20 +00:00
Dan Gohman
a257095ebb Remove getWidenVectorType, which is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:39:57 +00:00
Chris Lattner
3192d14076 rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol.  Change it to take an MCStreamer,
which is currently unused.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:41:58 +00:00
Evan Cheng
af1871fa6d In case of tail call size of Ins and InVals may not match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:38:18 +00:00
Jeffrey Yasskin
d0f393d46f Avoid leaking CompileUnits in DwarfDebug.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 18:29:55 +00:00
Richard Osborne
95da605e15 Add a new jump table encoding to indicate jump tables entries
are inside the function by the target at the point of use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 14:58:16 +00:00
Evan Cheng
826cbac2a0 The check for coalescing a virtual register to a physical register, e.g.
cl = EXTRACT_SUBREG reg1024, 1, is overly conservative. It should check
for overlaps of vr's live interval with the super registers of the
physical register (ECX in this case) and let JoinIntervals() handle checking
the coalescing feasibility against the physical register (cl in this case).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 08:20:21 +00:00
Daniel Dunbar
0193c0994b Remove dead include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 02:28:48 +00:00
Dale Johannesen
e68ea060c7 Fix debug_value handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 02:10:24 +00:00
Daniel Dunbar
1f3e445184 MC: Provide MCAssembler with a TargetAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:27 +00:00
Jakob Stoklund Olesen
2cb4202f07 VirtRegRewriter spring cleaning. No functional change.
Move methods out of line and M-x whitespace-cleanup.
Promote common method arguments to member variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:11:33 +00:00
Chris Lattner
f2f64e9063 fix PR6533 by updating the br(xor) code to remember the case
when it looked past a trunc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 23:46:44 +00:00
Dale Johannesen
e3b8533e71 Cosmetic: lengthen names and improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 23:37:24 +00:00
Bill Wendling
cebae36f57 Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that
indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:34:10 +00:00
Dale Johannesen
bfdf7f3852 Progress towards shepherding debug info through SelectionDAG.
No functional effect yet.  This is still evolving and should
not be viewed as final.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:13:47 +00:00
Dan Gohman
8f78e3c87d Fix another bitwidth calculation to handle vector types; based on a
patch by Micah Villmow for PR6572.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 21:04:53 +00:00
Dale Johannesen
2cd9ffef6e Fix another place where DEBUG_VALUE affected codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 19:57:56 +00:00
Dale Johannesen
a2f767b1a7 Fix a bug in DEBUG_VALUE handling Devang ran into.
I'll get this loop right yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 15:06:26 +00:00
Chris Lattner
09d53fecfc move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 07:20:42 +00:00
Dale Johannesen
c5cf227f3d This survived a bootstrap, so let's try 98104 again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 05:45:47 +00:00
Evan Cheng
fac4f1f181 Enable machine cse pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 03:07:41 +00:00
Chris Lattner
974c0fb404 mcize the rest of EH emission, only one more directive missing
for darwin/x86 to be completely mcized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:48:06 +00:00
Chris Lattner
49f618a1e4 add missing filename!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:29:31 +00:00
Chris Lattner
98cdab53c3 set the temporary bit on MCSymbols correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:25:11 +00:00
Evan Cheng
2938a00f29 Add a couple more heuristics to neuter machine cse some more.
1. Be careful with cse "cheap" expressions. e.g. constant materialization. Only cse them when the common expression is local or in a direct predecessor. We don't want cse of cheap instruction causing other expressions to be spilled.
2. Watch out for the case where the expression doesn't itself uses a virtual register. e.g. lea of frame object. If the common expression itself is used by copies (common for passing addresses to function calls), don't perform the cse. Since these expressions do not use a register, it creates a live range but doesn't close any, we want to be very careful with increasing register pressure.

Note these are heuristics so machine cse doesn't make register allocator unhappy. Once we have proper live range splitting and re-materialization support in place, these should be evaluated again.

Now machine cse is almost always a win on llvm nightly tests on x86 and x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:12:03 +00:00
Chris Lattner
d85fc6e0b1 inline away a form of IsPCRelative, eliminating the
dead IsPCRel argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 01:17:49 +00:00
Chris Lattner
188a87da79 add some fixme's for MCizing. EH still has a few things that
need to be MCized, but the last debug info thing are LEB and
cygwin specific (which the MC api doesn't support yet) and
one specific form of EmitReference which I'll tackle next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 01:04:13 +00:00
Jim Grosbach
7c617b5e53 Clear up the last (famous last words) frame index value reuse issues for Thumb1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:13:42 +00:00
Dale Johannesen
7dda453410 Speculatively revert 98104; could be what's causing crashes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:11:34 +00:00
Chris Lattner
90e4af7b9d mcize uses of PrintRelDirective and eliminate it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:09:21 +00:00
Chris Lattner
4aeaca4053 inline the bool form of PrintRelDirective away, leaving just the unsigned form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:54:52 +00:00
Chris Lattner
233f52be36 eliminate EOL, adding all comments with the OutStreamer.AddComment
method.  With this, comments should end up on the same lines as the .byte
directives (for example) and we now get no output with:

$ llc CodeGen/X86/2009-02-12-DebugInfoVLA.ll -o - -filetype=null -asm-verbose

woot.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:52:58 +00:00
Dale Johannesen
7f876967c0 Ever more complicated DEBUG_VALUE fixes for branch folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:52:37 +00:00
Chris Lattner
0d9d70f013 eliminate a bunch of \n's that are being printed to O. Next up is to kill
off "EOL".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:38:23 +00:00
Chris Lattner
fcdae492ea convert the non-"ispcrel" case of EmitReference to MC,
significant debug info testcases are now all going through
MCStreamer, though they print a lot of extraneous newlines to "O".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:19:15 +00:00
Jim Grosbach
dff4b4c5a7 Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 21:45:49 +00:00
Evan Cheng
bfc9999563 Allow more cross-rc coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 06:38:17 +00:00
Chris Lattner
c608784dc8 reapply r98035:
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:54:43 +00:00
Chris Lattner
6c7dfc0463 add some extra checks. I'm not sure why, but this does unbreak a
failure remaining on mainline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:48:35 +00:00
Evan Cheng
7ef1840d9e Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:04:38 +00:00
Jakob Stoklund Olesen
1552cccc76 Don't do illegal cross-class coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 03:56:06 +00:00
Evan Cheng
31f94c7c22 - Make the machine cse dumb coalescer (as opposed to the more awesome simple
coalescer) handle sub-register classes.
- Add heuristics to avoid non-profitable cse. Given the current lack of live
  range splitting, avoid cse when an expression has PHI use and the would be
  new use is in a BB where the expression wasn't already being used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 03:21:12 +00:00
Eric Christopher
ee6414cf04 Speculatively revert r98035. It appears to have caused a set of buildbot
failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:36:31 +00:00
Dan Gohman
19b3826d0f Attempt to make this debug output meaningful, both in the case of
multibyte opcodes and in the case of multiple scopes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:15:05 +00:00
Chris Lattner
1e233f510c Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:08:02 +00:00
Chris Lattner
b7db733482 change DbgScope to keep track of the start/end label as MCSymbol*
now that the dependence on ID is removed from MMI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:58:53 +00:00
Chris Lattner
5b9062cb3a remove a useless optimization: now that label replacement never
happens, the start/end of a scope can never be the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:52:43 +00:00
Chris Lattner
a34ec2290f strength reduce MMI::MappedLabel to MMI::isLabelDeleted,
and add a FIXME about how we are eventually going to zap this
lookup table once mc world domination is complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:51:43 +00:00
Chris Lattner
b2cc1a39f7 mcstreamerize AsmPrinter::printLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:02:30 +00:00
Jakob Stoklund Olesen
35071a0847 Disable physical register coalescing when the number of live ranges for the
physreg becomes ridiculously high.

std::upper_bound may be log(N), but for sufficiently large live intervals, it
becomes log(N)*cachemiss = a long long time.

This patch improves coalescer time by 4500x for a function with 20000
function calls. The generated code is different, but not significantly worse -
the allocator hints are almost as good as physreg coalescing anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:59:48 +00:00
Chris Lattner
6cde3e6e99 add a EmitSymbolValue convenience method to MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98017 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:39:24 +00:00
Chris Lattner
6ed0f90dac make InlineInfoLabels hold MCSymbol*'s, avoiding
recomputation of the labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:31:02 +00:00
Chris Lattner
b9dc5f7b58 mc'ize the last use of PrintLabelName and eliminate PrintLabelName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:26:09 +00:00
Chris Lattner
ef6b14f51c eliminate an argument from PrintRelDirective, sinking
the one special case into EmitSectionOffset.  MCize
the non-special case in EmitSectionOffset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:17:58 +00:00
Dan Gohman
8f03d75161 Print the correct index in the "match failed at index" message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:07:36 +00:00
Chris Lattner
b67d69df65 remove the suffix form of PrintLabelName, which was only
used for 'flavor'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:00:57 +00:00
Chris Lattner
c3421bb805 now that the debug and eh emitters use a common .set counter,
we can eliminate "flavor".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:00:15 +00:00
Chris Lattner
0d50c7620d move .set generation out of DwarfPrinter into AsmPrinter and
MCize it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:58:37 +00:00
Evan Cheng
5196018d9c Don't waste time trying to CSE labels, phis, inline asm. Definitely avoid cse implicit-def for obvious performance reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:49:12 +00:00
Evan Cheng
6c3b8ac6c9 Restrict machine cse to really trivial coalescing. Leave the heavy lifting to a real coalescer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:28:08 +00:00
Chris Lattner
57578766aa simplify EmitSectionOffset to always use .set if it is
available, the only thing this affects is that we produce
.set in one case we didn't before, which shouldn't harm
anything.  Make EmitSectionOffset call EmitDifference
instead of duplicating it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:23:25 +00:00
Chris Lattner
effa868d38 Remove a version of EmitDifference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:02:59 +00:00
Chris Lattner
dd8187a3e9 eliminate a form of PrintLabelName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:52:49 +00:00
Chris Lattner
326861c4c8 remove another form of EmitReference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:50:36 +00:00
Chris Lattner
c7249da2e9 eliminate the non-MCSymbol versions of EmitReference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:47:57 +00:00
Chris Lattner
f829eef8fa mc'ize EmitLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:44:40 +00:00
Chris Lattner
4faf59af82 merge DIEObjectLabel and DIEDwarfLabel into DIELabel.
Yes, DIE you fiendish labels, die all of you.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:31:46 +00:00
Chris Lattner
b98b1bf432 elimiante the DWLabel class, using MCSymbol instead. Start
switching some stuff over to passing around MCSymbol* instead
of stem+ID.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:23:36 +00:00
Devang Patel
77bf295dbb Derive DIType from DIScope. This simplifies getContext() where for members the context is a type. This also eliminates need of CompileUnitMaps maintained by dwarf writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:02:50 +00:00
Devang Patel
3c91b05d2b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:52:55 +00:00
Devang Patel
0ef3fa6aab Revert r97947.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 19:20:38 +00:00
Devang Patel
d8cc5d5256 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:25:48 +00:00
Dale Johannesen
fab4a25d46 Add Order to SDDbgValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 05:39:50 +00:00
Dale Johannesen
84839daa59 Fix dbg value handling in tail merging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 05:38:13 +00:00
Douglas Gregor
1ddcf35b68 Revert r97917, which was causing Clang Debug self-host failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 02:58:37 +00:00
Jeffrey Yasskin
9467f0e3bd Roll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 17:10:13 +00:00
Chris Lattner
acee647b13 Use Other as a sentinel instead of iAny.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:45:08 +00:00
Jeffrey Yasskin
8c42ca9374 _2_ gcc crashes, ah, ah, ah...
(Rolling back r97906.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:16:49 +00:00
Jeffrey Yasskin
f7399bf929 Avoid leaking CompileUnits and DbgScopes from DwarfDebug. Leaks found by Valgrind!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 06:55:35 +00:00
Chris Lattner
98f15d27cd tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 04:28:09 +00:00
Evan Cheng
6cc1aeaad2 Don't update physical register def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 01:14:19 +00:00
Dale Johannesen
06a26637da Add some new bits of debug info handling. No
functional change yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 00:03:23 +00:00
Dan Gohman
0fa9d1d901 Reapply r97778 and r97779, enabled only for unsigned i64 to f64
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 00:00:55 +00:00
Charles Davis
314fef6127 Don't emit global symbols into the (__TEXT,__ustring) section on Darwin. This
is a workaround for <rdar://problem/7672401/> (which I filed).

This let's us build Wine on Darwin, and it gets the Qt build there a little bit
further (so Doug says).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 22:28:45 +00:00
Jakob Stoklund Olesen
53e000bac3 Better handling of dead super registers in LiveVariables. We used to do this:
CALL ... %RAX<imp-def>
   ... [not using %RAX]
   %EAX = ..., %RAX<imp-use, kill>
   RET %EAX<imp-use,kill>

Now we do this:

   CALL ... %RAX<imp-def, dead>
   ... [not using %RAX]
   %EAX = ...
   RET %EAX<imp-use,kill>

By not artificially keeping %RAX alive, we lower register pressure a bit.

The correct number of instructions for 2008-08-05-SpillerBug.ll is obviously
55, anybody can see that. Sheesh.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 21:49:17 +00:00
Jakob Stoklund Olesen
a76e816844 We don't really care about correct register liveness information after the
post-ra scheduler has run. Disable the verifier checks that late in the game.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 21:49:13 +00:00
Jakob Stoklund Olesen
580bba2b0d Avoid creating bad PHI instructions when BR is being const-folded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 21:49:10 +00:00
Chris Lattner
18fdabadca Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag.  That flag in turn was used by an
already-selected adde which turned into an ADC32ri8 which
used a selected load which was chained to the load we
folded.  This flag use caused us to form a cycle.  Fix
this by not ignoring chains in IsLegalToFold even in
cases where the isel thinks it can.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 06:19:13 +00:00
Chris Lattner
9bbcd5ee5b inline a small function with one call site.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 05:49:45 +00:00
Dan Gohman
b6b343d77a Revert r97778 and r97779. They're somehow breaking llvm-gcc builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:40:23 +00:00
Dan Gohman
808ab341b4 Fix these constants to be more portable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:13:10 +00:00
Dan Gohman
cfa7ca1997 Rewrite i64-to-f64 conversion using an algorithm which handles
rounding correctly. This implementation is a generalization of
the x86_64 code in compiler-rt.

This fixes rdar://7683708.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:00:46 +00:00
Dale Johannesen
b0812f114b Fix some more places where dbg_value affected codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:02:59 +00:00
Jeffrey Yasskin
e8cfa63e4e Fix memcheck-found leaks: one false positive from using new[], and one true
positive where pointers would be leaked on llvm_shutdown.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 22:15:01 +00:00
Jim Grosbach
b58a59b3c1 For SJLJ exception handling, make sure that all calls that are not marked
as nounwind are marked with a -1 call-site value. This is necessary to, for
example, correctly process exceptions thrown from within an "unexpected"
execption handler (see SingleSource/Regression/C++/EH/expection_spec_test.cpp).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97757 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 22:07:46 +00:00
Evan Cheng
c46e293e94 Run machine licm before machine cse to avoid messing up licm opportunities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:28:09 +00:00
Evan Cheng
a5f32cb3d3 Avoid cse load instructions unless they are known to be invariant loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:18:08 +00:00
Chris Lattner
c19ae9d91d add a statistic for # times fastisel fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:46:56 +00:00
Dan Gohman
ba72b0c4e1 Fix a typo Duncan noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:11:28 +00:00
Evan Cheng
9763f709e2 Rename -machine-cse to -enable-machine-cse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 02:08:04 +00:00
Evan Cheng
b3958e8032 Look ahead a bit to determine if a physical register def that is not marked dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:33:55 +00:00
Chris Lattner
57bf8a483e change the new isel matcher to emit ComplexPattern matches
as the very last thing before node emission.  This should
dramatically reduce the number of times we do 'MatchAddress'
on X86, speeding up compile time.  This also improves comments
in the tables and shrinks the table a bit, now down to 
80506 bytes for x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:23:08 +00:00
Dan Gohman
6900a39d28 Fix more code to work properly with vector operands. Based on
a patch my Micah Villmow for PR6465.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:23:16 +00:00
Chris Lattner
2c4afd1d8e inline CannotYetSelectIntrinsic into CannotYetSelect and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:21:16 +00:00
Evan Cheng
67bda7215b Fix a logic error. An instruction that has a live physical register def cannot be CSE'ed, but it *can* be used to replace a common subexpression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:59:08 +00:00
Evan Cheng
a92dced4a1 Remove PHINodeTraits and use MachineInstrExpressionTrait instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:55:49 +00:00
Evan Cheng
67eaa08f2b Move MachineInstrExpressionTrait::getHashValue() out of line so it can skip over only virtual register defs. This matches what isEqual() is doing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:37:30 +00:00
Evan Cheng
05bdcbb1ae Re-apply r97667 but with a little bit of thought put into the patch. This implements a special DenseMapInfo trait for DenseMap<MachineInstr*> that compare the value of the MachineInstr rather than the pointer value. Since the hashing and equality test functions ignore defs it's useful for doing CSE kind optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:27:36 +00:00
Dan Gohman
319dfa3fb3 Revert 97667. It broke a bunch of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 22:40:03 +00:00
Evan Cheng
34cdf6edf5 Fix funky indentation and add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:54:14 +00:00
Evan Cheng
a054ae02fd Move DenseMapInfo for MachineInstr* to MachineInstr.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:47:16 +00:00
Dan Gohman
a72d2a210c Fix a bug in SelectionDAG's ReplaceAllUsesWith in the case where
CSE and recursive RAUW calls delete a node from the use list,
invalidating the use list iterator. There's currently no known
way to reproduce this in an unmodified LLVM, however there's no
fundamental reason why a SelectionDAG couldn't be formed which
would trigger this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:33:37 +00:00
Evan Cheng
16b48b8a05 Machine CSE work in progress. It's doing some CSE now. But implicit def of physical registers are getting in the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:20:05 +00:00
Evan Cheng
1423c70b8f Add MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:18:38 +00:00
Bill Wendling
fec8657351 Revert...
--- Reverse-merging r97592 into '.':
U    lib/CodeGen/TargetLoweringObjectFileImpl.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 19:31:05 +00:00
Chris Lattner
da828e3c8c add some of the more obscure predicate types to the
Scope accelerator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 07:46:25 +00:00
Chris Lattner
f1b7c7d476 speed up scope node processing: if the first element of a scope
entry we're about to process is obviously going to fail, don't
bother pushing a scope only to have it immediately be popped.
This avoids a lot of scope stack traffic in common cases.

Unfortunately, this requires duplicating some of the predicate
dispatch.  To avoid duplicating the actual logic I pulled each
predicate out to its own static function which gets used in
both places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 07:31:15 +00:00
Chris Lattner
cfe2eab744 introduce a new SwitchTypeMatcher node (which is analogous to
SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it.  This
speeds up selection, particularly for X86 which has lots of 
variants of instructions with only type differences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 06:28:15 +00:00
Evan Cheng
6ba9554988 Work in progress. Finding some cse now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 02:48:20 +00:00
Bill Wendling
32f9eb2bc3 Use APInt instead of zext value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:58:01 +00:00
Evan Cheng
506049f29f - Change MachineInstr::isIdenticalTo to take a new option that determines whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality.
- Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:44:33 +00:00
Evan Cheng
d89347cb49 Add an option to enable machine cse (it's not doing anything yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:38:35 +00:00
Bill Wendling
7d9f2b93a3 This test case:
long test(long x) { return (x & 123124) | 3; }

Currently compiles to:

_test:
        orl     $3, %edi
        movq    %rdi, %rax
        andq    $123127, %rax
        ret

This is because instruction and DAG combiners canonicalize

  (or (and x, C), D) -> (and (or, D), (C | D))

However, this is only profitable if (C & D) != 0. It gets in the way of the
3-addressification because the input bits are known to be zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 00:35:56 +00:00
Chris Lattner
d1b7382983 Fix some issues in WalkChainUsers dealing with
CopyToReg/CopyFromReg/INLINEASM.  These are annoying because
they have the same opcode before an after isel.  Fix this by
setting their NodeID to -1 to indicate that they are selected,
just like what automatically happens when selecting things that
end up being machine nodes.

With that done, give IsLegalToFold a new flag that causes it to
ignore chains.  This lets the HandleMergeInputChains routine be
the one place that validates chains after a match is successful,
enabling the new hotness in chain processing.  This smarter
chain processing eliminates the need for "PreprocessRMW" in the
X86 and MSP430 backends and enables MSP to start matching it's
multiple mem operand instructions more aggressively.

I currently #if out the dead code in the X86 backend and MSP 
backend, I'll remove it for real in a follow-on patch.

The testcase changes are:
  test/CodeGen/X86/sse3.ll: we generate better code
  test/CodeGen/X86/store_op_load_fold2.ll: PreprocessRMW was 
      miscompiling this before, we now generate correct code
      Convert it to filecheck while I'm at it.
  test/CodeGen/MSP430/Inst16mm.ll: Add a testcase for mem/mem
      folding to make anton happy. :)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 22:20:06 +00:00
Bill Wendling
d556155afd Okay. One last attempt:
Place the LSDA into the TEXT section on Mach-O. This saves space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 21:50:35 +00:00
Chris Lattner
00592ec857 run HandleMergeInputChains even if we only have one input chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 19:34:59 +00:00
Evan Cheng
ac1abde05b Swap parameters of isSafeToMove and isSafeToReMat for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 19:03:01 +00:00
Evan Cheng
c5bbba1e49 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 19:02:27 +00:00
Devang Patel
1eac3e7d1e Fix grammar.
Thanks Duncan!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97572 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 17:58:15 +00:00
Chris Lattner
82dd3d38d9 Fix the xfail I added a couple of patches back. The issue
was that we weren't properly handling the case when interior
nodes of a matched pattern become dead after updating chain
and flag uses.  Now we handle this explicitly in 
UpdateChainsAndFlags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 07:50:03 +00:00
Chris Lattner
61c97f6932 I was confused about this, it turns out that MorphNodeTo
*does* delete ex-operands that become dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 07:14:49 +00:00
Chris Lattner
3ff1e4db78 factor node morphing out to its own helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 06:55:04 +00:00
Chris Lattner
7c306da505 Sink InstructionSelect() out of each target into SDISel, and rename it
DoInstructionSelection.  Inline "SelectRoot" into it from DAGISelHeader.
Sink some other stuff out of DAGISelHeader into SDISel.

Eliminate the various 'Indent' stuff from various targets, which dates
to when isel was recursive.

 17 files changed, 114 insertions(+), 430 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 06:34:30 +00:00
Eric Christopher
7b2c9e6a30 Add file to CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:49:43 +00:00
Evan Cheng
c6fe333688 Add skeleton of a machine level cse pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:38:24 +00:00
Chris Lattner
6183fbd726 Use the right induction variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:37:23 +00:00
Chris Lattner
c6d7ad3c7d Rewrite chain handling validation and input TokenFactor handling
stuff now that we don't care about emulating the old broken 
behavior of the old isel.  This eliminates the 
'CheckChainCompatible' check (along with IsChainCompatible) which
did an incorrect and inefficient scan *up* the chain nodes which
happened as the pattern was being formed and does the validation
at the end in HandleMergeInputChains when it forms a structural 
pattern.  This scans "down" the graph, which means that it is
quickly bounded by nodes already selected.  This also handles
token factors that get "trapped" in the dag.

Removing the CheckChainCompatible nodes also shrinks the 
generated tables by about 6K for X86 (down to 83K).

There are two pieces remaining before I can nuke PreprocessRMW:
1. I xfailed a test because we're now producing worse code in a 
   case that has nothing to do with the change: it turns out that
   our use of MorphNodeTo will leave dead nodes in the graph
   which (depending on how the graph is walked) end up causing
   bogus uses of chains and blocking matches.  This is really 
   bad for other reasons, so I'll fix this in a follow-up patch.

2. CheckFoldableChainNode needs to be improved to handle the TF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:22:10 +00:00
Dan Gohman
5b870aff81 Fix several places to handle vector operands properly.
Based on a patch by Micah Villmow for PR6438.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:14:38 +00:00
Bill Wendling
46ada19645 Remove dead parameter passing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 01:55:18 +00:00
Devang Patel
6b506cbce0 Constructors and operators for anonymous aggregates does not names. Do not force empty AT_name attribute in such cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 01:26:20 +00:00
Chris Lattner
319ef94030 remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 00:40:26 +00:00
Chris Lattner
6b30792d2d refactor some code out of OPC_EmitMergeInputChains into a
new helper function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97525 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 00:00:03 +00:00
Chris Lattner
df51247725 remove all but one version of SelectionDAG::MorphNodeTo
(the most general) the others are dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:20:05 +00:00
Jakob Stoklund Olesen
e5d90416ee Use methods to determine if a LiveInterval is spillable.
Don't accidentally produce unspillable intervals for deeply nested loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 20:59:38 +00:00
Chris Lattner
7390eebd49 Accelerate isel dispatch for tables that start with a top-level
OPC_SwitchOpcode to use a table lookup instead of having to go
through the interpreter for this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 18:47:11 +00:00
Dan Gohman
042919c0c5 Fix optimization of ISD::TRUNCATE on vector operands. Based on a patch
by Micah Villmow for PR6335.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 17:59:21 +00:00
Chris Lattner
7d892d6e6d some trivial microoptimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 07:43:08 +00:00
Chris Lattner
fa342faef9 eliminate the CheckMultiOpcodeMatcher code and have each
ComplexPattern at the root be generated multiple times, once
for each opcode they are part of.  This encourages factoring
because the opcode checks get treated just like everything
else in the matcher.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 07:17:40 +00:00
Chris Lattner
eb66921adb add a new OPC_SwitchOpcode which is semantically equivalent
to a scope where every child starts with a CheckOpcode, but
executes more efficiently.  Enhance DAGISelMatcherOpt to 
form it.

This also fixes a bug in CheckOpcode: apparently the SDNodeInfo
objects are not pointer comparable, we have to compare the
enum name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 06:59:22 +00:00
Chris Lattner
14df8dc680 eliminate GetInt1/2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:38:43 +00:00
Chris Lattner
2a49d57d2d hoist the new isel interpreter out of DAGISelHeader.h
(which gets #included into the middle of each 
target's DAGISel class) into a .cpp file where it is
only compiled once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:37:22 +00:00
Chris Lattner
21221e357c enhance the new isel to handle the 'node already exists'
case of MorphNodeTo directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 21:36:14 +00:00
Chris Lattner
25d5837889 simplify this code, return only ever has zero or one operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 18:53:13 +00:00
Dan Gohman
6ac33b4533 Don't try to replace physical registers when doing CSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 01:33:43 +00:00
Dan Gohman
8772f5041c Add a flag to addPassesToEmit* to disable the Verifier pass run
after LSR, so that clients can opt in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 00:41:59 +00:00
Dan Gohman
a363a9b71a Don't unconditionally suppress hoisting of instructions with implicit
defs or uses. The regular def and use checking below covers them, and
can be more precise. It's safe to hoist an instruction with a dead
implicit def if the register isn't live into the loop header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97352 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 00:08:44 +00:00
Evan Cheng
2c755ba12a Re-apply 97040 with fix. This survives a ppc self-host llvm-gcc bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 07:36:59 +00:00
Bill Wendling
4933a373a7 The TType is always absptr on Mach-O...at least for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 01:05:51 +00:00
Bill Wendling
1869ac8b71 A much cleaner (and less code!) way of inserting the correct amount of padding
for alignment into the LSDA. If the TType base offset is emitted, then put the
padding there. Otherwise, put it in the call site table length. There will be no
conflict between the two sites when placing the padding in one place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 22:17:52 +00:00
Bill Wendling
6507eca124 Comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:31:01 +00:00
Jakob Stoklund Olesen
243296690e Use the right floating point load/store instructions in PPCInstrInfo::foldMemoryOperandImpl().
The PowerPC floating point registers can represent both f32 and f64 via the
two register classes F4RC and F8RC. F8RC is considered a subclass of F4RC to
allow cross-class coalescing. This coalescing only affects whether registers
are spilled as f32 or f64.

Spill slots must be accessed with load/store instructions corresponding to the
class of the spilled register. PPCInstrInfo::foldMemoryOperandImpl was looking
at the instruction opcode which is wrong.

X86 has similar floating point register classes, but doesn't try to fold
memory operands, so there is no problem there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:09:24 +00:00
Jakob Stoklund Olesen
66df66c5fb Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:09:20 +00:00