llvm-6502/include/llvm
Chris Lattner 01d029b82c One mundane change: Change ReplaceAllUsesOfValueWith to *optionally*
take a deleted nodes vector, instead of requiring it.

One more significant change:  Implement the start of a legalizer that
just works on types.  This legalizer is designed to run before the 
operation legalizer and ensure just that the input dag is transformed
into an output dag whose operand and result types are all legal, even
if the operations on those types are not.

This design/impl has the following advantages:

1. When finished, this will *significantly* reduce the amount of code in
   LegalizeDAG.cpp.  It will remove all the code related to promotion and
   expansion as well as splitting and scalarizing vectors.
2. The new code is very simple, idiomatic, and modular: unlike 
   LegalizeDAG.cpp, it has no 3000 line long functions. :)
3. The implementation is completely iterative instead of recursive, good
   for hacking on large dags without blowing out your stack.
4. The implementation updates nodes in place when possible instead of 
   deallocating and reallocating the entire graph that points to some 
   mutated node.
5. The code nicely separates out handling of operations with invalid 
   results from operations with invalid operands, making some cases
   simpler and easier to understand.
6. The new -debug-only=legalize-types option is very very handy :), 
   allowing you to easily understand what legalize types is doing.

This is not yet done.  Until the ifdef added to SelectionDAGISel.cpp is
enabled, this does nothing.  However, this code is sufficient to legalize
all of the code in 186.crafty, olden and freebench on an x86 machine.  The
biggest issues are:

1. Vectors aren't implemented at all yet
2. SoftFP is a mess, I need to talk to Evan about it.
3. No lowering to libcalls is implemented yet.
4. Various operations are missing etc.
5. There are FIXME's for stuff I hax0r'd out, like softfp.

Hey, at least it is a step in the right direction :).  If you'd like to help,
just enable the #ifdef in SelectionDAGISel.cpp and compile code with it.  If
this explodes it will tell you what needs to be implemented.  Help is 
certainly appreciated.

Once this goes in, we can do three things:

1. Add a new pass of dag combine between the "type legalizer" and "operation
   legalizer" passes.  This will let us catch some long-standing isel issues
   that we miss because operation legalization often obfuscates the dag with
   target-specific nodes.
2. We can rip out all of the type legalization code from LegalizeDAG.cpp,
   making it much smaller and simpler.  When that happens we can then 
   reimplement the core functionality left in it in a much more efficient and
   non-recursive way.
3. Once the whole legalizer is non-recursive, we can implement whole-function
   selectiondags maybe...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 06:10:22 +00:00
..
ADT Consolidate logic for creating NaNs. Silence compiler warning. 2007-10-14 10:39:51 +00:00
Analysis Begin the process of allowing DomTree on MBB's. Step One: template DomTreeNode by making it a typedef of a templated DomTreeNodeBase. 2007-10-08 07:44:39 +00:00
Assembly Change casts from old style to new style. This helps document the details 2007-08-12 08:12:35 +00:00
Bitcode Add explicit keywords. 2007-10-08 15:08:41 +00:00
CodeGen One mundane change: Change ReplaceAllUsesOfValueWith to *optionally* 2007-10-15 06:10:22 +00:00
Config Regenerate. 2007-10-03 12:07:14 +00:00
Debugger For PR797: 2006-08-22 16:06:27 +00:00
ExecutionEngine Implement x86 long double in jit (not really 2007-09-17 18:44:13 +00:00
Support Add a new use_iterator::atEnd() method, which allows us to shrink 2007-10-11 04:18:11 +00:00
System Fix minor doxygen nits. 2007-08-05 20:06:04 +00:00
Target Fix 80 col violation 2007-10-15 05:30:27 +00:00
Transforms Remove RLE from the headers, since the pass itself is gone now. 2007-09-14 22:54:46 +00:00
AbstractTypeUser.h Here is the bulk of the sanitizing. 2007-07-05 17:07:56 +00:00
Argument.h make these accessors private. 2007-05-23 05:46:04 +00:00
AutoUpgrade.h This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. 2007-08-04 01:51:18 +00:00
BasicBlock.h better portability for intptr_t. 2007-05-18 07:07:05 +00:00
CallGraphSCCPass.h Add explicit keywords. 2007-07-02 14:53:37 +00:00
CallingConv.h Fix 80 col violations. 2007-04-16 21:24:12 +00:00
Constant.h add a Constant::getAllOnesValue helper function, which works on integers 2007-06-15 06:10:53 +00:00
Constants.h Adding C and Ocaml bindings for ConstantExpr. 2007-10-06 14:29:36 +00:00
DerivedTypes.h Fix comments about vectors to use the current wording. 2007-07-16 14:29:03 +00:00
Function.h clarify precedence, no functionality change. 2007-08-20 21:31:08 +00:00
GlobalAlias.h Implement review feedback 2007-04-29 18:02:48 +00:00
GlobalValue.h Change casts from old style to new style. This helps document the details 2007-08-12 08:12:35 +00:00
GlobalVariable.h Implement review feedback. Aliasees can be either GlobalValue's or 2007-04-28 13:45:00 +00:00
InlineAsm.h represent indirect operands explicitly in inline asm strings. 2007-04-28 01:02:58 +00:00
InstrTypes.h sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst. 2007-08-24 20:48:18 +00:00
Instruction.def Changes to support making the shift instructions be true BinaryOperators. 2007-02-02 02:16:23 +00:00
Instruction.h Instruction:: Next/Prev accessors are now private 2007-04-17 18:03:55 +00:00
Instructions.h Remove an unnecessary static_cast. 2007-09-24 15:46:02 +00:00
IntrinsicInst.h For PR950: 2006-10-20 07:07:24 +00:00
Intrinsics.h For PR1297: 2007-04-01 07:26:35 +00:00
Intrinsics.td Add intrinsics for sin, cos, and pow. These use llvm_anyfloat_ty, and so 2007-10-12 00:01:22 +00:00
IntrinsicsPowerPC.td Convert the intrinsic function definitions to use llvm_i32_ty instead of 2006-12-31 22:24:55 +00:00
IntrinsicsX86.td There is no {rsqrt,rcp}{p,s}d. 2007-09-21 15:24:00 +00:00
LinkAllPasses.h Remove RLE from the headers, since the pass itself is gone now. 2007-09-14 22:54:46 +00:00
LinkAllVMCore.h For PR780: 2006-07-26 16:55:39 +00:00
Linker.h Fix minor doxygen nits. 2007-08-05 20:06:04 +00:00
LinkTimeOptimizer.h Add printVersion(). Linker can use it to print LLVM version number. 2007-02-01 01:46:06 +00:00
Module.h Fixing an comment in Module.h that refers to a nonexistent parameter. 2007-09-18 02:09:34 +00:00
ModuleProvider.h add a hook to demat functions. 2007-03-29 18:30:26 +00:00
ParameterAttributes.h Support for trampolines, except for X86 codegen which is 2007-07-27 12:58:54 +00:00
Pass.h Allow passes to just pass up "FunctionPass(&ID)" instead of "FunctionPass((intptr_t)&ID)" 2007-10-08 03:45:44 +00:00
PassAnalysisSupport.h Add a addRequiredTransitiveID member function, which is to 2007-05-14 14:21:46 +00:00
PassManager.h Fix pastos in comments for doFinalization functions. 2007-07-30 14:51:13 +00:00
PassManagers.h Fix a using namespace llvm; in a header file. 2007-10-03 19:04:09 +00:00
PassSupport.h Change casts from old style to new style. This helps document the details 2007-08-12 08:12:35 +00:00
SymbolTableListTraits.h Change casts from old style to new style. This helps document the details 2007-08-12 08:12:35 +00:00
Type.h Fix spelling. 2007-09-25 13:53:22 +00:00
TypeSymbolTable.h Properly initialize value :) 2007-07-19 15:32:47 +00:00
Use.h Add a new use_iterator::atEnd() method, which allows us to shrink 2007-10-11 04:18:11 +00:00
User.h Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*> 2007-02-12 05:18:08 +00:00
Value.h add Value::getNameStart/getNameLen() accessors. 2007-08-10 15:34:35 +00:00
ValueSymbolTable.h better portability for intptr_t. 2007-05-18 07:07:05 +00:00