aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Target/TargetInstrInfo.h5
-rw-r--r--include/llvm/Target/TargetLowering.h16
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp1
3 files changed, 22 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h
index 00a05569b9..4c0e1b8e94 100644
--- a/include/llvm/Target/TargetInstrInfo.h
+++ b/include/llvm/Target/TargetInstrInfo.h
@@ -394,6 +394,11 @@ public:
virtual bool PredicateInstruction(MachineInstr *MI,
std::vector<MachineOperand> &Cond) const;
+ /// getBlockSize - Calculate the size of the specified MachineBasicBlock.
+ /// Note the result may not be 100% accurate especially if there are inline
+ /// asm's in the block.
+ virtual unsigned getBlockSize(MachineBasicBlock *MBB) const;
+
/// getPointerRegClass - Returns a TargetRegisterClass used for pointer
/// values.
virtual const TargetRegisterClass *getPointerRegClass() const {
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 6880708130..d736a3ad20 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -434,6 +434,12 @@ public:
return JumpBufAlignment;
}
+ /// getIfCvtBlockLimit - returns the target specific if-conversion block size
+ /// limit. Any block whose size is greater should not be predicated.
+ virtual unsigned getIfCvtBlockSizeLimit() const {
+ return IfCvtBlockSizeLimit;
+ }
+
/// getPreIndexedAddressParts - returns true by value, base pointer and
/// offset pointer and addressing mode by reference if the node's address
/// can be legally represented as pre-indexed load / store address.
@@ -750,6 +756,12 @@ protected:
void setJumpBufAlignment(unsigned Align) {
JumpBufAlignment = Align;
}
+
+ /// setIfCvtBlockSizeLimit - Set the target's if-conversion block size limit;
+ /// default is 2.
+ void setIfCvtBlockSizeLimit(unsigned Limit) {
+ IfCvtBlockSizeLimit = Limit;
+ }
public:
@@ -982,6 +994,10 @@ private:
/// JumpBufAlignment - The alignment, in bytes, of the target's jmp_buf
/// buffers
unsigned JumpBufAlignment;
+
+ /// IfCvtBlockSizeLimit - The maximum allowed block size for if-conversion.
+ ///
+ unsigned IfCvtBlockSizeLimit;
/// StackPointerRegisterToSaveRestore - If set to a physical register, this
/// specifies the register that llvm.savestack/llvm.restorestack should save
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 1a8a4bc349..970533b9a5 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -157,6 +157,7 @@ TargetLowering::TargetLowering(TargetMachine &tm)
SchedPreferenceInfo = SchedulingForLatency;
JumpBufSize = 0;
JumpBufAlignment = 0;
+ IfCvtBlockSizeLimit = 2;
InitLibcallNames(LibcallRoutineNames);
InitCmpLibcallCCs(CmpLibcallCCs);