[clang] [CIR] Fold constant int/bool casts and narrow a constant ternary's re… (PR #241645)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 06:48:41 PST 2026


================
@@ -0,0 +1,34 @@
+// RUN: cir-opt %s --sccp | FileCheck %s
+
+!s32i = !cir.int<s, 32>
+
+module {
+  // A constant condition enters only one region, so the other arm's value does
+  // not reach the result.
+  cir.func @const_cond(%arg0: !s32i) -> !s32i {
+    %0 = cir.const #cir.bool<true> : !cir.bool
----------------
xlauko wrote:

Nit: #true, like the rest of the PR.

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


More information about the cfe-commits mailing list