File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -6531,17 +6531,8 @@ SwitchLookupTable::SwitchLookupTable(
6531
6531
uint64_t Idx = (CaseVal->getValue () - Offset->getValue ()).getLimitedValue ();
6532
6532
TableContents[Idx] = CaseRes;
6533
6533
6534
- if (SingleValue && CaseRes != SingleValue) {
6535
- if (isa<PoisonValue>(SingleValue)) {
6536
- // All of the switch cases until now have returned poison.
6537
- // If this case returns a non-poison value, ignore the previous
6538
- // poisons and use this case's result as the single constant
6539
- // value.
6540
- if (!isa<PoisonValue>(CaseRes))
6541
- SingleValue = CaseRes;
6542
- } else if (!isa<PoisonValue>(CaseRes))
6543
- SingleValue = nullptr ;
6544
- }
6534
+ if (SingleValue && !isa<PoisonValue>(CaseRes) && CaseRes != SingleValue)
6535
+ SingleValue = isa<PoisonValue>(SingleValue) ? CaseRes : nullptr ;
6545
6536
}
6546
6537
6547
6538
// Fill in any holes in the table with the default result.
You can’t perform that action at this time.
0 commit comments