[llvm] [SimplifyCFG] Ensure selects have not been constant folded in `foldSwitchToSelect` (PR #161153)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 07:38:26 PDT 2025


================
@@ -755,6 +755,25 @@ bb3:
   ret i1 %phi
 }
 
+define i32 @negative_constfold_select() {
+; CHECK-LABEL: @negative_constfold_select(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i32 poison
+;
+entry:
+  switch i32 poison, label %default [
----------------
mtrofin wrote:

would it be legal for the `switch` have a `!prof`? If not, we can add a "0" entry count for the function, to exclude it from profcheck's attention.

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


More information about the llvm-commits mailing list