HomePhabricator

[mlir] Remove instance methods from LLVMType

Authored by ftynse on Dec 22 2020, 2:22 AM.

Description

[mlir] Remove instance methods from LLVMType

LLVMType contains multiple instance methods that were introduced initially for
compatibility with LLVM API. These methods boil down to cast followed by
type-specific call. Arguably, they are mostly used in an LLVM cast-follows-isa
anti-pattern. This doesn't connect nicely to the rest of the MLIR
infrastructure and actively prevents it from making the LLVM dialect type
system more open, e.g., reusing built-in types when appropriate. Remove such
instance methods and replaces their uses with apporpriate casts and methods on
derived classes. In some cases, the result may look slightly more verbose, but
most cases should actually use a stricter subtype of LLVMType anyway and avoid
the isa/cast.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D93680

Details

Committed
ftynseDec 22 2020, 2:34 PM
Reviewer
mehdi_amini
Differential Revision
D93680: [mlir] Remove instance methods from LLVMType
Parents
rGa781a706b961: [WebAssembly][SIMD] Rename shuffle, swizzle, and load_splats
Branches
Unknown
Tags
Unknown