Fix quadratic behavior from Operation::setAttr() (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Fri, 19 May 2023 20:08:33 +0000 (13:08 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 19 May 2023 21:01:40 +0000 (14:01 -0700)
commit31511900c68df693b38decaa99dd9f8dba61ef65
treecbac4733f6aad222b360c386e5d9e46b0468f429
parente89bdc6bd714268a8598567caad15aeb22f3af84
Fix quadratic behavior from Operation::setAttr()  (NFC)

This API tries to ensure some backward compatibility for properties,
but doing so in multiple-layers was causing quadratic behavior.
Instead of `setAttrs()` repeatingly calling to `setAttr()` we inline
the logic and apply it locally in a single traversal.

Fixes #62800

Differential Revision: https://reviews.llvm.org/D150993
mlir/lib/IR/Operation.cpp