summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-04-02 22:43:49 +0000
committerHal Finkel <hfinkel@anl.gov>2014-04-02 22:43:49 +0000
commit1fb3df7a2e210e31ae111ecfaf704068061e140a (patch)
treee88f801a8828e2d0b6b1c84c4f280b519b380142
parent75cea2c73e348028cc082301ae7c8d7fe7ce1b57 (diff)
downloadllvm-1fb3df7a2e210e31ae111ecfaf704068061e140a.tar.gz
llvm-1fb3df7a2e210e31ae111ecfaf704068061e140a.tar.bz2
llvm-1fb3df7a2e210e31ae111ecfaf704068061e140a.tar.xz
[PowerPC] Make PPCTTI::getMemoryOpCost call BasicTTI::getMemoryOpCost
PPCTTI::getMemoryOpCost will now make use of BasicTTI::getMemoryOpCost to calculate the base cost of the memory access, and then adjust on top of that. There is no functionality change from this modification, but it will become important so that PPCTTI can take advantage of scalarization information for which BasicTTI::getMemoryOpCost will account in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205476 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPCTargetTransformInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
index a915b04fa5..2f4d5c1dec 100644
--- a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -241,8 +241,8 @@ unsigned PPCTTI::getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
assert((Opcode == Instruction::Load || Opcode == Instruction::Store) &&
"Invalid Opcode");
- // Each load/store unit costs 1.
- unsigned Cost = LT.first * 1;
+ unsigned Cost =
+ TargetTransformInfo::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace);
// FIXME: Update this for VSX loads/stores that support unaligned access.
@@ -250,7 +250,7 @@ unsigned PPCTTI::getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
// to be decomposed based on the alignment factor.
unsigned SrcBytes = LT.second.getStoreSize();
if (SrcBytes && Alignment && Alignment < SrcBytes)
- Cost *= (SrcBytes/Alignment);
+ Cost += LT.first*(SrcBytes/Alignment-1);
return Cost;
}