aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2021-11-22 13:19:36 +0100
committerAlex Zinenko <zinenko@google.com>2021-11-22 18:16:02 +0100
commit9c5982ef8e95a0b5acdbd0d2599fbd87526abe2e (patch)
tree2589737bcf890f7f7365b0f572d3d18e99361275 /flang/lib/Frontend/CompilerInvocation.cpp
parent774f7832fb2539b20e5e93ae675a0b7428e4f2f2 (diff)
downloadllvm-9c5982ef8e95a0b5acdbd0d2599fbd87526abe2e.zip
llvm-9c5982ef8e95a0b5acdbd0d2599fbd87526abe2e.tar.gz
llvm-9c5982ef8e95a0b5acdbd0d2599fbd87526abe2e.tar.bz2
[mlir] support recursive types in type conversion infra
MLIR supports recursive types but they could not be handled by the conversion infrastructure directly as it would result in infinite recursion in `convertType` for elemental types. Support this case by keeping the "call stack" of nested type conversions in the TypeConverter class and by passing it as an optional argument to the individual conversion callback. The callback can then check if a specific type is present on the stack more than once to detect and handle the recursive case. This approach is preferred to the alternative approach of having a separate callback dedicated to handling only the recursive case as the latter was observed to introduce ~3% time overhead on a 50MB IR file even if it did not contain recursive types. This approach is also preferred to keeping a local stack in type converters that need to handle recursive types as that would compose poorly in case of out-of-tree or cross-project extensions. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D113579
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions