Commit Graph

1307 Commits

Author SHA1 Message Date
Mikhail Glushenkov 0bd47063ab Omit the 'out_file_index != -1' check when possible.
llvm-svn: 83619
2009-10-09 05:45:21 +00:00
Mikhail Glushenkov 182765004e Input files should go before all other options.
Important, for example, when calling 'gcc a.o b.o c.o -lD -lE -lF'.

llvm-svn: 83524
2009-10-08 04:40:08 +00:00
Evan Cheng 46668e09be Add instruction flags: hasExtraSrcRegAllocReq and hasExtraDefRegAllocReq. When
set, these flags indicate the instructions source / def operands have special
register allocation requirement that are not captured in their register classes.
Post-allocation passes (e.g. post-alloc scheduler) should not change their
allocations. e.g. ARM::LDRD require the two definitions to be allocated
even / odd register pair.

llvm-svn: 83196
2009-10-01 08:21:18 +00:00
Jakob Stoklund Olesen dc9efe8078 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.

llvm-svn: 83006
2009-09-28 20:32:26 +00:00
Mikhail Glushenkov efc9763468 Add a way to query the number of input files.
llvm-svn: 82957
2009-09-28 01:16:42 +00:00
Mikhail Glushenkov 1766617386 A bit prettier formatting.
llvm-svn: 82955
2009-09-28 01:15:44 +00:00
Dan Gohman 48b185d6f7 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.

llvm-svn: 82794
2009-09-25 20:36:54 +00:00
Dan Gohman 32f71d714b 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.

llvm-svn: 82790
2009-09-25 18:54:59 +00:00
David Goodwin bf97147a7e Make the end-of-itinerary mark explicit. Some cleanup.
llvm-svn: 82709
2009-09-24 20:22:50 +00:00
Mikhail Glushenkov fdd0a2fb40 Use raw_ostream::indent instead of passing strings.
llvm-svn: 82456
2009-09-21 15:53:44 +00:00
Chris Lattner 42bb0c1f8f convert some stuff to StringRef to avoid temporary std::strings.
llvm-svn: 82244
2009-09-18 18:31:37 +00:00
Chris Lattner bf1a769dcb add a comment.
llvm-svn: 82236
2009-09-18 18:10:19 +00:00
Chris Lattner f3f93aea75 slightly increase prettiness.
llvm-svn: 81742
2009-09-14 01:27:50 +00:00
Chris Lattner a7e8ae4521 emit the register table as a massive string to avoid relocations.
llvm-svn: 81741
2009-09-14 01:26:18 +00:00
Chris Lattner 971aad136c move StringToOffsetTable out to its own header.
llvm-svn: 81740
2009-09-14 01:19:16 +00:00
Chris Lattner b47ed61f26 factor string table generation out to its own class. This changes
the encoding of the AsmStrs table saving a byte or two.

llvm-svn: 81739
2009-09-14 01:16:36 +00:00
Chris Lattner d0a3f194a6 eliminate the TargetRegisterDesc::AsmName field, the asmprinters now have this table.
llvm-svn: 81728
2009-09-13 22:45:04 +00:00
Chris Lattner ad10b3be3e the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.

llvm-svn: 81711
2009-09-13 20:19:22 +00:00
Chris Lattner 06c5eed9e9 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.

llvm-svn: 81707
2009-09-13 20:08:00 +00:00
Owen Anderson 598467916d Eliminate some unnecessary implicit constructors in generated DAG ISel code.
Partial fix for PR4946.

llvm-svn: 81518
2009-09-11 09:01:57 +00:00
Chris Lattner 82bea72032 PHI nodes can never reach the asmprinter, assert and die instead of printing
out an illegal "PHINODE" instruction.

llvm-svn: 81495
2009-09-11 00:41:15 +00:00
Mikhail Glushenkov c1e23592ec Distinguish between 'empty' and empty DAG marker.
llvm-svn: 81448
2009-09-10 16:22:02 +00:00
Mikhail Glushenkov 7b047b9c81 Add a logical 'not' operator to llvmc's TableGen dialect.
llvm-svn: 81447
2009-09-10 16:21:38 +00:00
Chris Lattner 321bc99a74 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.

llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Chris Lattner 5333ec33b3 Fix a subtle bug in "return;" generation which caused us to miss
a return in one case.  Instead of sprinking return handling code
throughout the asmprinter generator, just treat it like any other
normal statement.

llvm-svn: 81395
2009-09-09 23:09:29 +00:00
Chris Lattner 716a8c92d0 hoist the call to processDebugLoc out of the generated
asm printer into the "printInstruction" routine.  This
fixes a problem where the experimental asmprinter would
drop debug labels in some cases, and fixes issues on ppc/xcore
where pseudo instructions like "mr" didn't get debug locs properly.

It is annoying that this moves the call from one place into each
target, but a future set of more invasive refactorings will fix
that problem.

llvm-svn: 81377
2009-09-09 20:34:59 +00:00
Duncan Sands 2fbeaf084f Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81106
2009-09-06 08:33:48 +00:00
Bob Wilson 57b946c94b PR4795: Remove EEVT::isFP, isInt and isVec types used by TableGen's type
inferencing.  As far as I can tell, these are equivalent to the existing
MVT::fAny, iAny and vAny types, and having both of them makes it harder
to reason about and modify the type inferencing code.

The specific problem in PR4795 occurs when updating a vAny type to be fAny
or iAny, or vice versa.  Both iAny and fAny include vector types -- they
intersect with the set of types represented by vAny.  When merging them,
choose fAny/iAny to represent the intersection.  This is not perfect, since
fAny/iAny also include scalar types, but it is good enough for TableGen's
type inferencing.

llvm-svn: 80423
2009-08-29 05:53:25 +00:00
Bob Wilson 904d4c71d5 Fix bad length argument to substr calls. Apparently I'm the first one to
attempt more than 2 constraints on an instruction.

llvm-svn: 80169
2009-08-26 22:50:39 +00:00
Dan Gohman 61a8796ddb Make LLVM command-line tools overwrite their output files without -f.
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".

Add a -f option to llvm-extract and llvm-link, for consistency.

Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.

Update Makefiles and documentation accordingly.

llvm-svn: 79990
2009-08-25 15:34:52 +00:00
Chris Lattner 06fa176862 prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.

llvm-svn: 79885
2009-08-24 03:52:50 +00:00
Chris Lattner c521f54198 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Benjamin Kramer c2dbd5d671 Try to fix MSVC build after r79846.
llvm-svn: 79850
2009-08-23 10:39:21 +00:00
Daniel Dunbar ced008152f Fix non-determinism in DAGISel emitter.
- This manifested as non-determinism in the .inc output in rare cases (when two
   distinct patterns ended up being equivalent, which is rather rare). That
   meant the pattern matching was non-deterministic, which could eventually mean
   the code generator selected different instructions based on the arch.

 - It's probably worth making the DAGISel ensure a total ordering (or force the
   user to), but the simple fix here is to totally order the Record* maps based
   on a unique ID.

 - PR4672, PR4711.

Yay:
--
ddunbar@giles:~$ cat ~/llvm.obj.64/lib/Target/*/*.inc | shasum
d1099ff34b21459a5a3e7021c225c080e6017ece  -
ddunbar@giles:~$ cat ~/llvm.obj.ppc/lib/Target/*/*.inc | shasum
d1099ff34b21459a5a3e7021c225c080e6017ece  -
--

llvm-svn: 79846
2009-08-23 09:47:37 +00:00
Chris Lattner 1362602eb2 Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Chris Lattner 34822f6ec7 remove some DOUTs
llvm-svn: 79821
2009-08-23 04:44:11 +00:00
Chris Lattner 9e6f1f160a Change raw_fd_ostream to take flags as an optional bitmask
instead of as two bools.  Use this to add a F_Append flag
which has the obvious behavior.

Other unrelated changes conflated into this patch:

1. REmove EH stuff from llvm-dis and llvm-as, the try blocks
   are dead.
2. Simplify the filename inference code in llvm-as/llvm-dis,
   because raw_fd_ostream does the right thing with '-'.
3. Switch machine verifier to use raw_ostream instead of ostream
   (Which is the thing that needed append in the first place).

llvm-svn: 79807
2009-08-23 02:51:22 +00:00
Devang Patel 0939595711 Record variable debug info at ISel time directly.
llvm-svn: 79742
2009-08-22 17:12:53 +00:00
David Goodwin d813cbfe72 Extend the instruction itinerary model to include the ability to indicate the def and use cycle for each operand. This additional information is optional, so existing itineraries do not need to be changed.
llvm-svn: 79247
2009-08-17 16:02:57 +00:00
Chris Lattner ee97b8b11c the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Bob Wilson f7e587fd53 Add a new "SDTCisVec" SDTypeConstraint. This complements the vAny type.
There have been a few times where I've wanted this but ended up leaving the
operand type unconstrained.  It is easy to add this now and should help
catch errors in the future.

llvm-svn: 78849
2009-08-12 22:30:59 +00:00
Dan Gohman 1432ef864e This void is implicit in C++.
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
David Goodwin b369ee4c48 Enhance the InstrStage object to enable the specification of an Itinerary with overlapping stages. The default is to maintain the current behavior that the "next" stage immediately follows the previous one.
llvm-svn: 78827
2009-08-12 18:31:53 +00:00
Owen Anderson 117c9e8497 Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first.
llvm-svn: 78759
2009-08-12 00:36:31 +00:00
Daniel Dunbar 3fb754af06 llvm-mc/AsmParser: Match hard coded registers (e.g. 'shldl %cl, %eax, %eax')
We now match all of 403.gcc (as emitted by clang). :)

llvm-svn: 78750
2009-08-11 23:23:44 +00:00
Daniel Dunbar c4f8ea4ccb Add 'isCodeGenOnly' bit to Instruction .td records.
- Used to mark fake instructions which don't correspond to an actual machine
   instruction (or are duplicates of a real instruction). This is to be used for
   "special cases" in the .td files, which should be ignored by things like the
   assembler and disassembler. We still need a good solution to handle pervasive
   duplication, like with the Int_ instructions.

 - Set the bit on fake "mov 0" style instructions, which allows turning an
   assembler matcher warning into a hard error.

 - -2 FIXMEs.

llvm-svn: 78731
2009-08-11 22:17:52 +00:00
Daniel Dunbar e431871851 llvm-mc/AsmParser: Allow target to specific a comment delimiter, which will be
used to strip hard coded comments out of .td assembly strings.

llvm-svn: 78716
2009-08-11 20:59:47 +00:00
Owen Anderson 9f94459d24 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.

llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Daniel Dunbar 34c8791ff0 llvm-mc/AsmMatcher: Fix two thinkos in determining whether two classes are
related.

llvm-svn: 78706
2009-08-11 20:10:07 +00:00