[all-commits] [llvm/llvm-project] 0ca2d4: [mlir][emitc] mark `emitc.load` with `CExpression`...

Kirill Chibisov via All-commits all-commits at lists.llvm.org
Tue Apr 22 00:04:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ca2d4d10451874b1d107e89c32eb7fd95e1a608
      https://github.com/llvm/llvm-project/commit/0ca2d4d10451874b1d107e89c32eb7fd95e1a608
  Author: Kirill Chibisov <contact at kchibisov.com>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
    M mlir/lib/Target/Cpp/TranslateToCpp.cpp
    M mlir/test/Dialect/EmitC/transforms.mlir
    M mlir/test/Target/Cpp/expressions.mlir

  Log Message:
  -----------
  [mlir][emitc] mark `emitc.load` with `CExpression` (#130802)

Follow the `call` and `call_opaque` operations, as well as `apply`,
which already are marked as `CExpression` even though they have side
effects.

Even though `emitc.load` can be included inside the `emitc.expression`,
the inlining and `--form-expression` pass won't actually inline them
inside other expression due to it having a side effect, thus unless the
user manually writes the `emitc.load` inside the `emitc.expression` it
won't appear there.

--

It was brought
https://github.com/llvm/llvm-project/pull/91475#issuecomment-2302529428
and while there was some opposition due to `load` having a side effect,
`emitc` already allows all the rest operations that have it, so for
consistency reasons, enabling it doesn't really hurt from my point of
view. Especially given that `--form-expression` doesn't allow
it to really inline inside other expressions, which makes sense, since
if the users want such behavior, they should explicitly opt-in.



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