[clang] [CIR] Add lowering for long-double increment/decrement (PR #190812)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 12:17:56 PDT 2026


================
@@ -694,7 +694,8 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
         return {};
       }
 
-      if (mlir::isa<cir::SingleType, cir::DoubleType>(value.getType())) {
+      if (mlir::isa<cir::SingleType, cir::DoubleType, cir::LongDoubleType>(
+              value.getType())) {
----------------
andykaylor wrote:

I just looked again at the incubator and classic codegen, and I have a partial idea of what happened. Classic codegen implements this as an `fadd` and so it needs to construct an APFloat of `1.0`, which requires type-specific float semantics. The incubator followed the classic codegen handling for types other than float or double for some reason but used a CIR-specific unary operation for float and double. I can't see any good reason that we shouldn't use `cir.inc/cir.dec` for all FP types, after the special handling for half.

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


More information about the cfe-commits mailing list