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:
parent
3fd81fc966
commit
857c1c384a
5 changed files with 25 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue