mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 04:24:22 +00:00
Convert PHI getIncomingValue() to foreach over incoming_values(). NFC.
We already had a method to iterate over all the incoming values of a PHI. This just changes all eligible code to use it. Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237169 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -718,8 +718,8 @@ BasicAliasAnalysis::pointsToConstantMemory(const Location &Loc, bool OrLocal) {
|
||||
Visited.clear();
|
||||
return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
|
||||
}
|
||||
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
|
||||
Worklist.push_back(PN->getIncomingValue(i));
|
||||
for (Value *IncValue : PN->incoming_values())
|
||||
Worklist.push_back(IncValue);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1477,8 +1477,7 @@ BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize,
|
||||
|
||||
SmallPtrSet<Value*, 4> UniqueSrc;
|
||||
SmallVector<Value*, 4> V1Srcs;
|
||||
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
|
||||
Value *PV1 = PN->getIncomingValue(i);
|
||||
for (Value *PV1 : PN->incoming_values()) {
|
||||
if (isa<PHINode>(PV1))
|
||||
// If any of the source itself is a PHI, return MayAlias conservatively
|
||||
// to avoid compile time explosion. The worst possible case is if both
|
||||
|
Reference in New Issue
Block a user