Commit Graph

7208 Commits

Author SHA1 Message Date
Chris Lattner 254980008b Add full support for code generating expanders!
This includes support for referencing named arguments.

llvm-svn: 7715
2003-08-10 23:51:52 +00:00
Chris Lattner 1bce0f268b Implement autopromotion of leaf trees from arguments to nodes of their own,
making it easier to write patterns without lots of extraneous parens

llvm-svn: 7714
2003-08-10 22:38:36 +00:00
Chris Lattner 3859c9a8db Implement correct parsing, representation, and printing of DAG argument names
Implements testcase TableGen/TreeNames.td

llvm-svn: 7713
2003-08-10 22:14:13 +00:00
Chris Lattner 4eaf72fc3b Recognize $foo as a variable
llvm-svn: 7712
2003-08-10 22:04:25 +00:00
Chris Lattner ba2cf32f00 New testcase
llvm-svn: 7711
2003-08-10 22:02:44 +00:00
Chris Lattner 5223d51aac Implement real code emission, at least for Instruction patterns,
next up: support for expanders

llvm-svn: 7710
2003-08-10 21:54:43 +00:00
Chris Lattner 0e00f36924 First cut at emitting the reducer. This reducer just prints out the patterns
selected, but it seems to work great!

llvm-svn: 7709
2003-08-10 20:34:13 +00:00
Chris Lattner 3e2e0fb7ee Make imm be a leaf instead of a nonterminal
llvm-svn: 7708
2003-08-10 19:51:16 +00:00
Chris Lattner d2ec0bd8f0 Finish the matcher!
llvm-svn: 7707
2003-08-10 19:50:51 +00:00
Chris Lattner 12a19fda99 Add new function
llvm-svn: 7706
2003-08-10 19:50:32 +00:00
John Criswell 8aba798388 Removed information on the Pool Allocator as it is no longer available.
Fixed a spelling error.

llvm-svn: 7705
2003-08-08 22:46:30 +00:00
John Criswell 6274b71eb2 Added a FAQ about how to clean the directory if it fails to build after an
update.

llvm-svn: 7704
2003-08-08 22:43:39 +00:00
John Criswell 4135b21377 Updated for the 1.1 pre-release.
Attempted to explain how OBJ_ROOT=. and OBJ_ROOT=`pwd` are not the same thing.

llvm-svn: 7703
2003-08-08 22:36:30 +00:00
Chris Lattner 575288e02d This implements a large amount of the matcher, in fact, all of it except for one bug
llvm-svn: 7702
2003-08-08 22:29:23 +00:00
Chris Lattner 1ac45ba538 Emit the first half of the instruction selector.
llvm-svn: 7701
2003-08-08 16:30:10 +00:00
Misha Brukman 3f0385d424 Chomped spurious blank lines.
llvm-svn: 7700
2003-08-08 15:37:35 +00:00
Chris Lattner 4d8ba42bc4 Finish implementation of nonterminal instantiation.
Tree patterns are now, finally, ready to use!

llvm-svn: 7699
2003-08-07 23:16:20 +00:00
Chris Lattner fe64759b2c Add new method to get a value type as a string
llvm-svn: 7698
2003-08-07 23:15:21 +00:00
Chris Lattner 245b525551 * Fix <>'s in code to be &lt;&gt;'s
* Add section describing how we prefer #includes to be ordered

llvm-svn: 7697
2003-08-07 21:45:47 +00:00
Misha Brukman 1b7a238f3f File-related functions moved to FileUtilities.h .
llvm-svn: 7696
2003-08-07 21:42:28 +00:00
Misha Brukman c231c0889e close() requires "unistd.h" .
llvm-svn: 7695
2003-08-07 21:35:41 +00:00
Misha Brukman e4d58ec261 Doxygen-ify the comments by using '///' instead of '//'.
llvm-svn: 7694
2003-08-07 21:34:25 +00:00
Misha Brukman b02e413f65 Remove references to `bugpoint' from the now-generic system utilities.
llvm-svn: 7693
2003-08-07 21:33:33 +00:00
Chris Lattner b8f72991a6 Completely remove mention of the correlated branch elimination pass. It has
bugs and needs to be reworked anyway.

llvm-svn: 7692
2003-08-07 21:30:12 +00:00
Misha Brukman 3581f8542d Moved removeFile() and getUniqueFilename() into FileUtilities.
llvm-svn: 7691
2003-08-07 21:28:50 +00:00
Misha Brukman 250bf3674c * The possessive third-person singular has no apostrophe (its)
* Grouped header files to fit with the LLVM standard
* Fit code into 80 columns

llvm-svn: 7690
2003-08-07 21:23:52 +00:00
Misha Brukman 0c2305b110 Re-grouped and alphabetized headers for easier reading and cleaner style.
llvm-svn: 7689
2003-08-07 21:19:30 +00:00
Misha Brukman 83d52f3c36 Fixed path for SystemUtils.h and a few code cleanups.
llvm-svn: 7688
2003-08-07 21:05:13 +00:00
Misha Brukman e722e4ea49 Moved SystemUtils.h to include/Support and SystemUtils.cpp to lib/Support.
llvm-svn: 7687
2003-08-07 21:04:42 +00:00
Chris Lattner 19630d41f8 Implement type-inference/checking for non-terminal references
llvm-svn: 7686
2003-08-07 21:02:56 +00:00
Chris Lattner acf3dbe0c5 Rename all of the "Process" methods to be "read" methods, start the Instantiate method
llvm-svn: 7685
2003-08-07 20:42:23 +00:00
Chris Lattner ca89a11494 Add support for "cast" nodes, which are required when there is not enough information
to infer type type of all nodes, e.g. (ret imm)

llvm-svn: 7684
2003-08-07 19:59:42 +00:00
Chris Lattner bd1ffb4ea1 Use the new version of isSubClassOf
llvm-svn: 7683
2003-08-07 19:42:14 +00:00
Chris Lattner c6793425e3 Add and use a new method
llvm-svn: 7682
2003-08-07 19:41:59 +00:00
Chris Lattner 9b759739ef Cleanup and reorganize code, no functional changes
llvm-svn: 7679
2003-08-07 19:28:55 +00:00
Chris Lattner b6629063ec Read in expanders too
llvm-svn: 7678
2003-08-07 19:21:10 +00:00
Chris Lattner a63e04482f Continued evolution of the selector emitter: Represent instruction patterns
as first class objects

llvm-svn: 7677
2003-08-07 19:12:24 +00:00
Misha Brukman 1fe74d144b Implement LLVM intrinsics `llvm.setjmp' and `llvm.longjmp' as follows:
* setjmp() simply returns 0
* longjmp() simply calls abort()

llvm-svn: 7676
2003-08-07 15:43:46 +00:00
Vikram S. Adve da92f366c7 Fix assertion in MachineInstr::substituteValue().
llvm-svn: 7675
2003-08-07 15:01:48 +00:00
Vikram S. Adve 6e4a358f72 Fix sanity-checking in 'maskUnsigned' code to be more precise:
use or def-and-use operands can be substituted after one def-only
operand has been substituted.

llvm-svn: 7674
2003-08-07 15:01:26 +00:00
John Criswell 449670a8f7 Fixed a segfault in gccld.
The original code does not work because the value from WorkList.end() is
invalidated once WorkList.erase() is called.  To ensure proper functionality,
we must ensure that WorkList.erase() is always called before WorkList.end().

llvm-svn: 7673
2003-08-07 14:43:13 +00:00
Chris Lattner eaa5b964bb Update tablegen interfaces
llvm-svn: 7672
2003-08-07 13:52:22 +00:00
Chris Lattner ccb9f8ed54 Finish implementation of the type inference engine.
Start working on reading in nonterminals

llvm-svn: 7671
2003-08-07 06:02:15 +00:00
Chris Lattner da2e1dcc2b Allow clients to get at the pointer type
llvm-svn: 7670
2003-08-07 06:01:44 +00:00
Chris Lattner 32809aad34 Add new method getVAlueAsDag
llvm-svn: 7669
2003-08-07 06:00:43 +00:00
Chris Lattner c01182c716 Initial checkin of tree pattern parser and type inference engine (which still needs work).
llvm-svn: 7668
2003-08-07 05:40:14 +00:00
Chris Lattner 40842f4c8b Eliminate now-dead method
llvm-svn: 7667
2003-08-07 05:39:37 +00:00
Chris Lattner 377f096678 Start using the CodeGeneratorWrappers
llvm-svn: 7666
2003-08-07 05:39:09 +00:00
Chris Lattner 9f993091ea Initial checkin of useful wrappers around the Target classes, for now, only ValueType and
Target are wrapped

llvm-svn: 7665
2003-08-07 05:38:11 +00:00
Sumant Kowshik 43ecb4829d Removed the support for pool allocation testing. This will be in a separate TEST file
llvm-svn: 7664
2003-08-07 05:36:53 +00:00
Sumant Kowshik db64829787 Change implementation so that variable sized slabs are used to allow arbitrary sized array allocations
llvm-svn: 7663
2003-08-07 05:31:04 +00:00
Sumant Kowshik 0b83080595 Added code for pool allocating only the pool-allocatable data structures in the presence of collapsed nodes + a couple of bug fixes
llvm-svn: 7662
2003-08-07 05:29:28 +00:00
Chris Lattner 8706805dae This register is never used, disable it.
llvm-svn: 7661
2003-08-07 04:49:16 +00:00
Sumant Kowshik b2d3c8e805 Added a flag which is set when all data structures are not pool allocated
llvm-svn: 7660
2003-08-07 04:37:52 +00:00
Chris Lattner 74bc5c7147 There was no reason for these to be bit-fields, they just need to be unique.
Also, add an isVoid item

llvm-svn: 7659
2003-08-07 00:17:00 +00:00
Misha Brukman b611692487 Changing command-line option formats to be more consistent with LLVM style.
llvm-svn: 7658
2003-08-06 23:25:25 +00:00
Misha Brukman 8f18938d1c * Renamed option from `nopreselect' to `nopreopt' since it disables more than
just PreSelection
* Wrapped code at 80 columns
* Added the DecomposeMultiDimRefs Pass to the JIT compilation path

llvm-svn: 7657
2003-08-06 23:06:21 +00:00
Chris Lattner e76a2e790d Ick, add the RIGHT accessor
llvm-svn: 7656
2003-08-06 23:01:18 +00:00
Chris Lattner 116ad79efd Add accessor
llvm-svn: 7655
2003-08-06 23:00:31 +00:00
Chris Lattner 4438d571f2 There is something wrong with code that looks like:
if (R == 0 || ...)
  R->getName()

llvm-svn: 7654
2003-08-06 22:29:04 +00:00
Misha Brukman 79226d066e Use the registers g1 and g5 as temporaries for making far jumps and far calls,
because saving i1 and i2 to their ``designated'' stack slots corrupts unknown
memory in other functions, standard libraries, and worse.

In addition, this has the benefit of improving JIT performance because we
eliminate writing out 4 instructions in CompilationCallback() and 2 loads and 2
stores.

llvm-svn: 7653
2003-08-06 22:19:18 +00:00
John Criswell fa30f1be46 Removed Makefile.common.
Since we are including Makefile.test, we automatically get Makefile.common.
Furthermore, the double inclusion of Makefile.common causes the test suite to
be executed twice per invocation of the top level make.

llvm-svn: 7652
2003-08-06 21:50:36 +00:00
Chris Lattner 48b78c8bf3 Export the register classes so that the instruction selector can get at them as needed
llvm-svn: 7651
2003-08-06 21:47:14 +00:00
Brian Gaeke 360855a017 Makefile.common: Remove commented-out and duplicate rules.
llvm-svn: 7650
2003-08-06 21:44:22 +00:00
Chris Lattner 4159fdaef2 Add a bunch of new Alpha Intrinsics for Rahul Joshi
llvm-svn: 7646
2003-08-06 20:08:25 +00:00
Vikram S. Adve 792b48f4d1 1. Bug fix: was using SLL instead of SLLX for ULongTy. Chump.
2. Handle fp-to-uint conversions directly here instead of relying on
   a pre-transformation to replace them with the 2-step conversion.
3. Use size rather than explicitly checking types when deciding what
   opcodes to use, wherever possible.  This is less error prone (the
   bug fix above was not the first time!).
4. Float-to-pointer casts shd now work though this hasn't been tested.

llvm-svn: 7645
2003-08-06 18:48:40 +00:00
Vikram S. Adve 26125cbeb5 Remove conversion of fp-to-uint cast into a multi-step cast:
this is not an optional transformation on SPARC and is now handled
directly by instruction selection.

llvm-svn: 7644
2003-08-06 18:42:49 +00:00
Chris Lattner 39a2b3aa08 New testcase
llvm-svn: 7643
2003-08-06 18:26:19 +00:00
Chris Lattner 584058220a The HAVE_JUMP code is dead, these intrinsics should _never_ be expanded
llvm-svn: 7642
2003-08-06 18:04:40 +00:00
Chris Lattner c592c9f8a3 Remove unnecessary use of NonCopyable
llvm-svn: 7641
2003-08-06 17:16:24 +00:00
Misha Brukman 31b31d94d9 Added asserts to prevent negative shift amounts from being generated.
llvm-svn: 7640
2003-08-06 16:28:49 +00:00
Misha Brukman 4510698acb SparcV9CodeEmitter.cpp:
* Doxygen-ified comments
* Added capability to make far calls (i.e., beyond 30 bits in CALL instr)
  which implies that we need to delete function references that were added by
  the call to addFunctionReference() because the actual call instruction is 10
  instructions away (thanks to 64-bit address construction)
* Cleaned up code that generates far jumps by using an array+loop

SparcV9CodeEmitter.h:
* Explained more of the side-effects of emitFarCall()

llvm-svn: 7639
2003-08-06 16:20:22 +00:00
Chris Lattner bade93cde8 Sort the file lists
llvm-svn: 7638
2003-08-06 16:02:50 +00:00
Chris Lattner a0de5c8f21 Loop unroller doesn't necessarily need to be profile driven
llvm-svn: 7637
2003-08-06 15:40:37 +00:00
Chris Lattner fb2054c40b Completely eliminate the isVoid TSFlag, shifting over all other fields
llvm-svn: 7636
2003-08-06 15:32:20 +00:00
Chris Lattner 19d25b3c41 add a pattern for RET, immediates no longer need to be explicitly typed
llvm-svn: 7635
2003-08-06 15:31:35 +00:00
Chris Lattner 0c4dd1ea09 Start adding usefulness to the DAG node definitions, add a new Expander
class

llvm-svn: 7634
2003-08-06 15:31:02 +00:00
Chris Lattner f0f55a9b28 Add error checking code to the node type parser. Start the instruction pattern
reader

llvm-svn: 7632
2003-08-06 06:16:35 +00:00
Chris Lattner b5035a4ec9 Initial support for an instruction selector emitter
llvm-svn: 7631
2003-08-06 05:42:05 +00:00
Chris Lattner 236ced1487 All good classes with virtual functions should have virtual dtors...
llvm-svn: 7630
2003-08-06 05:39:03 +00:00
Chris Lattner bb43caeb95 Add an instruction selector emitter skeleton
llvm-svn: 7629
2003-08-06 04:47:56 +00:00
Chris Lattner 36498143ba convert over to using TableGen backends
llvm-svn: 7628
2003-08-06 04:36:35 +00:00
Chris Lattner 7179feb5e2 Switch code over to being a TableGenBackend
llvm-svn: 7627
2003-08-06 04:32:07 +00:00
Chris Lattner 4708d5ce31 Add more helper methods
llvm-svn: 7626
2003-08-06 04:31:26 +00:00
Chris Lattner 5f2e204a46 New common interface for backends to use
llvm-svn: 7625
2003-08-06 04:23:04 +00:00
Sumant Kowshik 5ca0380a65 Added POOLFLAGS option to run pool allocation
llvm-svn: 7624
2003-08-06 01:03:28 +00:00
Chris Lattner 9994870cb3 "fix" coding style stuff
Change some <>'s into &lt;&gt;'s

llvm-svn: 7623
2003-08-05 22:54:23 +00:00
Chris Lattner 385a6b2589 Completely eliminate the per-machine-instruction regsUsed set.
This substantially shrinks the size of each machine instruction, which should
make allocation faster and the cache footprint of the machine code lighter.

Here are some timings for code generation of the larger benchmarks we have.
This are timings of code generation phases of the X86 JIT, when compiled in
debug mode:

		Before	After	Diff
164.gzip:
  InstSel	0.0878	0.0722	-21.6%
  RegAlloc	0.2031	0.1757	-15.6%
  TOTAL		0.5585	0.4999	-11.7%
Ptrdist-bc:
  InstSel	0.0878	0.0722	-21.6%
  RegAlloc	0.2070	0.1933	- 7.1%
  TOTAL		0.6972	0.6464	- 7.9%
197.parser:
  InstSel	0.2148	0.2148	- 0.0%
  RegAlloc	0.4941	0.4277	-15.5%
  TOTAL		1.3749	1.2851	- 7.0%
175.vpr:
  InstSel	0.2519	0.2109	-19.4%
  RegAlloc	0.5976	0.5663	- 5.5%
  TOTAL		1.6933	1.6347	- 3.5%
254.gap:
  InstSel	1.1328	0.9921	-14.2%
  RegAlloc	2.6933	2.4804	- 8.6%
  TOTAL		7.7871	7.2499	- 7.4%

llvm-svn: 7622
2003-08-05 22:39:13 +00:00
Chris Lattner 30e987470f Use a new local data structure instead of the MachineInstr::regsUsed set
llvm-svn: 7621
2003-08-05 22:11:13 +00:00
Chris Lattner 92f5fb598c Add a map
llvm-svn: 7620
2003-08-05 22:09:31 +00:00
Chris Lattner e62a2a76e5 Minor cleanups
llvm-svn: 7619
2003-08-05 22:03:27 +00:00
Chris Lattner b05d3508d6 Physical registers no longer live in the regsUsed set for each machine instr
llvm-svn: 7618
2003-08-05 21:55:58 +00:00
Chris Lattner 020b544cbc Do not insert physical regsiters into the regsUsed set
llvm-svn: 7617
2003-08-05 21:55:20 +00:00
John Criswell 1943f88a79 Reverted back to using OR for cmp/mv operations for lex/yacc output.
The shell AND/OR operators short-circuit on command success/failure, which is
the inverse of exit status (i.e. 0 means success, non-zero means failure).

llvm-svn: 7616
2003-08-05 21:38:28 +00:00
John Criswell 4d79702a4c Switched from using diff to cmp for two reasons:
o Not all versions of diff have the -q option
	o The cmp program is probably faster than diff
Fixed the logic that only copies the file over if no differences are found.

llvm-svn: 7615
2003-08-05 21:21:58 +00:00
Tanya Lattner dc3c9a8545 Fixed minor bug in SafeToHoist and made some changes suggested by Chris.
llvm-svn: 7614
2003-08-05 20:39:02 +00:00
Tanya Lattner b96c7a6985 Added LICM test cases to:
1) Check that trapping instructionns that are not guaranteed to execute are not hoisted.
2) Check that trapping instructions that are guaranteed to execute are hoisted.

llvm-svn: 7613
2003-08-05 18:52:42 +00:00
Tanya Lattner 57c03df032 Fixed LICM bug that hoists trapping instructions that are not guaranteed to execute.
llvm-svn: 7612
2003-08-05 18:45:46 +00:00
Chris Lattner adc5a89a3b Minor changes:
* Expand most tabs into spaces
  * Move #define DEBUG_TYPE to top of file to avoid warning

llvm-svn: 7611
2003-08-05 18:44:12 +00:00
Chris Lattner 61182a2021 Add more verbose comment
llvm-svn: 7610
2003-08-05 18:38:37 +00:00