[all-commits] [llvm/llvm-project] 04686f: [CIR] Refactor IntType constraints

Henrich Lauko via All-commits all-commits at lists.llvm.org
Thu May 1 03:33:16 PDT 2025


  Branch: refs/heads/users/xlauko/cir-type-constraints
  Home:   https://github.com/llvm/llvm-project
  Commit: 04686fcc47ad570276ce0165ac30ddaf195f1524
      https://github.com/llvm/llvm-project/commit/04686fcc47ad570276ce0165ac30ddaf195f1524
  Author: xlauko <xlauko at mail.muni.cz>
  Date:   2025-05-01 (Thu, 01 May 2025)

  Changed paths:
    M clang/include/clang/CIR/Dialect/IR/CIROps.td
    A clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td
    M clang/include/clang/CIR/Dialect/IR/CIRTypes.h
    M clang/include/clang/CIR/Dialect/IR/CIRTypes.td
    M clang/include/clang/CIR/Dialect/IR/CMakeLists.txt
    M clang/lib/CIR/Dialect/IR/CIRTypes.cpp
    M clang/lib/CIR/Dialect/IR/CMakeLists.txt

  Log Message:
  -----------
  [CIR] Refactor IntType constraints

- Adds `CIR_` prefixes to integer type constraints types to disambiguate their names from other dialects.
- Renames `PrimitiveInt` to `CIR_AnyFundamentalIntType` to align more with constrian conventions.
- Adds bunch of helper constraint classes to be able to define base types to reduce clutter of necessary type casts.
- Reworks constraints to use `CIR_ConfinedType` to avoid repeating validation checks.
- Adds `IntOfWidths` variadic bitwidth constraint to reduce boilerplate code needed to handle multi-bitwidth parameters.
- Constraints are moved into a separate file, which starts decoupling of constraints and types to remove the cyclic dependency between types and attributes and will eventually help fix several outstanding TODOs.

This mirrors incubator changes from https://github.com/llvm/clangir/pull/1593



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