ClassID is a bit janky right now as it involves passing a magic pointer around. This revision hides the internal implementation mechanism within a new class TypeID. This class is a value-typed wrapper around the original ClassID implementation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems like a big change. I don't know if it's worthwhile breaking it down first (like const ClassID * -> TypeID, as a separate change). Might be hard to get the const correctness right, I guess.
mlir/include/mlir/IR/Location.h | ||
---|---|---|
280 | getTypeID()? | |
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
44–45 | rename seems unrelated? | |
mlir/lib/IR/Location.cpp | ||
133 | maybe getTypeID()? |
Yeah, happy to split it. I mainly wanted one patch to make it easier for me to transfer to my windows machine.
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
---|---|---|
44–45 | It's actually not, as the name of this pass matches the one for the other LICM. |
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
---|---|---|
44–45 | That has me concerned with the mechanism here if it can't differentiate. |
Update
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
---|---|---|
44–45 | I discovered a magic incantation to get things to link properly across DLLs, but it requires a combo of dllexport/dllimport which LLVM doesn't even use now. We can punt until linking across DLLs becomes a problem. In the meantime this refactoring is still valuable. |
mlir/include/mlir/Support/TypeID.h | ||
---|---|---|
24 | I would extend a bit the description with more info about the intended use and how it work. |
getTypeID()?