[Mlir-commits] [mlir] [mlir] Revert to old fold logic in IR::Dialect::add{Types, Attributes}() (PR #79582)

Andrei Golubev llvmlistbot at llvm.org
Sat Jan 27 02:33:50 PST 2024


andrey-golubev wrote:

> LG, but what's the tradeoff? Is this code less efficient somehow in any way?

Not that I know of. I guess it got replaced with fold expressions since this is what such cases should really be (and they weren't fold expressions since it was pre-C++17). Unfortunately, turns out there are (strange) limitations for fold expressions (perhaps someone used a fixed-size array in Clang to parse these so now one gets the error mentioned in the commit msg by default).

Thinking about it, the "restored" version might be slower to compile: there's a type lookup (`std::initializer_list`) plus the AST is bigger (comma operator between expressions, etc.) but I'm not sure whether this matters significantly. 

https://github.com/llvm/llvm-project/pull/79582


More information about the Mlir-commits mailing list