File tree Expand file tree Collapse file tree 2 files changed +5
-46
lines changed Expand file tree Collapse file tree 2 files changed +5
-46
lines changed Original file line number Diff line number Diff line change @@ -1539,20 +1539,13 @@ namespace {
1539
1539
std::tie (payloadTag, extraTag) = getNoPayloadCaseValue (Case);
1540
1540
1541
1541
auto &ti = getFixedPayloadTypeInfo ();
1542
-
1542
+ bool hasExtraInhabitants = ti.getFixedExtraInhabitantCount (IGF.IGM ) > 0 ;
1543
+
1543
1544
llvm::Value *payloadResult = nullptr ;
1544
- // We can omit the payload check if this is the only case represented with
1545
- // the particular extra tag bit pattern set.
1546
- //
1547
- // TODO: This logic covers the most common case, when there's exactly one
1548
- // more no-payload case than extra inhabitants in the payload. This could
1549
- // be slightly generalized to cases where there's multiple tag bits and
1550
- // exactly one no-payload case in the highest used tag value.
1551
- if (!tagBits ||
1552
- ElementsWithNoPayload.size () != getFixedExtraInhabitantCount (IGF.IGM )+1 )
1553
- payloadResult = payload.emitCompare (IGF,
1545
+ if (hasExtraInhabitants)
1546
+ payloadResult = payload.emitCompare (IGF,
1554
1547
ti.getFixedExtraInhabitantMask (IGF.IGM ),
1555
- payloadTag);
1548
+ payloadTag);
1556
1549
1557
1550
// If any tag bits are present, they must match.
1558
1551
llvm::Value *tagResult = nullptr ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments