[all-commits] [llvm/llvm-project] 743e4d: [CIR] Fix void ternary operators- (#184691)

Erich Keane via All-commits all-commits at lists.llvm.org
Thu Mar 5 06:30:29 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 743e4df2e24f77278aeb65a1776984b4b8fb247a
      https://github.com/llvm/llvm-project/commit/743e4df2e24f77278aeb65a1776984b4b8fb247a
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M clang/lib/CIR/Dialect/IR/CIRDialect.cpp
    M clang/test/CIR/CodeGen/ternary.cpp

  Log Message:
  -----------
  [CIR] Fix void ternary operators- (#184691)

I discovered this while working on something else, but we were doing a
'getTerminator' on a block that we didn't know whether it had a
terminator, and MLIR causes an assert in this case. This patch
re-factors the code to better check whether it might have a terminator
(to assuage the assert in mlir::Block), and get the correct value out.

The fixup later in the ternary setup correctly gets the 'void' yields
correct, so everything else gets fixed eventually.



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