mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
Revert the business end of r164634, and replace it with a different fix. The
reason we were getting two of the same alloca is because of a memmove/memcpy which had the same alloca in both the src and dest. Now we detect that case directly. This has the same testcase as before, but fixes a clang test CodeGenObjC/exceptions.m which runs clang -O2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164636 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2228,7 +2228,10 @@ private:
|
|||||||
// alloca that should be re-examined after rewriting this instruction.
|
// alloca that should be re-examined after rewriting this instruction.
|
||||||
if (AllocaInst *AI
|
if (AllocaInst *AI
|
||||||
= dyn_cast<AllocaInst>(OtherPtr->stripInBoundsOffsets()))
|
= dyn_cast<AllocaInst>(OtherPtr->stripInBoundsOffsets()))
|
||||||
Pass.Worklist.insert(AI);
|
// Don't revisit the alloca if both sides of the memory transfer are
|
||||||
|
// referring to the same alloca.
|
||||||
|
if (AI != &NewAI)
|
||||||
|
Pass.Worklist.insert(AI);
|
||||||
|
|
||||||
if (EmitMemCpy) {
|
if (EmitMemCpy) {
|
||||||
Value *OurPtr
|
Value *OurPtr
|
||||||
@ -3108,12 +3111,6 @@ bool SROA::promoteAllocas(Function &F) {
|
|||||||
if (PromotableAllocas.empty())
|
if (PromotableAllocas.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Ensure that the list is unique.
|
|
||||||
std::sort(PromotableAllocas.begin(), PromotableAllocas.end());
|
|
||||||
PromotableAllocas.erase(std::unique(PromotableAllocas.begin(),
|
|
||||||
PromotableAllocas.end()),
|
|
||||||
PromotableAllocas.end());
|
|
||||||
|
|
||||||
NumPromoted += PromotableAllocas.size();
|
NumPromoted += PromotableAllocas.size();
|
||||||
|
|
||||||
if (DT && !ForceSSAUpdater) {
|
if (DT && !ForceSSAUpdater) {
|
||||||
|
Reference in New Issue
Block a user