[all-commits] [llvm/llvm-project] ab9644: [CIR] Update CIR unary operations (#201727)

Andy Kaylor via All-commits all-commits at lists.llvm.org
Fri Jun 5 12:46:40 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab9644ac1733b30e5947a65f0e11946bb9d56895
      https://github.com/llvm/llvm-project/commit/ab9644ac1733b30e5947a65f0e11946bb9d56895
  Author: Andy Kaylor <akaylor at nvidia.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
    M clang/include/clang/CIR/Dialect/IR/CIROps.td
    M clang/lib/CIR/CodeGen/CIRGenBuilder.h
    M clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
    M clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
    M clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
    M clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
    M clang/lib/CIR/Dialect/IR/CIRDialect.cpp
    M clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
    M clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
    M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
    M clang/test/CIR/CodeGen/complex-builtins.cpp
    M clang/test/CIR/CodeGen/complex-unary.cpp
    M clang/test/CIR/CodeGen/long-double-inc-dec.cpp
    M clang/test/CIR/CodeGen/unary.cpp
    M clang/test/CIR/CodeGenOpenACC/atomic-update.cpp
    M clang/test/CIR/IR/unary.cir
    M clang/test/CIR/Transforms/canonicalize.cir
    M clang/test/CodeGen/AArch64/neon/fullfp16.c

  Log Message:
  -----------
  [CIR] Update CIR unary operations (#201727)

This creates a floating-point-specific FNegOp and updates the type
constraints on the existing unary operations to match the types that are
actually produced by the Clang AST.

This change also moves complex types out of the unary operations. A
ComplexConjOp is added to handle what was previously being incorrectly
referred to as "not", while inc, dec, and minus are just expanded to
their component representation during codegen. We may want to consider
adding operations like cir.complex.add later, but for now I'm just
removing this type from the unary ops. I'm doing this for two reasons:
(1) the old use was inconsistent with how we handle other arithmetic
operations on complex types, and (2) I will soon need to attach
FP-specific attributes to add and subtract of complex types (and so also
inc and dec).

Assisted-by: Cursor / claude-opus-4.8



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list