1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Added support for "case when" (valueless) switch cases

This commit is contained in:
Brian Fiete 2020-02-23 06:14:14 -08:00
parent 3fd81fc966
commit 857c1c384a
5 changed files with 25 additions and 11 deletions

View file

@ -7576,16 +7576,14 @@ void BeMCContext::DoInstCombinePass()
continue;
auto vregInfoFrom = mVRegInfo[remapFrom];
auto vregInfoTo = mVRegInfo[remapTo];
int bestVRegIdx = (vregInfoFrom->mDefOrderIdx < vregInfoTo->mDefOrderIdx) ? remapFrom : remapTo;
int bestVRegIdx = remapTo;
//auto itr = defMap.find(remapTo);
//if (itr != defMap.end())
int* prevBestVRegIdxPtr = NULL;
if (defMap.TryGetValue(remapTo, &prevBestVRegIdxPtr))
{
auto prevBestVRegIdx = *prevBestVRegIdxPtr;
if (mVRegInfo[bestVRegIdx]->mDefOrderIdx < mVRegInfo[prevBestVRegIdx]->mDefOrderIdx)
defMap[remapTo] = bestVRegIdx;
}
else
defMap[remapTo] = bestVRegIdx;