summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2c4618)
raw | patch | inline | side by side (parent: c2c4618)
author | Jon Humphreys <j-humphreys@ti.com> | |
Wed, 24 Dec 2014 21:50:05 +0000 (15:50 -0600) | ||
committer | Jon Humphreys <j-humphreys@ti.com> | |
Thu, 22 Jan 2015 23:39:32 +0000 (17:39 -0600) |
lib/Target/C6000/C6000TargetTransformInfo.cpp | patch | blob | history |
diff --git a/lib/Target/C6000/C6000TargetTransformInfo.cpp b/lib/Target/C6000/C6000TargetTransformInfo.cpp
index 3c183439fbff328accbe6670bdbdcb01b012b943..3c42bc1b9e8b05e5ceba8dfd4893c4836c179626 100644 (file)
/// \name Scalar TTI Implementations
/// @{
- void getUnrollingPreferences(Loop *L,
+ void getUnrollingPreferences(const Function *F, Loop *L,
UnrollingPreferences &UP) const override;
/// @}
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;
};
return new C6000TTI(TM);
}
-void C6000TTI::getUnrollingPreferences(Loop *L,
- UnrollingPreferences &UP) const {
- // Scan the loop: don't unroll loops with calls.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- BasicBlock *BB = *I;
-
- for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; ++J)
- if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
- ImmutableCallSite CS(J);
- if (const Function *F = CS.getCalledFunction()) {
- if (!TopTTI->isLoweredToCall(F))
- continue;
- }
-
- return;
- }
- }
-
- // Enable runtime and partial unrolling
- UP.Partial = UP.Runtime = true;
+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,