Revert 165732 for further review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Micah Villmow
2012-10-11 21:27:41 +00:00
parent d9a3bad448
commit fb384d61c7
40 changed files with 109 additions and 188 deletions

View File

@@ -174,11 +174,10 @@ bool MemsetRange::isProfitableToUseMemset(const DataLayout &TD) const {
// this width can be stored. If so, check to see whether we will end up
// actually reducing the number of stores used.
unsigned Bytes = unsigned(End-Start);
unsigned AS = cast<StoreInst>(TheStores[0])->getPointerAddressSpace();
unsigned NumPointerStores = Bytes/TD.getPointerSize(AS);
unsigned NumPointerStores = Bytes/TD.getPointerSize();
// Assume the remaining bytes if any are done a byte at a time.
unsigned NumByteStores = Bytes - NumPointerStores*TD.getPointerSize(AS);
unsigned NumByteStores = Bytes - NumPointerStores*TD.getPointerSize();
// If we will reduce the # stores (according to this heuristic), do the
// transformation. This encourages merging 4 x i8 -> i32 and 2 x i16 -> i32