[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue May 20 15:43:49 PDT 2025
================
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) {
emitLValue(e);
}
+// Handle the case where the condition is a constant evaluatable simple integer,
+// which means we don't have to separately handle the true/false blocks.
+static std::optional<LValue> handleConditionalOperatorLValueSimpleCase(
----------------
andykaylor wrote:
I would prefer to see it happen in CIRSimplify. Especially in the case of a ternary operator, I wouldn't expect it to be common for there to be a lot of dead code.
https://github.com/llvm/llvm-project/pull/138156
More information about the cfe-commits
mailing list