mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
MemCpyOpt: When merging memsets also merge the trivial case of two memsets with the same destination.
The testcase is from PR19092, but I think the bug described there is actually a clang issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203489 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -75,6 +75,13 @@ static bool IsPointerOffset(Value *Ptr1, Value *Ptr2, int64_t &Offset,
|
||||
const DataLayout &TD) {
|
||||
Ptr1 = Ptr1->stripPointerCasts();
|
||||
Ptr2 = Ptr2->stripPointerCasts();
|
||||
|
||||
// Handle the trivial case first.
|
||||
if (Ptr1 == Ptr2) {
|
||||
Offset = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
GEPOperator *GEP1 = dyn_cast<GEPOperator>(Ptr1);
|
||||
GEPOperator *GEP2 = dyn_cast<GEPOperator>(Ptr2);
|
||||
|
||||
|
Reference in New Issue
Block a user