[all-commits] [llvm/llvm-project] 6854d2: [CIR] Lowering for the C2Y `stdc` bit builtins (#...

Kunal Dubey via All-commits all-commits at lists.llvm.org
Mon Sep 21 17:08:51 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6854d299e83c7b08d0450bcc85f13a84d3b5a29e
      https://github.com/llvm/llvm-project/commit/6854d299e83c7b08d0450bcc85f13a84d3b5a29e
  Author: Kunal Dubey <xakep8 at protonmail.com>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
    A clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-c2y.c

  Log Message:
  -----------
  [CIR] Lowering for the C2Y `stdc` bit builtins  (#218852)

Implemented CIR lowering for the C2Y `stdc` bit builtins currently
covered by this PR.

This adds support for:

- `stdc_rotate_left_*` / `__builtin_stdc_rotate_left`
- `stdc_rotate_right_*` / `__builtin_stdc_rotate_right`
- `stdc_memreverse8u8/u16/u32/u64`
- `stdc_memreverse8` / `__builtin_stdc_memreverse8`

The rotate builtins lower to `cir.rotate`, which then lowers to the LLVM
funnel-shift intrinsics.

For `stdc_memreverse8`, CIR matches classic CodeGen behavior:

- sizes `0` and `1` are no-ops, while still evaluating the pointer
argument
- sizes `2`, `4`, and `8` lower to load / byte-swap / store
- other constant sizes and dynamic sizes fall back to a
`stdc_memreverse8` library call through the isLibFunction path

Reference to discussion in PR #214931
[here](https://github.com/llvm/llvm-project/pull/214931#discussion_r3769544573)



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