diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-12 01:43:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-12 01:43:46 +0000 |
commit | 2d5c0cd197454408531cd53e4dd65a431e07ba6f (patch) | |
tree | 3827da659275cc4ce8d0ea3e72d5a7c4c3fd0ba9 /lib/Transforms/Scalar/MemCpyOptimizer.cpp | |
parent | 676943b31aaa5c298a978b0acd7aa00015c22482 (diff) | |
download | external_llvm-2d5c0cd197454408531cd53e4dd65a431e07ba6f.zip external_llvm-2d5c0cd197454408531cd53e4dd65a431e07ba6f.tar.gz external_llvm-2d5c0cd197454408531cd53e4dd65a431e07ba6f.tar.bz2 |
revert r123149, reenabling an improvement to memcpyopt that wasn't
the source of the bootstrap problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/MemCpyOptimizer.cpp')
-rw-r--r-- | lib/Transforms/Scalar/MemCpyOptimizer.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 6de5ef1..3327b76 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -71,14 +71,13 @@ static int64_t GetOffsetFromIndex(const GetElementPtrInst *GEP, unsigned Idx, /// be &A[42], and Ptr2 might be &A[40]. In this case offset would be -8. static bool IsPointerOffset(Value *Ptr1, Value *Ptr2, int64_t &Offset, const TargetData &TD) { - //Ptr1 = Ptr1->stripPointerCasts(); - //Ptr2 = Ptr2->stripPointerCasts(); + Ptr1 = Ptr1->stripPointerCasts(); + Ptr2 = Ptr2->stripPointerCasts(); GetElementPtrInst *GEP1 = dyn_cast<GetElementPtrInst>(Ptr1); GetElementPtrInst *GEP2 = dyn_cast<GetElementPtrInst>(Ptr2); bool VariableIdxFound = false; -#if 0 // If one pointer is a GEP and the other isn't, then see if the GEP is a // constant offset from the base, as in "P" and "gep P, 1". if (GEP1 && GEP2 == 0 && GEP1->getOperand(0)->stripPointerCasts() == Ptr2) { @@ -90,7 +89,6 @@ static bool IsPointerOffset(Value *Ptr1, Value *Ptr2, int64_t &Offset, Offset = GetOffsetFromIndex(GEP2, 1, VariableIdxFound, TD); return !VariableIdxFound; } -#endif // Right now we handle the case when Ptr1/Ptr2 are both GEPs with an identical // base. After that base, they may have some number of common (and |