This patch memorizes compatible LLVM types in LLVM::isCompatibleType in order to avoid redundant works.
This is especially useful when the size of program is big and there are multiple occurrences of some deeply nested LLVM struct types, in which case we can gain quite some speedups with this patch.
Existing tests should be sufficient to cover the changes here.
I wouldn't really want these to be publicly exposed. Can you make the isCompatibleType a static function of LLVMDialect?