diff --git a/lib/Target/C6000/C6000TargetTransformInfo.cpp b/lib/Target/C6000/C6000TargetTransformInfo.cpp
index 3aea8033f97724b956c0b6721836f99043e08fc3..3c42bc1b9e8b05e5ceba8dfd4893c4836c179626 100644 (file)
//===----------------------------------------------------------------------===//
#include "C6000.h"
+#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/CostTable.h"
return this;
}
+ /// \name Scalar TTI Implementations
+ /// @{
+
+ void getUnrollingPreferences(const Function *F, Loop *L,
+ UnrollingPreferences &UP) const override;
+
+ /// @}
+
/// \name Vector TTI Implementations
/// @{
return 16;
return 64;
- }
+ }
unsigned getRegisterBitWidth(bool Vector) const override {
return 32;
}
- unsigned getMaximumUnrollFactor() const override {
- return 4;
- }
+ unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+ unsigned AddressSpace) const override;
};
} // end anonymous namespace
llvm::createC6000TargetTransformInfoPass(const C6000TargetMachine *TM) {
return new C6000TTI(TM);
}
+
+void C6000TTI::getUnrollingPreferences(const Function *F, Loop *L,
+ UnrollingPreferences &UP) const {
+ // Disable partial & runtime unrolling on -Os.
+ UP.PartialOptSizeThreshold = 0;
+}
+
+unsigned C6000TTI::getMemoryOpCost(unsigned Opcode, Type *Src,
+ unsigned Alignment,
+ unsigned AddressSpace) const {
+ // TODO: implement correctly...
+ return 1;
+}