mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Fix switch_to_lookup_table.ll test from r163302.
The lookup tables did not get built in a deterministic order. This makes them get built in the order that the corresponding phi nodes were found. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3190,13 +3190,14 @@ static bool SwitchToLookupTable(SwitchInst *SI,
|
||||
SmallDenseMap<PHINode*, Constant*> SingleResults;
|
||||
|
||||
Module &Mod = *CommonDest->getParent()->getParent();
|
||||
for (SmallDenseMap<PHINode*, ResultListTy>::iterator I = ResultLists.begin(),
|
||||
E = ResultLists.end(); I != E; ++I) {
|
||||
PHINode *PHI = I->first;
|
||||
for (SmallVector<PHINode*, 4>::iterator I = PHIs.begin(), E = PHIs.end();
|
||||
I != E; ++I) {
|
||||
PHINode *PHI = *I;
|
||||
|
||||
Constant *SingleResult = NULL;
|
||||
LookupTables[PHI] = BuildLookupTable(Mod, TableSize, MinCaseVal, I->second,
|
||||
DefaultResults[PHI], &SingleResult);
|
||||
LookupTables[PHI] = BuildLookupTable(Mod, TableSize, MinCaseVal,
|
||||
ResultLists[PHI], DefaultResults[PHI],
|
||||
&SingleResult);
|
||||
SingleResults[PHI] = SingleResult;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user