llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
388 stars 99 forks source link

[CIR][FlattenCFG] Fix rewrite API misuse #1163

Closed smeenai closed 3 days ago

smeenai commented 3 days ago

We need to perform all erasures via the rewrite API instead of directly for the framework to work correctly. This was detected by a combination of -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON [1] and ASAN.

[1] https://mlir.llvm.org/getting_started/Debugging/#detecting-invalid-api-usage

bcardosolopes commented 3 days ago

Should we enable -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON in CI? Sounds like a net win!