[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:40 PST 2026


================

----------------
xlauko wrote:

No test here uses the switch to `adaptor.getSrc()`, since every cast operand comes straight from a cir.const. Maybe add a case where the operand is constant only through SCCP, e.g. an `int_to_bool` of a constant ternary’s result that feeds a second ternary. The old `getDefiningOp<ConstantOp>` code couldn’t fold that.

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


More information about the cfe-commits mailing list