Commit Graph

1926 Commits

Author SHA1 Message Date
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 e849956de8 search unittests.
llvm-svn: 79884
2009-08-24 03:44:02 +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
Douglas Gregor 11eaeef9d3 Don't install FileCheck or FileUpdate
llvm-svn: 79820
2009-08-23 04:39:38 +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
Anton Korobeynikov 9a232f46a8 Add lowering of ARM 4-element shuffles to multiple instructios via perfectshuffle-generated table.
llvm-svn: 79624
2009-08-21 12:41:24 +00:00
Anton Korobeynikov 84e24388cd Add simple cost model to perfect shuffle. Currently we're doing just greedy search for cost instead of (proper) dynamic programming approach.
llvm-svn: 79623
2009-08-21 12:41:03 +00:00
Anton Korobeynikov b539e06f28 Whitespace cleanup
llvm-svn: 79618
2009-08-21 12:39:38 +00:00
Evan Cheng 1105cbc270 Even more Apple style build horribleness.
llvm-svn: 79299
2009-08-18 00:56:17 +00:00
Anton Korobeynikov 90e17e787f The attached patches attempt to fix cross builds. For example, if you
try to use i686-darwin to build for arm-eabi, you'll quickly run into
several false assumptions that the target OS must be the same as the
host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to
help builds like "make check" and the test-suite able to cross
compile. Along the way a target of *-unknown-eabi is defined as
"Freestanding" so that TARGET_OS checks have something to work with.

Patch by Sandeep Patel!

llvm-svn: 79296
2009-08-18 00:40:33 +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
Chris Lattner 107c21eafc when emitting errors about CHECK-NEXT directives, show the line that the
CHECK-NEXT is on.

llvm-svn: 79164
2009-08-16 02:22:31 +00:00
Chris Lattner da108b4ed4 implement support for CHECK-NEXT: in filecheck.
llvm-svn: 79123
2009-08-15 18:32:21 +00:00
Chris Lattner 10f10ced3f simplify some code.
llvm-svn: 79121
2009-08-15 18:00:42 +00:00
Chris Lattner 6a7b917e32 rewrite FindStringInBuffer to use an explicit loop instead of
trying to wrap strstr which is just too inconvenient.  Make it
use a StringRef to avoid ".c_str()" calls.

llvm-svn: 79120
2009-08-15 17:53:12 +00:00
Chris Lattner 26cccfe1bc Instead of using an std::pair, use a custom struct.
llvm-svn: 79119
2009-08-15 17:41:04 +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
Bob Wilson 781797f586 Fix a few more places in TableGen that need to handle EVT::vAny types.
llvm-svn: 78643
2009-08-11 05:03:38 +00:00
Daniel Dunbar bb98db2d21 llvm-mc/AsmParser: Implement automatic classification of RegisterClass operands.
- This drops us to 123 ambiguous instructions (previously ~500) on X86.

llvm-svn: 78636
2009-08-11 02:59:53 +00:00
Bob Wilson 2cd5da8300 Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.

llvm-svn: 78631
2009-08-11 01:14:02 +00:00
Owen Anderson 53aa7a960c Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Daniel Dunbar aeb1feb67a llvm-mc/AsmParser: Allow .td users to redefine the names of the methods to call
on target specific operands for testing class membership and converting to
MCInst operands.

llvm-svn: 78597
2009-08-10 21:00:45 +00:00
Daniel Dunbar 26454f794c llvm-mc/AsmMatcher: Remove some code which has been obsoleted by move to
explicit parser match classes.

llvm-svn: 78588
2009-08-10 19:08:50 +00:00
Daniel Dunbar 17410a4b92 llvm-mc/AsmMatcher: Change assembler parser match classes to their own record
structure.

llvm-svn: 78581
2009-08-10 18:41:10 +00:00
Daniel Dunbar 2587b61533 llvm-mc/AsmParser: Check for matches with super classes when matching
instruction operands.

llvm-svn: 78565
2009-08-10 16:05:47 +00:00
Daniel Dunbar d9631912cf llvm-mc/AsmParser: Fix thinko in ClassInfo::operator<.
llvm-svn: 78533
2009-08-09 08:23:23 +00:00
Daniel Dunbar e0891c2109 llvm-mc/AsmParser: Add hack to ignore Int_* and *_Int instructions for now, to
make it easier to see interesting ambiguities.
 - Also, check that user doesn't try to redefine the super class. This is a wart
   in the current design, in that assembler match classes aren't explicitly
   declared somewhere (so there isn't a unique place to declare the super
   class). This should probably be fixed.

llvm-svn: 78532
2009-08-09 08:19:00 +00:00
Daniel Dunbar 8e33cb2de1 llvm-mc/AsmParser: Implement user defined super classes.
- We can now discriminate SUB32ri8 from SUB32ri, for example.

llvm-svn: 78530
2009-08-09 07:20:21 +00:00
Daniel Dunbar f573b563e1 llvm-mc/AsmParser: Separate instruction ordering for ambiguity detection.
- We want the ordering operation to be simple, since we run it on every
   match. The old ordering is also not a strict weak ordering when there are
   ambiguities, which makes MSVC unhappy.

 - While we are at it, detect all ambiguities instead of just the adjacent
   ones. There are actually 655, for X86.

llvm-svn: 78526
2009-08-09 06:05:33 +00:00
Daniel Dunbar c32aa060bd llvm-mc/AsmParser: Define match classes in the .td file.
-2 FIXMEs.

llvm-svn: 78523
2009-08-09 05:18:30 +00:00
Daniel Dunbar 3239f020eb llvm-mc/AsmParser: Sketch infrastructure for ordering instructions & detecting
ambiguities.
 - Currently there are 483 ambiguities to resolve. :)

llvm-svn: 78522
2009-08-09 04:00:06 +00:00
Chris Lattner b7ff9e84be fix edito
llvm-svn: 78520
2009-08-08 23:43:55 +00:00
Daniel Dunbar d8c822f180 llvm-mc/AsmMatcher: Tweak string matcher (missed a newline).
llvm-svn: 78518
2009-08-08 23:43:16 +00:00
Daniel Dunbar 5478125143 llvm-mc/AsmMatcher: Tweak string matcher.
- Track whether we need to insert an explicit 'break'.

 - Invert conditional when matching a single prefix to reduce
   nesting/bracing/breaking.

 - wc -l of X86GenAsmMatcher.inc decreased by 10%. :)

llvm-svn: 78513
2009-08-08 22:57:25 +00:00
Daniel Dunbar 66f4f54e8a llvm-mc/AsmMatcher: Switch token matching to use the new string matcher.
Also, redefined MatchRegisterName to just return the register value or a
sentinel, to simplify the generated code.

llvm-svn: 78504
2009-08-08 21:22:41 +00:00