[mlir][llvm] Add inbounds attriubte to the gep op.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 14 Dec 2022 09:44:11 +0000 (10:44 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 14 Dec 2022 09:46:07 +0000 (10:46 +0100)
commit7b420a1ada0775b35c6600f58ac4d5775106a723
tree8da3f846e83e06f479618f20cfcfb1d635023177
parent6f0b149f40bb1ae8da4e4584a30c405f92bd27a4
[mlir][llvm] Add inbounds attriubte to the gep op.

The revision adds an inbounds attribute to the LLVM dialect
GEP operation. It extends the builders and the import and export
to support the optional inbounds attribute.

As all builders set inbounds to false by default, existing lowerings
from higher-level dialects to LLVM dialect are not affected by the
change. Canonicalization/folding remains untouched since it currently
does not implement any simplifications in case of undefined behavior
(the handling of undefined behavior is deferred to LLVM).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D139821
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/test/Dialect/LLVMIR/canonicalize.mlir
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Target/LLVMIR/Import/instructions.ll
mlir/test/Target/LLVMIR/Import/opaque.ll
mlir/test/Target/LLVMIR/llvmir.mlir