Commit Graph

116 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
6f36fa981a Write llvm-tblgen backends as functions instead of sub-classes.
The TableGenBackend base class doesn't do much, and will be removed
completely soon.

Patch by Sean Silva!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158311 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-11 15:37:55 +00:00
Andrew Trick
0076ad7eeb Sched itinerary fix: Avoid static initializers.
This fixes an accidental dependence on static initialization order that I introduced yesterday.

Thank you Lang!!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08 18:25:47 +00:00
Andrew Trick
fc992996f7 misched: Added MultiIssueItineraries.
This allows a subtarget to explicitly specify the issue width and
other properties without providing pipeline stage details for every
instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 03:44:40 +00:00
Jakob Stoklund Olesen
ac1ed44d95 Don't use enums larger than 1 << 31 for target features.
Patch by Andy Zhang!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147491 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 23:04:28 +00:00
Sebastian Pop
464f3a332f use space star instead of star space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 17:34:16 +00:00
Anshuman Dasgupta
dc81e5da27 Add a deterministic finite automaton based packetizer for VLIW architectures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 21:10:21 +00:00
Benjamin Kramer
1a2f9886a2 Move various generated tables into read-only memory, fixing up const correctness along the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-22 16:50:00 +00:00
Peter Collingbourne
7c78888887 Move TableGen's parser and entry point into a library
This is the first step towards splitting LLVM and Clang's tblgen executables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 16:41:13 +00:00
NAKAMURA Takumi
20722b6cda Eliminate "const" from extern const to fix breakeage since r135184 on msvc.
MSVC decorates (and distinguishes) "const" in mangler. It brought linkage error between "extern const" declarations and definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 12:50:21 +00:00
Evan Cheng
c60f9b7523 Next round of MC refactoring. This patch factor MC table instantiations, MC
registeration and creation code into XXXMCDesc libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135184 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 20:59:42 +00:00
Evan Cheng
59ee62d241 - Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo
and MCSubtargetInfo.
- Added methods to update subtarget features (used when targets automatically
  detect subtarget features or switch modes).
- Teach X86Subtarget to update MCSubtargetInfo features bits since the
  MCSubtargetInfo layer can be shared with other modules.
- These fixes .code 16 / .code 32 support since mode switch is updated in
  MCSubtargetInfo so MC code emitter can do the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134884 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 03:57:24 +00:00
Evan Cheng
ebdeeab812 Eliminate asm parser's dependency on TargetMachine:
- Each target asm parser now creates its own MCSubtatgetInfo (if needed).
- Changed AssemblerPredicate to take subtarget features which tablegen uses
  to generate asm matcher subtarget feature queries. e.g.
  "ModeThumb,FeatureThumb2" is translated to
  "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134678 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 01:53:10 +00:00
Evan Cheng
0ddff1b535 Compute feature bits at time of MCSubtargetInfo initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 07:07:08 +00:00
Evan Cheng
5b1b4489cf Rename TargetSubtarget to TargetSubtargetInfo for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 21:01:15 +00:00
Evan Cheng
94214703d9 - Added MCSubtargetInfo to capture subtarget features and scheduling
itineraries.
- Refactor TargetSubtarget to be based on MCSubtargetInfo.
- Change tablegen generated subtarget info to initialize MCSubtargetInfo
  and hide more details from targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134257 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 20:45:01 +00:00
Evan Cheng
276365dd4b Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
be the first encoded as the first feature. It then uses the CPU name to look up
features / scheduling itineray even though clients know full well the CPU name
being used to query these properties.

The fix is to just have the clients explictly pass the CPU name!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:53:36 +00:00
Evan Cheng
ab8be96fd3 Sink SubtargetFeature and TargetInstrItineraries (renamed MCInstrItineraries) into MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 01:14:12 +00:00
Evan Cheng
b6a638898a Increase SubtargetFeatureKV Value and Implies fields to 64 bits since some targets are getting very close to 32 subtarget features. Also teach tablegen to error when there are more than 64 features to guard against undefined behavior. rdar://9282332
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 19:35:46 +00:00
Andrew Trick
234823297e Add annotations to tablegen-generated processor itineraries, or replace them with something meaningful. I want to be able to read and debug the generated tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128703 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 02:22:47 +00:00
Andrew Trick
da96cf2029 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128701 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 01:56:55 +00:00
Chris Lattner
67db883487 eliminate the Records global variable, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121659 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 00:23:57 +00:00
Evan Cheng
3881cb7a5d Model Cortex-a9 load to SUB, RSB, ADD, ADC, SBC, RSC, CMN, MVN, or CMP
pipeline forwarding path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:42:35 +00:00
Evan Cheng
63d66eed16 Add support to model pipeline bypass / forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 23:50:49 +00:00
Evan Cheng
5f54ce3473 For each instruction itinerary class, specify the number of micro-ops each
instruction in the class would be decoded to. Or zero if the number of
uOPs must be determined dynamically.

This will be used to determine the cost-effectiveness of predicating a
micro-coded instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 18:18:55 +00:00
Anton Korobeynikov
928eb49cae Make processor FUs unique for given itinerary. This extends the limit of 32
FU per CPU arch to 32 per intinerary allowing precise modelling of quite
complex pipelines in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 20:31:01 +00:00
Anton Korobeynikov
96085a36db Initial support for different kinds of FU reservation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:19:32 +00:00
David Greene
f0fd3afeff Have TableGen emit code that uses dbgs() rather than errs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 17:47:41 +00:00
Sandeep Patel
bf177ee6fd Show command-line args and features passed into backend in debug output. Approved by Evan Cheng.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:23:46 +00:00
David Goodwin
1f52895692 Make the end-of-itinerary mark explicit. Some cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:22:50 +00:00
David Goodwin
fac8541dd4 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:02:57 +00:00
David Goodwin
1a8f36e3ce 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:31:53 +00:00
Daniel Dunbar
1a55180238 Replace std::iostreams with raw_ostream in TableGen.
- Sorry, I can't help myself.

 - No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-03 00:10:29 +00:00
Anton Korobeynikov
41a024385f Propagate CPU string out of SubtargetFeatures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-23 19:50:50 +00:00
Jim Grosbach
da4231f134 fix a few spelling errors and typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-26 16:17:51 +00:00
Jim Grosbach
7c9a7728d9 lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that 
way. TableGen sorts the records that will be used to create it by the names 
of the records, not the Name field of those records.

This patch corrects the sort to use the "Name" field of the record as the 
sort key.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-11 17:05:32 +00:00
Chris Lattner
690d80eefe Stabilize 'getDwarfRegNumFull' output to not depend on random memory
orders, part of PR2590


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26 06:43:25 +00:00
Chris Lattner
d963ab1f58 Fix generation of multi-stage instruction itineraries. Patch by
giuma.cordes@gmail.com



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 17:38:14 +00:00
Dan Gohman
cfbb2f074d A quick nm audit turned up several fixed tables and objects that were
marked read-write. Use const so that they can be allocated in a
read-only segment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 21:45:14 +00:00
Dale Johannesen
db01c8ba26 Rewrite tblgen handling of subtarget features so
it follows the order of the enum, not alphabetical.
The motivation is to make -mattr=+ssse3,+sse41
select SSE41 as it ought to.  Added "ignored"
enum values of 0 to PPC and SPU to avoid compiler
warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 23:35:16 +00:00
Chris Lattner
3060910e29 remove attributions from utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45419 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:37:13 +00:00
Bill Wendling
4222d806fa Add an "implies" field to features. This indicates that, if the current
feature is set, then the features in the implied list should be set also.
The opposite is also enforced: if a feature in the implied list isn't set,
then the feature that owns that implies list shouldn't be set either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 20:38:40 +00:00
Christopher Lamb
8dadf6b13a Fix generation of certain scheduler itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36338 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 09:04:24 +00:00
Jim Laskey
dbe4006cf3 Ignore entries with blank names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32491 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 20:55:58 +00:00
Jim Laskey
9a7dfa3fd4 Rollback changes to take a different tack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32488 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 19:26:50 +00:00
Jim Laskey
55a7ec33d7 Honor the command line specification for machine type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32483 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 16:07:33 +00:00
Reid Spencer
8b9ea8099e Don't write out variables that are never used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31396 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 01:28:12 +00:00
Reid Spencer
9ec4849ff6 For PR786:
Remove unused variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31381 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:46:16 +00:00
Chris Lattner
243be2c80d Don't make zero-sized static arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28448 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:31:02 +00:00
Chris Lattner
3d87811ce0 remove out of date comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26492 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:04:07 +00:00
Evan Cheng
19c9550744 Subtarget feature can now set any variable to any value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25678 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 08:09:42 +00:00
Chris Lattner
387e4bdf00 There is at least a 'noitinerary' itinerary now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25671 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 01:41:55 +00:00
Duraid Madina
42d24c71df almost got the HP-UX tester up.. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25051 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-30 14:56:37 +00:00
Jim Laskey
7f39c14f52 1. Remove ranges from itinerary data.
2. Tidy up the subtarget emittined code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24172 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-03 22:47:41 +00:00
Jim Laskey
6cee630070 Allow itineraries to be passed through the Target Machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24139 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-01 20:06:59 +00:00
Jim Laskey
10b1dd99f3 Generate cpu to itinerary map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24121 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-31 17:16:01 +00:00
Chris Lattner
b0e103d46b Rename Record::getValueAsListDef to getValueAsListOfDefs, to more accurately
reflect what it is.
Convert some more code over to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24072 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 22:49:02 +00:00
Jim Laskey
f7bcde0854 Removed Mr. Smith from the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24070 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 21:47:29 +00:00
Jim Laskey
908ae27a90 Add some commentary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24055 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 15:20:43 +00:00
Jeff Cohen
9489c04efc Keep Visual Studio happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24052 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 01:43:09 +00:00
Jim Laskey
0d841e0567 Now generating instruction itineraries for scheduling. Not my best work, but...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24050 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 19:47:21 +00:00
Jim Laskey
6c302fc075 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 17:49:21 +00:00
Jim Laskey
581a8f79bc Give full control of subtarget features over to table generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24013 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 17:30:34 +00:00
Jim Laskey
b3b1d5f097 Refactored to make room for more stuff (scheduling info.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23975 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 15:16:36 +00:00
Chris Lattner
d4d0797851 Add the needed #include, emit enums with the sizes of tables, remove
definitions from the LLVM namespace, since they are all static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 22:33:08 +00:00
Jim Laskey
7dc02047fb Sort the features and processor lists for the sake of search (and maintainers.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23879 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-22 07:59:56 +00:00
Jim Laskey
4bb9cbb730 New TableGen backends for subtarget information. Only command line stuff
active now.  Scheduling itinerary next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23869 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 19:00:04 +00:00