aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
Commit message (Collapse)AuthorAgeFilesLines
* All constant-evaluation code now unified intoVikram S. Adve2003-07-291-31/+8
| | | | | | | TargetInstrInfo::ConvertConstantToIntType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7390 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary castsChris Lattner2003-07-231-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7250 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove using declChris Lattner2003-07-231-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7246 91177308-0d34-0410-b5e6-96231b3b80d8
* Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.Vikram S. Adve2003-07-061-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7112 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not hastily change the Opcode from 'r' to 'i' type if we're not actuallyMisha Brukman2003-06-071-7/+6
| | | | | | | | | SETTING the operand to be an immediate or have verified that one of the operands is really a SignExtended or Unextended immediate value already, which warrants an 'i' opcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6662 91177308-0d34-0410-b5e6-96231b3b80d8
* I have finally seen the light. The code to change the opcode must live higher inMisha Brukman2003-06-041-4/+13
| | | | | | | | | | | | the loop, and in both cases. In the first case, it is a VReg that is a constant so it may be actually converted to a constant. In the second case, it is already a constant, but then if it doesn't change its type (e.g. to become a register and have the value loaded from memory if it is too large to live in its instruction field), we must change the opcode BEFORE the 'continue', otherwise we miss the opportunity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6602 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved code to modify the opcode from 'reg' to 'imm' form to a more logical ↵Misha Brukman2003-06-031-15/+6
| | | | | | place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6563 91177308-0d34-0410-b5e6-96231b3b80d8
* Added MachineCodeForInstruction object as an argument toVikram S. Adve2003-05-311-2/+1
| | | | | | | | | TmpInstruction constructors because every TmpInstruction object has to be registered with a MachineCodeForInstruction to prevent leaks. This simplifies the user's code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6469 91177308-0d34-0410-b5e6-96231b3b80d8
* When converting virtual registers to immediate constants, change the opcode.Misha Brukman2003-05-301-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6452 91177308-0d34-0410-b5e6-96231b3b80d8
* Move sparc specific code into the Sparc backendChris Lattner2003-01-151-256/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5317 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in previous checkinChris Lattner2003-01-151-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5310 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor changesChris Lattner2003-01-151-21/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5302 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead codeChris Lattner2003-01-151-67/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5298 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MachineInstrInfo -> TargetInstrInfoChris Lattner2003-01-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5272 91177308-0d34-0410-b5e6-96231b3b80d8
* More renamings of Target/Machine*Info to Target/Target*InfoChris Lattner2002-12-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5204 91177308-0d34-0410-b5e6-96231b3b80d8
* Use higher level methodChris Lattner2002-10-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4386 91177308-0d34-0410-b5e6-96231b3b80d8
* MachineInstrInfo no longer #includes this header, so we mustChris Lattner2002-10-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4366 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the redundant MachineOperand::getOperandType() to ↵Chris Lattner2002-10-281-8/+8
| | | | | | MachineOperand::getType() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4331 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #includes now that MachineInstr.h doesn't include ↵Chris Lattner2002-10-281-0/+1
| | | | | | llvm/Target/MachineInstrInfo.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4327 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed `MachineCodeForMethod' to `MachineFunction'.Misha Brukman2002-10-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4301 91177308-0d34-0410-b5e6-96231b3b80d8
* Significant improvement: GEP used by a load or store no longer generatesVikram S. Adve2002-10-141-36/+74
| | | | | | | | | | a separate ADD; instead just use the indexed load/store instruction! Also, a bug fix: folding a GEP with a leading non-zero index with its predecessor was incorrect: now it only happens if the predecessor is pointing to an indexable type (aka SequentialType). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4168 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug fix in folding getElementPtr instructions: don't fold one intoVikram S. Adve2002-09-291-27/+45
| | | | | | | | a predecessor if it has a non-zero first index and the predecessor ends with a struct index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3982 91177308-0d34-0410-b5e6-96231b3b80d8
* Sign-extend integer constants from original type size to 64 bits!Vikram S. Adve2002-09-271-5/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3958 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for GCC 2.96Chris Lattner2002-09-171-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3777 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a version of ChooseRegOrImmed to handle numerical constantsVikram S. Adve2002-09-161-83/+118
| | | | | | | introduced by InstrSelection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3735 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug I introduced into the code generator. :(Chris Lattner2002-09-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3694 91177308-0d34-0410-b5e6-96231b3b80d8
* - Change getelementptr instruction to use long indexes instead of uintChris Lattner2002-09-111-8/+8
| | | | | | | indexes for sequential types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3681 91177308-0d34-0410-b5e6-96231b3b80d8
* - Renamed Type::isIntegral() to Type::isInteger()Chris Lattner2002-09-031-7/+7
| | | | | | | | - Added new method Type::isIntegral() that is the same as isInteger, but also accepts bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved code here to extract memory instruction indices and to checkVikram S. Adve2002-08-241-17/+96
| | | | | | | | whether FoldGetElemNodes should be called. This is machine-independent but was in the Sparc directory. This is in a new function: GetMemInstArgs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3500 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminated the MemAccessInst class, folding contents into GEP class.Chris Lattner2002-08-221-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
* * Removed extraneous #includesChris Lattner2002-08-091-11/+5
| | | | | | | | * Fixed file headers to be consistent with the rest of LLVM * Other minor fixes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3278 91177308-0d34-0410-b5e6-96231b3b80d8
* Add function GetConstantValueAsUnsignedInt.Vikram S. Adve2002-08-041-52/+49
| | | | | | | | | Fix 2 bugs in FoldGetElemChain so index vector is not modified when no GEPs are folded in, and so a hasLeadingZero is computed only for the last folded GEP, not the one after that if any. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3244 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused vectorChris Lattner2002-07-301-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3143 91177308-0d34-0410-b5e6-96231b3b80d8
* Better folding getelementptr operations with mixedVikram S. Adve2002-05-191-41/+61
| | | | | | | | | array and struct indexes. Update operand values in CallArgsDescriptor (a new class) when replacing constant values with immediates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2645 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace all usages of Type::isPointerType with isa<PointerType>Chris Lattner2002-05-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate duplicate or unneccesary #include'sChris Lattner2002-04-291-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
* Split ConstantVals.h into Constant.h and Constants.hChris Lattner2002-04-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
* Change references to the Method class to be references to the FunctionChris Lattner2002-04-071-7/+8
| | | | | | | | class. The Method class is obsolete (renamed) and all references to it are being converted over to Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in previous bug fix.Vikram S. Adve2002-03-311-6/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2069 91177308-0d34-0410-b5e6-96231b3b80d8
* Major overhaul to FoldGetElemPtr to handle mixed array and struct refs.Vikram S. Adve2002-03-241-10/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1968 91177308-0d34-0410-b5e6-96231b3b80d8
* Constants are now added to the constant pool only when a loadVikram S. Adve2002-03-181-25/+17
| | | | | | | | instruction is actually generated for them. Rename the different versions of SetMachineOperand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1903 91177308-0d34-0410-b5e6-96231b3b80d8
* * Switch over to cleaner TmpInstruction modelChris Lattner2002-02-031-5/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1648 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes to build successfully with GCC 3.02Chris Lattner2002-01-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate all uses of memInst->getIndicesBROKEN().Vikram S. Adve2001-12-151-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1485 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConstPoolVal -> ConstantChris Lattner2001-12-031-20/+16
| | | | | | | | Rename ConstPool* -> Constant* Rename ConstPoolVals.h -> ConstantVals.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
* The old getIndices has been deprecated, because it no longer works. It nowChris Lattner2001-11-261-2/+2
| | | | | | | | is named getIndicesBROKEN() and shall be removed when the codebase is updated to not call it git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1338 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assume constant operand can only be in position 1!Vikram S. Adve2001-11-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1308 91177308-0d34-0410-b5e6-96231b3b80d8
* Idiotic error in last fix.Vikram S. Adve2001-11-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1306 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't need to load a NULL pointer constant from memory!Vikram S. Adve2001-11-141-2/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1305 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove much cruft from the MemAccessInst instructionChris Lattner2001-11-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1298 91177308-0d34-0410-b5e6-96231b3b80d8