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

Henrich Lauko via All-commits all-commits at lists.llvm.org
Sun Mar 8 06:29:13 PDT 2026


  Branch: refs/heads/users/xlauko/cir-binop-traits
  Home:   https://github.com/llvm/llvm-project
  Commit: 100450784a9a8b45201d8b60de8e5aa272494f27
      https://github.com/llvm/llvm-project/commit/100450784a9a8b45201d8b60de8e5aa272494f27
  Author: xlauko <xlauko at mail.muni.cz>
  Date:   2026-03-08 (Sun, 08 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