[llvm] r267507 - [SROA] Don't falsely report that changes have occured
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 25 18:05:00 PDT 2016
Author: majnemer
Date: Mon Apr 25 20:05:00 2016
New Revision: 267507
URL: http://llvm.org/viewvc/llvm-project?rev=267507&view=rev
Log:
[SROA] Don't falsely report that changes have occured
We would report that the function changed despite creating no new
allocas or performing any promotion.
This fixes PR27316.
Modified:
llvm/trunk/lib/Transforms/Scalar/SROA.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=267507&r1=267506&r2=267507&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Mon Apr 25 20:05:00 2016
@@ -3920,15 +3920,19 @@ AllocaInst *SROA::rewritePartition(Alloc
Worklist.insert(NewAI);
}
} else {
- // If we can't promote the alloca, iterate on it to check for new
- // refinements exposed by splitting the current alloca. Don't iterate on an
- // alloca which didn't actually change and didn't get promoted.
- if (NewAI != &AI)
- Worklist.insert(NewAI);
-
// Drop any post-promotion work items if promotion didn't happen.
while (PostPromotionWorklist.size() > PPWOldSize)
PostPromotionWorklist.pop_back();
+
+ // We couldn't promote and we didn't create a new partition, nothing
+ // happened.
+ if (NewAI == &AI)
+ return nullptr;
+
+ // If we can't promote the alloca, iterate on it to check for new
+ // refinements exposed by splitting the current alloca. Don't iterate on an
+ // alloca which didn't actually change and didn't get promoted.
+ Worklist.insert(NewAI);
}
return NewAI;
More information about the llvm-commits
mailing list