Avoid overflow when lowering linalg.slice
authorNicolas Vasilache <ntv@google.com>
Thu, 22 Aug 2019 19:46:30 +0000 (12:46 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 22 Aug 2019 19:47:01 +0000 (12:47 -0700)
commit6f1d4bb8dfde5023aad26319e14d7e051dfc4d95
treede0e98ee0455198ed6bea0fd291a2b02003c0861
parent140b28ec129f4f0906150f04b702978f08d7d87e
Avoid overflow when lowering linalg.slice

linalg.subview used to lower to a slice with a bounded range resulting in correct bounded accesses. However linalg.slice could still index out of bounds. This CL moves the bounding to linalg.slice.

LLVM select and cmp ops gain a more idiomatic builder.

PiperOrigin-RevId: 264897125
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
mlir/test/Linalg/llvm.mlir