Commit Graph

4955 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
26207e5bf1 Introduce the TargetInstrInfo::KILL machine instruction and get rid of the
unused DECLARE instruction.

KILL is not yet used anywhere, it will replace TargetInstrInfo::IMPLICIT_DEF
in the places where IMPLICIT_DEF is just used to alter liveness of physical
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 20:32:26 +00:00
Dan Gohman
c76909abfe Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 20:36:54 +00:00
Dan Gohman
602b0c8c17 Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:54:59 +00:00
Chris Lattner
fe03dbeaa3 unconditionally request MMI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 21:45:57 +00:00
Dan Gohman
8a55ce4a39 Rename several variables from EVT to more descriptive names, now that EVT
is also the name of their type, as declarations like "EVT EVT" look
really odd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 21:02:20 +00:00
Dan Gohman
00133a7d52 Fix X86's unfoldMemoryOperand to properly handle MachineMemOperands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 01:29:41 +00:00
Dan Gohman
4a0b3e170d Add support for rematerializing FsFLD0SS and FsFLD0SD as constant-pool
loads in order to reduce register pressure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 18:30:38 +00:00
Dan Gohman
670e53977b Recognize SSE min and max opportunities in even more cases.
And fix a bug with the behavior of min/max instructions formed from
fcmp uge comparisons.

Also, use FiniteOnlyFPMath() for this code instead of UnsafeFPMath,
as it is more specific.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 18:03:22 +00:00
Dan Gohman
b29ff977d1 Fix the offset values for these memoperands. For frame objects, the
PseudoSourceValue already effectively represents the offset from the
frame base, so the actual offset should not be added to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 17:58:09 +00:00
Chris Lattner
705764110c remove a temporary hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:47:59 +00:00
Chris Lattner
0dc32ea0ef rename X86ATTAsmPrinter.cpp -> X86AsmPrinter.cpp likewise the .h file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:41:30 +00:00
Chris Lattner
d4db0fc154 move target registry stuff to X86ATTAsmPrinter.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:39:06 +00:00
Chris Lattner
547a685ff9 simplify this now that createX86CodePrinterPass is trivial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:37:51 +00:00
Chris Lattner
3859638b5f rename X86ATTAsmPrinter class -> X86AsmPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:35:34 +00:00
Chris Lattner
71c7ace54f remove the asmstring, it is now dead. Improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:32:00 +00:00
Chris Lattner
b3c8547cb8 kill off printPICLabel now, it's specialness is handled by
the MachineInstr ->MCInst lowering process, not in the 
asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:28:26 +00:00
Chris Lattner
ed13cd203f delete X86IntelAsmPrinter! Now -x86-asm-syntax just switches
the instruction syntax, not the entire asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:25:17 +00:00
Chris Lattner
e895c61515 Add an intel syntax MCInstPrinter implementation. You can now
transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:17:49 +00:00
Chris Lattner
67c6b6ee71 split random COFF asmprinter state out to X86COFFMachineModuleInfo.h.
Make dllexport directives come out in determinstic order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:45:52 +00:00
Daniel Dunbar
a279bc3da5 Tabs -> spaces, and remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 02:20:51 +00:00
Evan Cheng
431f775bab Fix funky comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-19 10:09:15 +00:00
Evan Cheng
ce31910eae Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-19 09:51:03 +00:00
Evan Cheng
fb2e752e41 Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 21:02:19 +00:00
Shantonu Sen
558b79a399 Fix cmake build, which has a different -I that
causes the "../foo" to not find the file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 20:35:59 +00:00
Chris Lattner
228252f981 Make a new X8632_MachoTargetObjectFile TLOF implementation whose
getSymbolForDwarfGlobalReference is smart enough to know that it 
needs to register the stub it references with MachineModuleInfoMachO,
so that it gets emitted at the end of the file.

Move stub emission from X86ATTAsmPrinter::doFinalization to the
new X86ATTAsmPrinter::EmitEndOfAsmFile asmprinter hook.  The important
thing here is that EmitEndOfAsmFile is called *after* the ehframes are
emitted, so we get all the stubs.

This allows us to remove a gross hack from the asmprinter where it would
"just know" that it needed to output stubs for personality functions.
Now this is all driven from a consistent interface.

The testcase change is just reordering the expected output now that the
stubs come out after the ehframe instead of before.

This also unblocks other changes that Bill wants to make.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 20:22:52 +00:00
Dan Gohman
e220c4b3d9 Add support for using the FLAGS result of or, xor, and and instructions
on x86, to avoid explicit test instructions. A few existing tests changed
due to arbitrary register allocation differences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:59:53 +00:00
Sean Callanan
a2dc2825fc Added RCL and RCR (rotate left and right with a
carry bit) instructions to the Intel instruction
tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:35:23 +00:00
Chris Lattner
ad2b6fc2b9 This file can need access to the X86 instruction enums when the table exceeds 32-bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 18:08:55 +00:00
Chris Lattner
8609c7c931 pass machinemoduleinfo down into getSymbolForDwarfGlobalReference,
currently unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 18:49:52 +00:00
Sean Callanan
9a86f10875 Added the LODS (load byte into register, usually
as part string parsing) instructions to the Intel
instruction tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 22:59:28 +00:00
Sean Callanan
358f1ef765 Added the LAR (load segment access rights)
instructions to the Intel instruction tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 21:55:34 +00:00
Sean Callanan
7e6d727c9b Added the LOOP family of instructions to the Intel
instruction tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 21:50:07 +00:00
Sean Callanan
d2125a03af Added an alternate form of register-register CMP
to the Intel instruction tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 21:11:23 +00:00
Kevin Enderby
0d6cd00dbe Fix incorrect assert that should be a user error for code like 'mov $0, %%eax'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 17:18:29 +00:00
Chris Lattner
dc62ea0f1c move FnStubs/GVSTubs/HiddenGVStub handling out of the X86 asmprinter
and use MachineModuleInfoMachO instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 06:25:03 +00:00
Chris Lattner
29cf5557b2 revert a hunk of r82018 that wasn't supposed to go in yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 06:04:53 +00:00
Chris Lattner
686cb3df6a add a new MachineModuleInfoMachO class, which is the per-module
stuff common across all macho targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 06:03:48 +00:00
Chris Lattner
e1e533437a tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 05:25:43 +00:00
Chris Lattner
a76e3fc131 rearrange X86ATTAsmPrinter::doFinalization, making a scan of
the global variable list only happen for COFF targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 05:20:33 +00:00
Chris Lattner
4edd187ddd remove the AsmPrinter::printMCInst hook hack now that
we have MCInstPrinter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 04:57:15 +00:00
Shantonu Sen
11189220e6 fix cmake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 04:44:00 +00:00
Nate Begeman
206a357684 Do not try and sink a load whose chain result has more than one use, when
trying to create RMW opportunities in the x86 backend.  This can cause a 
cycle to appear in the graph, since the other uses may eventually feed into
the TokenFactor we are sinking the load below.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 03:20:46 +00:00
Sean Callanan
8d70854dd8 Added the ENTER instruction, which sets up a stack
frame, to the Intel instruction tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 02:57:13 +00:00
Sean Callanan
13cf8e9b82 Added the definitions for one-bit left shifts to
the Intel instruction tables.

The patterns will stay blank because ADD reg, reg
is faster, but having the encoding available is
useful for the disassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 02:28:43 +00:00
Sean Callanan
60b995418f Removed a few instructions that were already
covered by other definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:54:38 +00:00
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
Sean Callanan
5ab9403bc2 Added a variety of floating-point and SSE instructions.
All of these do not have patterns (they're for the
disassembler).

Many of the floating-point instructions will probably
be rolled into definitions that have patterns, and may
eventually be superseded by mdefs.  So I put them
together and left a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:13:52 +00:00
Sean Callanan
356aed540c Added far return instructions (that is, returns to
code in other segments) to the Intel instruction
tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 23:37:51 +00:00
Sean Callanan
62c28e3f91 Updated comments per Eli's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 21:43:27 +00:00
Sean Callanan
37be5903a6 Added register-to-register ADD instructions to the
Intel tables, where the source operand is
specified by the R/M field and the destination
operand by the Reg field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:53:57 +00:00