[llvm] [SimplifyCFG] Replace unreachable switch lookup table holes with poison (PR #94990)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 17:20:08 PDT 2024


================
@@ -6281,8 +6282,15 @@ SwitchLookupTable::SwitchLookupTable(
     uint64_t Idx = (CaseVal->getValue() - Offset->getValue()).getLimitedValue();
     TableContents[Idx] = CaseRes;
 
-    if (CaseRes != SingleValue)
-      SingleValue = nullptr;
+    if (CaseRes != SingleValue) {
----------------
DianQK wrote:

Sorry. It seems that `CHECK-NEXT` misled you. `poison` is a stronger UB than `undef`, so we should choose undef.

https://github.com/llvm/llvm-project/pull/94990


More information about the llvm-commits mailing list