[all-commits] [llvm/llvm-project] 04fa24: [CIR] Add Commutative/Idempotent traits to binary ops

Henrich Lauko via All-commits all-commits at lists.llvm.org
Sat Mar 7 03:54:06 PST 2026


  Branch: refs/heads/users/xlauko/cir-binop-traits
  Home:   https://github.com/llvm/llvm-project
  Commit: 04fa24498b601e9beeb9cd67218097553e42992c
      https://github.com/llvm/llvm-project/commit/04fa24498b601e9beeb9cd67218097553e42992c
  Author: xlauko <xlauko at mail.muni.cz>
  Date:   2026-03-07 (Sat, 07 Mar 2026)

  Changed paths:
    M clang/include/clang/CIR/Dialect/IR/CIROps.td
    M clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
    M clang/test/CIR/CodeGen/binop.cpp
    M clang/test/CIR/CodeGen/new.cpp
    M clang/test/CIR/CodeGen/size-of-vla.cpp
    M clang/test/CIR/CodeGen/throws.cpp
    M clang/test/CIR/CodeGen/vla.c
    A clang/test/CIR/Transforms/binop-traits.cir

  Log Message:
  -----------
  [CIR] Add Commutative/Idempotent traits to binary ops

Add missing MLIR traits to CIR binary operations, matching the arith
dialect conventions:

- AndOp, OrOp: Commutative, Idempotent (fixes FIXME)
- AddOp, MulOp, XorOp, MaxOp: Commutative

Add these ops to the CIRCanonicalize pass op list so trait-based
folding is exercised by applyOpPatternsGreedily.

Update testFloatingPointBinOps in binop.cpp to use computed values,
preventing DCE of the now-canonicalized ops.



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