It is quite common for the same type to be converted many types throughout the conversion process, and there isn't any good reason why we aren't caching that result. Especially given that we currently use identity conversion to signify legality. This revision also adds a few additional helpers to TypeConverter.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Transforms/DialectConversion.cpp | ||
---|---|---|
1745 | I may be missing something, but doesn't DenseMap::lookup return a default-constructed ValueTy on failure? This will be a null Type in our case. Then: (a) we ignore cached conversion failures because we never enter this block; (b) the checks on cachedConversion not being null inside the block are spurious. |
mlir/lib/Transforms/DialectConversion.cpp | ||
---|---|---|
1745 | Oops, thanks for the catch. Forgot to update this after things changed. |
I may be missing something, but doesn't DenseMap::lookup return a default-constructed ValueTy on failure? This will be a null Type in our case. Then: (a) we ignore cached conversion failures because we never enter this block; (b) the checks on cachedConversion not being null inside the block are spurious.