From 8390fa2e092bfc8824f78edb344d2142b6818c06 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Wed, 18 Dec 2024 21:29:43 -0600 Subject: [PATCH] Remove unnecessary bounds checks. (#199) Signed-off-by: Ilya Enkovich --- third_party/cpu/include/TritonCPUTransforms/OptCommon.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/third_party/cpu/include/TritonCPUTransforms/OptCommon.h b/third_party/cpu/include/TritonCPUTransforms/OptCommon.h index 09e7ec65595d..c3fe3973ce0b 100644 --- a/third_party/cpu/include/TritonCPUTransforms/OptCommon.h +++ b/third_party/cpu/include/TritonCPUTransforms/OptCommon.h @@ -149,9 +149,12 @@ inline Value shapeCast(Location loc, Value in, #define op_sitofp(ty, val) rewriter.create(loc, ty, val) #define op_fptosi(ty, val) rewriter.create(loc, ty, val) #define op_read(ty, memRef, indices) \ - rewriter.create(loc, ty, memRef, indices) + rewriter.create( \ + loc, ty, memRef, indices, SmallVector(ty.getRank(), true)) #define op_write(val, memRef, indices) \ - rewriter.create(loc, val, memRef, indices) + rewriter.create( \ + loc, val, memRef, indices, \ + SmallVector(cast(val.getType()).getRank(), true)) #define op_interleave(lhs, rhs) \ rewriter.create(loc, lhs, rhs) #define op_extract(vec, idx) rewriter.create(loc, vec, idx)