[clang] [CIR] Upstream missing support for floating point unary operator (PR #193215)

Haocong Lu via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 22:10:25 PDT 2026


================
@@ -690,18 +690,27 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
 
       if (type->isHalfType() &&
           !cgf.getContext().getLangOpts().NativeHalfType) {
-        cgf.cgm.errorNYI(e->getSourceRange(), "Unary inc/dec half");
-        return {};
+        // Another special case: half FP increment should be done via float
+        if (cgf.getContext().getTargetInfo().useFP16ConversionIntrinsics()) {
----------------
Luhaocong wrote:

done

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


More information about the cfe-commits mailing list