[mlir] Fix bitwidth of memref-to-llvm constant.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 12 Oct 2022 14:12:21 +0000 (17:12 +0300)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 12 Oct 2022 14:13:01 +0000 (17:13 +0300)
commita938f3a9b58d1f7ccd2fc17c0935c12f94d41695
treeb3b91bab9497ce1ab867326d0c7576afed75979b
parent79ee0342dbf025bc70f237bdfe9ccb4e10a592ce
[mlir] Fix bitwidth of memref-to-llvm constant.

One constant generated in MemRefToLLVM had a hardcoded bitwidth of
64 bits. The fix uses the typeConverter to create a constant that
matches the bitwidth of the provided by the data layout. The issue was
detected in an attempt to add a verifier to the LLVM ICmp operation that
checks that the types of the compared arguments match.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135775
mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir