Commit Graph

7902 Commits

Author SHA1 Message Date
Chris Lattner
8c6ed05157 Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:46:41 +00:00
Chris Lattner
25d812bd7d inline AsmPrinter::getCurrentFunctionEHName into its only caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 00:35:39 +00:00
Chris Lattner
1c90c6f1c5 Eliminate AsmPrinter::EmitExternalGlobal, inlining its (now)
one implementation into its one caller.  This eliminates a totally
awesome and gratuitous hack where we casted a Function* to 
GlobalVariable*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 00:17:39 +00:00
Chris Lattner
334fd1f259 eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
it into all of its call sites and simplifying them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 00:08:41 +00:00
Chris Lattner
bfd1e50c4f remove some horrible MAI hooks which fortunately turn out to be always empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 23:11:32 +00:00
Chris Lattner
f60d3eb186 strength reduce a call to PrintRelDirective(true).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 22:58:35 +00:00
Chris Lattner
a70e2e3d48 add hooks to hang target-specific goop off MachineModuleInfo,
move MachineFunctionInfo virtual method out of line to give it
a home.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 22:44:26 +00:00
Nate Begeman
40fe16fada Do not add the SVOffset to the Node CSE ID. The same pointer argument cannot have different
SVOffsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 22:30:11 +00:00
Eric Christopher
ec26bf7d44 Expand on comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 21:56:46 +00:00
Daniel Dunbar
504f9a61e6 Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:31:12 +00:00
Nate Begeman
101b25c028 Better solution for tracking both the original alignment of the access, and the current alignment based
on the source value offset.  This avoids increasing the size of mem nodes. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 19:05:41 +00:00
Evan Cheng
3f85549f4d Another try at early partial coalescing. Identity phi source copies (their sources are defined by phi join def) are coalesced. And the phi join copy is backward copy propagated into the other copies.
Still miscompiling some tests. :-(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 06:45:16 +00:00
Nate Begeman
71524d716a Remove incorrect CSE code from r81813.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:38:09 +00:00
Nate Begeman
b6aef5c867 Substantially speed up combiner-aa in the following ways:
1. Switch from an std::set to a SmallPtrSet for visited chain nodes.
2. Do not force the recursive flattening of token factor nodes, regardless of
   use count.
3. Immediately process newly created TokenFactor nodes.

Also, improve combiner-aa by teaching it that loads to non-overlapping offsets
of relatively aligned objects cannot alias.

These changes result in a >5x speedup for combiner-aa on most testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:18:30 +00:00
Nate Begeman
9cae7053c0 Teach the legalizer to propagate the original alignment of loads and store when
it splits them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:14:28 +00:00
Nate Begeman
e6798372ea Add an "original alignment" field to load and store nodes. This enables the
DAG Combiner to disambiguate chains for loads and stores of types which are
 broken up by the Legalizer into smaller pieces.  


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:13:12 +00:00
Evan Cheng
752195e3c6 Add early coalescing to liveintervals. This is work in progress and is known to miscompute some tests. Read it at your own rish, I have aged 10 year while writing this.
The gist of this is if source of some of the copies that feed into a phi join is defined by the phi join, we'd like to eliminate them. However, if any of the non-identity source overlaps the live interval of the phi join then the coalescer won't be able to coalesce them. The early coalescer's job is to eliminate the identity copies by partially-coalescing the two live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 21:33:42 +00:00
Bill Wendling
43488710a8 Pull the creation of the "RewindFunction" function out of the loop. It's only
created once, so shouldn't be stuck in the middle of the loop. Also early exit
if there are no uses of UnwindInst in the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 20:52:37 +00:00
Chris Lattner
662316c997 PIC16 does allow colon after MBB labels, simplify EmitBasicBlockStart.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 03:15:54 +00:00
Chris Lattner
90edac0e8b Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 03:02:37 +00:00
Chris Lattner
6a6570a312 kill off the last use of TRI::AsmName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 22:42:03 +00:00
Chris Lattner
f806c23a9a eliminate an extraneous use of TRI::getAsmName in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:48:37 +00:00
Chris Lattner
7c30191393 remove MAI::JumpTableSpecialLabelPrefix now that MAI
has real information about linker private linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:02:16 +00:00
Chris Lattner
70a54c07a0 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:25:37 +00:00
Chris Lattner
325d3dcfe4 convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 17:14:04 +00:00
Chris Lattner
7cb384dcca devirtualize AsmPrinter::printBasicBlockLabel since it is never overridden.
Move GetMBBSymbol up to AsmPrinter and make printBasicBlockLabel use it so that
we only have one place that decides what to name bb labels.  Hopefully various
clients of printBasicBlockLabel can start using GetMBBSymbol instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 23:02:08 +00:00
Lang Hames
35f291d2c5 Moved some more index operations over to LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 03:34:03 +00:00
Evan Cheng
b24222cd7d Remove -new-coalescer-heuristic. It's not useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 02:14:41 +00:00
Evan Cheng
217311130d 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 02:01:07 +00:00
Caroline Tice
c6f9d62eae Don't generate Dwarf line table entries for source line 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 18:25:54 +00:00
Duncan Sands
597f9797fd Fix PR4948 (and a leak): by not destroying the DwarfException
object, the timer it creates was not being deleted.  Since the
timer belonged to a static timer group, the timer group would
be destroyed on shutdown, and would notice and complain that
not all timers it contained were destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 17:24:29 +00:00
Dan Gohman
4a215a13c3 Make fast-isel try ISD::FNEG before resorting to bitcasts and xors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:36:43 +00:00
Dan Gohman
5e5abb77fe Reapply r81171 with a fix: don't try to use i64 when it
isn't legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:34:46 +00:00
Bob Wilson
92ad363f58 Don't swap the operands of a subtraction when trying to create a
post-decrement load/store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:09:31 +00:00
Bill Wendling
73c5a61725 Exit early if exception handling isn't supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 18:28:06 +00:00
Bill Wendling
28275fdf02 Comment and whitespace cleanups. No intentional functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 06:50:01 +00:00
Bill Wendling
a2f6449a57 Revert part of my r81424 patch. I removed what looked like superfluous padding
from the exception tables. However, Duncan explained why it's a can of worms to
do it the GCC way. I went back to doing it the LLVM way and added Duncan's
explanation so that I don't do this again in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 06:27:16 +00:00
Bill Wendling
fe220285b5 Don't hardcode the TType format size. In fact, rework the code so that it's more
like what GCC outputs. The mysterious code to insert padding wasn't in GCC at
all. I modified the TType base offset code to calculate the offset like GCC
does, though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 02:07:37 +00:00
Bill Wendling
43e484fbcf Remove the "#if 0" that Noone loved. It wasn't really necessary, because the
code within it was the same inside and out. There's still a problem of the
TypeInfoSize should be the size of the TType format encoding (at least that's
what GCC thinks it should be).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 01:12:47 +00:00
Bob Wilson
2a16e6b22c Revert r81171 which was causing pr4927.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:49:22 +00:00
Bill Wendling
d1a5b37a62 Pull check for SJLJ EH into a boolean and use that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:17:04 +00:00
Bill Wendling
40121bccbe Use the SizeOfEncodedValue function instead of magic variables for the
sizeof(DW_EH_PE_udata4).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:13:16 +00:00
Bill Wendling
bb3e29932d Add helpful comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:04:48 +00:00
Bill Wendling
52783c63a1 Believe it or not, this is a simplification. :-)
Basically, this patch is working towards removing the hard-coded values that are
output for the CIE. In particular, the CIE augmentation and the CIE augmentation
size. Both of these should be calculated. In the process, I was able to make a
bunch of code simpler.

The encodings for the personality, LSDA, and FDE in the CIE are still not
correct. They should be generated either from target-specific callbacks (blech!)
or grokked from first-principles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:56:55 +00:00
Chris Lattner
c5ea263a23 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:14:36 +00:00
Bill Wendling
0734d35044 Use the EOL that takes the encoding and translates it into DWARF-English.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 21:26:19 +00:00
Bill Wendling
7b09a6c622 Early exit from function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 21:08:12 +00:00
Bill Wendling
b4049fe8cb Small amount of code clean-up: Don't use ".size()" when not necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 21:06:24 +00:00
Lang Hames
9647994e09 Removed static qualifier from a few index related methods. These methods may require a LiveIntervals instance in future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 20:14:17 +00:00
Andreas Neustifter
ff5dfdff56 Preserve ProfileInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 17:53:39 +00:00
Dan Gohman
607a0508ba When widening a vector load, use the correct chain. This fixes PR4891.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 14:22:57 +00:00
Chris Lattner
d842962e27 change selectiondag to add the sign extended versions of immediate operands
to instructions instead of zero extended ones.  This makes the asmprinter
print signed values more consistently.  This apparently only really affects
the X86 backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 23:05:44 +00:00
Nicolas Geoffray
22f35ace45 When emitting a label for a PostCall safe point, the machine
instruction to insert before can be end(). getDebugLoc on
end() returns an invalid value, therefore use the debug
loc of the call instruction, and give it to InsertLabel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 07:39:27 +00:00
Evan Cheng
8bdb0de2bd When remat'ing and destination virtual register has a sub-register index. Make sure the sub-register class matches the register class of the remat'ed instruction definition register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:39:07 +00:00
Dan Gohman
ed48caf5e7 Fix an abort on a store of an empty struct member. getValue returns
null in the case of an empty struct, so don't try to call getNumValues
on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 01:44:02 +00:00
Dan Gohman
fd06aa7c07 Fix a thinko: When lowering fneg with xor, bitcast the operands
from floating-point to integer first, and bitcast the result
back to floating-point. Previously, this test was passing by
falling back to SelectionDAG lowering. The resulting code isn't
as nice, but it's correct and CodeGen now stays on the fast path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:47:14 +00:00
Duncan Sands
5149852975 Simplify. Testing shows that this is not equivalent to BBI = CR.CaseBB + 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 18:03:32 +00:00
Duncan Sands
18f13c66bf Mark more constants unsigned, as warned about by icc (#68).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:56:52 +00:00
Duncan Sands
c2d98bc0d6 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:41:19 +00:00
Benjamin Kramer
be441c0f34 It's a bool, so treat it like one. Fixes a MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:10:17 +00:00
Duncan Sands
b7c5bdf843 Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 08:33:48 +00:00
Devang Patel
bd1d6a8ce1 Detect VLAs.
Do not use DenseMap operator[] because it inserts new entry if lookup fails. Use find() to check an entry in a DenseMap first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05 00:34:14 +00:00
Devang Patel
905cf5e0bd Ignore malformed global variable debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 23:59:07 +00:00
Lang Hames
8651125d28 Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 20:41:11 +00:00
Duncan Sands
70327dabb4 Use delete[] to match new[] (found by valgrind).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 11:59:43 +00:00
Evan Cheng
030a0a0cdb Run branch folding if if-converter make some transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 07:47:40 +00:00
Evan Cheng
e93909185f Fix comment for consistency sake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 07:46:30 +00:00
Eric Christopher
82f149d794 If there's a calling convention attach it to the rewind function call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 01:14:14 +00:00
Evan Cheng
b3c2742896 Funky indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:54:22 +00:00
Dan Gohman
3d45a853db LLVM currently represents floating-point negation as -0.0 - x. Fix
FastISel to recognize this pattern and emit a floating-point
negation using xor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:53:57 +00:00
David Goodwin
4f7228f851 Don't crash when target has no itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:48:51 +00:00
David Goodwin
5e41178a6e Create our own block initializer for kill fixups as the scheduling one wasn't doing the right thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:15:25 +00:00
Bob Wilson
cc80df92c1 Overhaul the TwoAddressInstructionPass to simplify the logic, especially
for the complicated case where one register is tied to multiple destinations.
This avoids the extra scan of instruction operands that was introduced by
my recent change.  I also pulled some code out into a separate
TryInstructionTransform method, added more comments, and renamed some
variables.

Besides all those changes, this takes care of a FIXME in the code regarding
an assumption about there being a single tied use of a register when
converting to a 3-address form.  I'm not aware of cases where that assumption
is violated, but the code now only attempts to transform an instruction,
either by commuting its operands or by converting to a 3-address form,
for the simple case where there is a single pair of tied operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:58:42 +00:00
Dan Gohman
8d44b28bc6 Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:34:31 +00:00
Lang Hames
3f2f3f5341 Fixed a test that ensures the LocalRewriter does not attempt to
avoid reloads by reusing clobbered registers.

This was causing issues in 256.bzip2 when compiled with PIC for
a while (starting at r78217), though the problem has since been masked. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 02:52:02 +00:00
Bob Wilson
d163917fd8 Rearrange code to eliminate redundancy and avoid gotos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 16:35:35 +00:00
Sandeep Patel
65c3c8f323 Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 08:44:58 +00:00
Bob Wilson
86f7cd786e Avoid calling removeVirtualRegisterKilled which iterates over the operands
to find the kill, since we already have the operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 23:18:46 +00:00
Bob Wilson
326f43812c Refactor some code into separate functions. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:51:08 +00:00
Bob Wilson
c08f5fe882 Move use of LV inside condition that guards for null LV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:19:00 +00:00
Daniel Dunbar
31e2c7b4c1 Remove Offset from ExternalSybmol MachineOperands, this is unused (and at least partly unsupported, in X86 encoding at least).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:06:46 +00:00
Bruno Cardoso Lopes
0bb83860f9 Fix ELF Writter related memory leaks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:25:52 +00:00
Jim Grosbach
ee793a6c19 reduce size of SmallString to something more reasonable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:55:08 +00:00
Jim Grosbach
c40d9f9bae Use raw_ostream instead of sstream
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:49:12 +00:00
David Goodwin
1f15228398 Add hidden flags to allow binary search of post-RA scheduling errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:34:03 +00:00
Jim Grosbach
33668c0f1a revert inadvertant change from previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:19:13 +00:00
Jim Grosbach
a01d34676f Simply LSDA lable emission to use a direct special-case output instead of
EmitLabel()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 16:43:35 +00:00
Bob Wilson
71124f698b Fix pr4843: When an instruction has multiple destination registers that are
tied to different source registers, the TwoAddressInstructionPass needs to
be smarter.  Change it to check before replacing a source register whether
that source register is tied to a different destination register, and if so,
defer handling it until a subsequent iteration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:18:40 +00:00
Jim Grosbach
3fb2b1ede3 Clean up LSDA name generation and use for SJLJ exception handling. This
makes an eggregious hack somewhat more palatable. Bringing the LSDA forward
and making it a GV available for reference would be even better, but is
beyond the scope of what I'm looking to solve at this point.

Objective C++ code could generate function names that broke the previous
scheme. This fixes that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 01:57:56 +00:00
Devang Patel
82dfc0cd8c Subprogram is a scope. Derive DISubprogram from DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:47:13 +00:00
Devang Patel
5e005d814f Rename DIBlock as DILexicalBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:00:15 +00:00
Bob Wilson
4344979ba9 Use early exit and reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:54:55 +00:00
Bob Wilson
d4034b2825 If the tied registers are already the same, there is no need to change
them.  Move the code to make that change inside the conditional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:54:16 +00:00
Caroline Tice
dc8f6049d1 Add flag to mark structs for Apple Block "byref" variables; also add code to
modify the type and location debug information for these variables to match the
programmer's expectations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:19:37 +00:00
David Goodwin
a3251db21a Don't mark a register live at an undef use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:47:02 +00:00
Devang Patel
6ceea33c5e Simplify isDerivedType() and other predicate interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 18:49:10 +00:00
Bill Wendling
049e98d641 Output a hex value, because all of the others are hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 18:26:48 +00:00
Duncan Sands
c69d74a5d4 Revert commit 80428. It completely broke exception
handling on x86-32 linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:45:16 +00:00
Jim Grosbach
0bb61c56bc PR4747
Shared landing pads run into trouble with SJLJ, as the dispatch table is
mapped to call sites, and merging the pads will throw that off. There needs
to be a one-to-one mapping of landing pad exception table entries to invoke
call points.

Detecting the shared pad during lowering of SJLJ info insn't sufficient, as
the dispatch function may still need separate destinations to properly
handle phi-nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 01:35:03 +00:00
Bill Wendling
8ed211406a Nuke moribund "std::string" version of EOL(..., Encoding).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 00:28:57 +00:00