[clang] [NFC][Codegen] Remove dead switch cases (PR #195772)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 18:31:44 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

<details>
<summary>Changes</summary>

Static analysis flagged these cases as dead code b/c the `& RoundingMask` mask ensured that the other switch cases completely covered the results.

---
Full diff: https://github.com/llvm/llvm-project/pull/195772.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/TargetBuiltins/X86.cpp (-4) 


``````````diff
diff --git a/clang/lib/CodeGen/TargetBuiltins/X86.cpp b/clang/lib/CodeGen/TargetBuiltins/X86.cpp
index 9645ed87b8ef3..49c1da4e447e7 100644
--- a/clang/lib/CodeGen/TargetBuiltins/X86.cpp
+++ b/clang/lib/CodeGen/TargetBuiltins/X86.cpp
@@ -102,8 +102,6 @@ static Value *emitX86RoundImmediate(CodeGenFunction &CGF, Value *X,
     case 0b11:
       ID = Intrinsic::experimental_constrained_trunc;
       break;
-    default:
-      llvm_unreachable("Invalid rounding mode");
     }
 
     Function *F = CGF.CGM.getIntrinsic(ID, X->getType());
@@ -123,8 +121,6 @@ static Value *emitX86RoundImmediate(CodeGenFunction &CGF, Value *X,
   case 0b11:
     ID = Intrinsic::trunc;
     break;
-  default:
-    llvm_unreachable("Invalid rounding mode");
   }
 
   Function *F = CGF.CGM.getIntrinsic(ID, X->getType());

``````````

</details>


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


More information about the cfe-commits mailing list