1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-03-01 01:30:36 +00:00

[RewriteStatepointsForGC] Missed review comment from 234651 & build fix

After submitting 234651, I noticed I hadn't responded to a review comment by mjacob.  This patch addresses that comment and fixes a Release only build problem due to an unused variable.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234653 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Philip Reames 2015-04-10 22:16:58 +00:00
parent 82374f6b8a
commit 1a6fd4d9f9

@ -382,6 +382,7 @@ static Value *findBaseDefiningValue(Value *I) {
if (auto *EEI = dyn_cast<ExtractElementInst>(I)) { if (auto *EEI = dyn_cast<ExtractElementInst>(I)) {
Value *VectorOperand = EEI->getVectorOperand(); Value *VectorOperand = EEI->getVectorOperand();
Value *VectorBase = findBaseOfVector(VectorOperand); Value *VectorBase = findBaseOfVector(VectorOperand);
(void)VectorBase;
assert(VectorBase && "extract element not known to be a trivial base"); assert(VectorBase && "extract element not known to be a trivial base");
return EEI; return EEI;
} }
@ -2060,14 +2061,14 @@ bool RewriteStatepointsForGC::runOnFunction(Function &F) {
// consider those in reachable code since we need to ask dominance queries // consider those in reachable code since we need to ask dominance queries
// when rewriting. We'll delete the unreachable ones in a moment. // when rewriting. We'll delete the unreachable ones in a moment.
SmallVector<CallSite, 64> ParsePointNeeded; SmallVector<CallSite, 64> ParsePointNeeded;
SmallVector<CallSite, 16> UnreachableStatepoints; bool HasUnreachableStatepoint = false;
for (Instruction &I : inst_range(F)) { for (Instruction &I : inst_range(F)) {
// TODO: only the ones with the flag set! // TODO: only the ones with the flag set!
if (isStatepoint(I)) { if (isStatepoint(I)) {
if (DT.isReachableFromEntry(I.getParent())) if (DT.isReachableFromEntry(I.getParent()))
ParsePointNeeded.push_back(CallSite(&I)); ParsePointNeeded.push_back(CallSite(&I));
else else
UnreachableStatepoints.push_back(CallSite(&I)); HasUnreachableStatepoint = true;
} }
} }
@ -2077,7 +2078,7 @@ bool RewriteStatepointsForGC::runOnFunction(Function &F) {
// statepoints surviving this pass. This makes testing easier and the // statepoints surviving this pass. This makes testing easier and the
// resulting IR less confusing to human readers. Rather than be fancy, we // resulting IR less confusing to human readers. Rather than be fancy, we
// just reuse a utility function which removes the unreachable blocks. // just reuse a utility function which removes the unreachable blocks.
if (!UnreachableStatepoints.empty()) if (HasUnreachableStatepoint)
MadeChange |= removeUnreachableBlocks(F); MadeChange |= removeUnreachableBlocks(F);
// Return early if no work to do. // Return early if no work to do.