[Mlir-commits] [mlir] [mlir][llvm] Add zeroinitializer constant (PR #65508)
Vinicius Couto Espindola
llvmlistbot at llvm.org
Thu Sep 7 04:23:40 PDT 2023
sitio-couto wrote:
> How does this relate to llvm.mlir.null?
The `llvm.mlir.zero` is essentially more generic. It can work with most LLVM types (aggregate or not) as far as I tested.
> Can we also initialize pointers with llvm.mlir.zero and remove llvm.mlir.null in favor of the more general operation?
Yes! On the builder side, it should behave exactly the same, since `llvm::Constant::getNullValue` will call `llvm::ConstantPointerNull::get`. But since `llvm.mlir.null` implies a pointer (e.g. return type is always a pointer), there might be API calls and passes that will have to be updated to work with the more generic `llvm.mlir.zero` op.
https://github.com/llvm/llvm-project/pull/65508
More information about the Mlir-commits
mailing list