[all-commits] [llvm/llvm-project] 8a50e7: [CIR] Switch FlattenCFGPass to no longer use greed...

Erich Keane via All-commits all-commits at lists.llvm.org
Wed Jul 29 14:23:37 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a50e79aabbde1b669c939c35b752864d25af2eb
      https://github.com/llvm/llvm-project/commit/8a50e79aabbde1b669c939c35b752864d25af2eb
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2026-07-29 (Wed, 29 Jul 2026)

  Changed paths:
    M clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp

  Log Message:
  -----------
  [CIR] Switch FlattenCFGPass to no longer use greedy manager. (#211368)

This showed up doing a self-build of MLIR's Presburger
IntegerRelation.cpp, which is a bit pathalogical. It resulted in us
doing a lot of rewrite patterns during flatten, taking about 20s. After
this patch, we're down to sub-1s spent doing that.

This is because applyOpPatternsGreedily was re-enqueing every child
opops every time we modified anything nearby. This caused us in cases
where there were operations that were visited TONS of times just because
a parent got modified.

This patch replaces this with a very simple inside-out iteration of
these operations. The recent loop-op 'cleanup' flattening modification
necessitates us re-visiting these sometimes (hence the loop).

This patch is effectively 'NFC' other than build time, so there really
isn't a test I could write.

AI: Note: I've used Claude Opus 4.8 to help me with this patch. I've
read/attempted to comprehend as much of this as possible, but I'm still
pretty inexperienced as to how to manage passes/etc. Claude promises me
this is the best way, and I haven't been able to find anything better
grepping around other transformations in other projects, but please
comment if you have a better idea!



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