Commit Graph

5559 Commits

Author SHA1 Message Date
Chris Lattner
166604e6ce shrink 4-byte branches to 1-byte branches when lowering from
MachineInstr -> MCInst.  This is what the assembler backend wants,
it relaxes from smaller to larger things.  This fixes rdar://7750815


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 17:04:18 +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
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
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
Evan Cheng
f48ef03655 Do not force indirect tailcall through fixed registers: eax, r11. Add support to allow loads to be folded to tail call instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 03:48:46 +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
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
Daniel Dunbar
bf2d4c034d X86_64: Fix encoding for the rest of the 64i32 instructions too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 22:57:53 +00:00
Daniel Dunbar
859c9dc867 X86: Fix ADD64i32 encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 22:49:39 +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
Daniel Dunbar
96e2cec9c7 MC/X86_64: Fix matching of leaq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 19:31:44 +00:00
Daniel Dunbar
989ac72981 MC/X86_64: Fix matching of callq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 19:31:38 +00:00
Chris Lattner
464bee191f simplify some overly general code. The stack always grows down on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 08:04:35 +00:00
Chris Lattner
1bd1e6db1d switch to the text section at the start of the .s file for darwin/x86
targets.  This is a temporary hack for the .o file writer that Daniel
wants :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:10:00 +00:00
Daniel Dunbar
d5e7705a05 MC/X86: Add temporary hack to match shrl $1,%eax correctly, to support testing
other functionality on 403.gcc compiled at -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 00:47:29 +00:00
Jeffrey Yasskin
150ae11976 Fix LLVM build when the user specifies CPPFLAGS on the make command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:42:14 +00:00
Chris Lattner
70501b72cf remove special case code that isn't needed anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:21:19 +00:00
Chris Lattner
d62f1b4168 inline GetGlobalValueSymbol into the rest its callers and
remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:19:23 +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
b6fc4a5650 eliminate the X86 version of GetGlobalValueSymbol, allowing
it to be non-virtual and soon disappear.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:06:41 +00:00
Chris Lattner
08d04f591f prune #includes, this file should be removed pending hte cygwin stub issue being resolved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:04:31 +00:00
Chris Lattner
8a29fa6e02 move fastcall/stdcall mangling up into Mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:03:47 +00:00
Daniel Dunbar
a0e36d55c4 MC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:00:45 +00:00
Chris Lattner
3f185a72cd make DecorateCygMingName a static method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 20:43:52 +00:00
Chris Lattner
9c59268197 minor tidying, only do work if a function is
actually X86_StdCall or X86_FastCall.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:48:03 +00:00
Chris Lattner
c9747c05d1 eliminate the string form of DecorateCygMingName
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:42:40 +00:00
Chris Lattner
355670bf0f remove the FnArgWords cache to make way for future changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:31:03 +00:00
Bill Wendling
ec041eba38 Add a beta-test for placing the LSDA into the TEXT section on X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:20:40 +00:00
Devang Patel
b45fb90b20 Fix llc crash on invalid input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:18:30 +00:00
Chris Lattner
1c95488880 Remove some dead code. This method only gets called on
definitions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:14:18 +00:00
Chris Lattner
2341f6ccf8 use Mang->getSymbol instead of duplicating the logic, reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 19:04:14 +00:00
Chris Lattner
b0f129a5d9 simplify code to use OutContext.GetOrCreateTemporarySymbol with
no arguments instead of having to come up with a unique name.
This also makes the code less fragile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:47:50 +00:00
Benjamin Kramer
018cbd5ddf Use StringRef::substr instead of std::string::substr to avoid using a free'd
string temporary. This should fix PR6590.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 13:54:59 +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
Bill Wendling
c6678b0014 revert r98270.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:50:31 +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
55282267e1 Bad bad bug. x86 force indirect tail call address into eax when it's meant to force it into a call preserved register instead. Change it to ecx for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 18:49:14 +00:00
Eric Christopher
f27805b5c5 Have fast-isel understand llvm.objectsize. Update testcase for slightly
different codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 06:20:22 +00:00
Daniel Dunbar
f82f4490b1 MC: Sketch initial MCAsmLayout class, which encapsulates the current layout of an assembly file. The MCAsmLayout is also available for use by MCExpr::EvaluateAs{Absolute,Relocatable}, to allow target specific hooks and "absolutizing" of symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 02:28:59 +00:00
Daniel Dunbar
23ac7c78e4 MC: Sketch some TargetAsmBackend hooks we are going to need.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:21 +00:00
Daniel Dunbar
6c27f5e574 MC: Provide the target triple to AsmBackend constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:16 +00:00
Chris Lattner
2968943463 add support, testcases, and dox for the new GHC calling
convention.  Patch by David Terei!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:22:57 +00:00
Chris Lattner
bcc5cb4061 Work around a bug in the openbsd assembler on i386,
which doesn't support .quad correctly because it is
"really really old".  PR6528.

Yet another reason the mc assembler should take over ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:06:19 +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
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
Daniel Dunbar
f291be3159 MC/X86: Rename alternate spellings of ADD{8,16,32} and mark as "code gen only" so they don't get selected by the asm matcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:50:46 +00:00
Daniel Dunbar
1e8ee89c21 MC/X86: Rename alternate spellings of CMP{8,16,32} and mark as "code gen only" so they don't get selected by the asm matcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:50:40 +00:00