| OLD | NEW |
| 1 //===-- FastISel.h - Definition of the FastISel class ---------------------===// | 1 //===-- FastISel.h - Definition of the FastISel class ---------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file defines the FastISel class. | 10 // This file defines the FastISel class. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 FunctionLoweringInfo &FuncInfo; | 47 FunctionLoweringInfo &FuncInfo; |
| 48 MachineRegisterInfo &MRI; | 48 MachineRegisterInfo &MRI; |
| 49 MachineFrameInfo &MFI; | 49 MachineFrameInfo &MFI; |
| 50 MachineConstantPool &MCP; | 50 MachineConstantPool &MCP; |
| 51 DebugLoc DL; | 51 DebugLoc DL; |
| 52 const TargetMachine &TM; | 52 const TargetMachine &TM; |
| 53 const TargetData &TD; | 53 const TargetData &TD; |
| 54 const TargetInstrInfo &TII; | 54 const TargetInstrInfo &TII; |
| 55 const TargetLowering &TLI; | 55 const TargetLowering &TLI; |
| 56 const TargetRegisterInfo &TRI; | 56 const TargetRegisterInfo &TRI; |
| 57 |
| 58 /// The position of the last instruction for materializing constants |
| 59 /// for use in the current block. It resets to EmitStartPt when it |
| 60 /// makes sense (for example, it's usually profitable to avoid function |
| 61 /// calls between the definition and the use) |
| 57 MachineInstr *LastLocalValue; | 62 MachineInstr *LastLocalValue; |
| 58 | 63 |
| 64 /// The top most instruction in the current block that is allowed for |
| 65 /// emitting local variables. LastLocalValue resets to EmitStartPt when |
| 66 /// it makes sense (for example, on function calls) |
| 67 MachineInstr *EmitStartPt; |
| 68 |
| 59 public: | 69 public: |
| 60 /// getLastLocalValue - Return the position of the last instruction | 70 /// getLastLocalValue - Return the position of the last instruction |
| 61 /// emitted for materializing constants for use in the current block. | 71 /// emitted for materializing constants for use in the current block. |
| 62 MachineInstr *getLastLocalValue() { return LastLocalValue; } | 72 MachineInstr *getLastLocalValue() { return LastLocalValue; } |
| 63 | 73 |
| 64 /// setLastLocalValue - Update the position of the last instruction | 74 /// setLastLocalValue - Update the position of the last instruction |
| 65 /// emitted for materializing constants for use in the current block. | 75 /// emitted for materializing constants for use in the current block. |
| 66 void setLastLocalValue(MachineInstr *I) { LastLocalValue = I; } | 76 void setLastLocalValue(MachineInstr *I) { |
| 77 EmitStartPt = I; |
| 78 LastLocalValue = I; |
| 79 } |
| 67 | 80 |
| 68 /// startNewBlock - Set the current block to which generated machine | 81 /// startNewBlock - Set the current block to which generated machine |
| 69 /// instructions will be appended, and clear the local CSE map. | 82 /// instructions will be appended, and clear the local CSE map. |
| 70 /// | 83 /// |
| 71 void startNewBlock(); | 84 void startNewBlock(); |
| 72 | 85 |
| 73 /// getCurDebugLoc() - Return current debug location information. | 86 /// getCurDebugLoc() - Return current debug location information. |
| 74 DebugLoc getCurDebugLoc() const { return DL; } | 87 DebugLoc getCurDebugLoc() const { return DL; } |
| 75 | 88 |
| 76 /// SelectInstruction - Do "fast" instruction selection for the given | 89 /// SelectInstruction - Do "fast" instruction selection for the given |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 /// nodes as input. We cannot just directly add them, because expansion | 364 /// nodes as input. We cannot just directly add them, because expansion |
| 352 /// might result in multiple MBB's for one BB. As such, the start of the | 365 /// might result in multiple MBB's for one BB. As such, the start of the |
| 353 /// BB might correspond to a different MBB than the end. | 366 /// BB might correspond to a different MBB than the end. |
| 354 bool HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB); | 367 bool HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB); |
| 355 | 368 |
| 356 /// materializeRegForValue - Helper for getRegForVale. This function is | 369 /// materializeRegForValue - Helper for getRegForVale. This function is |
| 357 /// called when the value isn't already available in a register and must | 370 /// called when the value isn't already available in a register and must |
| 358 /// be materialized with new instructions. | 371 /// be materialized with new instructions. |
| 359 unsigned materializeRegForValue(const Value *V, MVT VT); | 372 unsigned materializeRegForValue(const Value *V, MVT VT); |
| 360 | 373 |
| 374 /// flushLocalValueMap - clears LocalValueMap and moves the area for the |
| 375 /// new local variables to the beginning of the block. It helps to avoid |
| 376 /// spilling cached variables across heavy instructions like calls. |
| 377 void flushLocalValueMap(); |
| 378 |
| 361 /// hasTrivialKill - Test whether the given value has exactly one use. | 379 /// hasTrivialKill - Test whether the given value has exactly one use. |
| 362 bool hasTrivialKill(const Value *V) const; | 380 bool hasTrivialKill(const Value *V) const; |
| 363 }; | 381 }; |
| 364 | 382 |
| 365 } | 383 } |
| 366 | 384 |
| 367 #endif | 385 #endif |
| OLD | NEW |