Fabian Mora
bad2036c6e
[mlir][ptr] Extend ptr_add operation to support shaped operands ( #156374 )
...
This patch extends `ptr_add` to work with shaped types with value
semantics, both for the offsets and base.
Concretely this patch makes the following changes:
- Supports scalar-to-scalar, scalar-to-shaped, shaped-to-scalar, and
shaped-to-shaped combinations
- Adds InferTypeOpInterface for automatic result type deduction
- Adds tests for LLVM IR translation with vector operands
Example:
```mlir
func.func @ptr_add_tensor_2d(%ptrs: tensor<4x8x!ptr.ptr<#ptr.generic_space>>, %offsets: tensor<4x8xindex>) -> tensor<4x8x!ptr.ptr<#ptr.generic_space>> {
%res = ptr.ptr_add %ptrs, %offsets : tensor<4x8x!ptr.ptr<#ptr.generic_space>>, tensor<4x8xindex>
%res1 = ptr.ptr_add nuw %ptrs, %offsets : tensor<4x8x!ptr.ptr<#ptr.generic_space>>, tensor<4x8xindex>
return %res : tensor<4x8x!ptr.ptr<#ptr.generic_space>>
}
```
The motivation behind this patch is to lay the groundwork for enabling
`triton` styled loads and stores, and their variants.
---------
Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2025-09-03 15:50:21 +00:00
..
2025-09-01 12:39:58 +02:00
2025-09-03 09:44:53 +05:30
2025-02-05 18:19:36 -08:00
2025-06-12 13:45:19 +02:00
2025-06-26 10:43:36 +01:00
2025-06-27 15:37:13 +01:00
2025-01-29 16:56:47 +01:00
2025-03-14 09:30:47 +01:00
2025-05-14 11:28:57 -07:00
2025-02-11 09:39:51 +01:00
2024-10-14 08:44:24 -06:00
2025-05-28 11:07:03 -07:00
2024-11-15 13:48:01 +01:00
2024-11-08 13:56:44 +01:00
2025-02-12 07:33:22 -08:00
2025-08-29 09:52:07 +08:00
2025-04-22 13:49:58 +02:00
2025-07-17 19:20:31 +02:00
2025-04-21 10:25:56 -07:00
2025-07-31 14:10:21 +02:00
2025-02-11 09:39:51 +01:00
2025-04-01 14:27:11 +01:00
2025-08-25 17:55:04 +08:00
2025-09-01 12:39:58 +02:00
2025-04-08 20:28:24 +02:00
2025-09-01 12:39:58 +02:00
2025-07-31 14:10:21 +02:00
2025-06-10 08:25:33 -06:00
2024-11-11 14:01:50 +01:00
2024-11-11 17:11:44 +01:00
2025-09-01 15:56:31 +05:30
2025-08-27 16:32:28 -07:00
2025-05-28 17:40:34 +02:00
2025-08-18 18:15:11 +05:30
2025-02-13 08:53:59 +01:00
2025-08-07 12:23:38 -07:00
2025-08-07 12:23:38 -07:00
2025-04-25 20:41:08 -05:00
2024-10-01 16:18:36 +01:00
2025-04-25 20:41:08 -05:00
2025-04-25 20:41:08 -05:00
2025-03-20 15:48:45 +00:00
2025-07-03 10:38:28 +01:00
2025-08-11 18:47:30 +01:00
2025-07-03 10:38:28 +01:00
2025-07-03 10:38:28 +01:00
2025-07-03 10:38:28 +01:00
2025-07-03 10:38:28 +01:00
2025-07-03 10:38:28 +01:00
2025-07-03 10:38:28 +01:00
2025-07-03 10:38:28 +01:00
2025-01-14 13:07:38 +00:00
2025-02-12 10:14:00 +01:00
2025-02-17 09:45:06 -06:00
2025-06-16 10:27:48 -05:00
2025-02-13 08:53:59 +01:00
2025-01-30 18:40:34 +01:00
2025-01-15 10:16:19 +00:00
2025-06-25 07:10:08 -05:00
2025-05-19 17:26:05 -07:00
2025-05-19 17:26:05 -07:00
2025-03-20 15:48:45 +00:00
2024-11-16 12:26:29 +01:00
2025-02-17 09:45:06 -06:00
2025-06-16 10:27:48 -05:00
2025-06-16 10:27:48 -05:00
2025-03-20 15:48:45 +00:00
2025-07-03 10:38:28 +01:00
2025-05-19 17:26:05 -07:00
2025-08-21 09:03:56 +02:00
2025-05-19 17:26:05 -07:00
2024-10-01 16:18:36 +01:00
2025-03-20 15:48:45 +00:00
2025-04-25 20:41:08 -05:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2025-04-25 20:41:08 -05:00
2025-05-19 17:26:05 -07:00
2025-05-19 17:26:05 -07:00
2025-04-25 20:41:08 -05:00
2025-08-21 09:03:56 +02:00
2025-08-21 09:03:56 +02:00
2025-06-25 07:10:08 -05:00
2025-04-08 19:21:45 +02:00
2024-12-09 15:14:48 -08:00
2025-06-06 10:43:13 +01:00
2025-05-08 11:08:52 +01:00
2025-05-08 11:15:58 +01:00
2025-05-08 11:15:58 +01:00
2025-07-11 12:54:25 +02:00
2025-07-11 12:54:25 +02:00
2025-07-11 12:54:25 +02:00
2025-07-15 10:30:02 +01:00
2025-06-25 07:10:08 -05:00
2025-03-18 10:14:42 +01:00
2025-02-06 11:45:40 +01:00
2024-11-05 07:52:45 -08:00
2025-07-15 10:30:02 +01:00
2025-06-25 13:34:35 +01:00
2024-10-15 11:28:39 +01:00
2025-04-30 11:13:20 +05:30
2025-01-31 09:35:26 +00:00
2025-03-07 11:02:52 +00:00
2025-07-08 14:27:33 +01:00
2024-10-01 16:18:36 +01:00
2025-01-09 16:11:18 +01:00
2025-03-07 11:02:52 +00:00
2025-02-26 17:09:23 +00:00
2025-03-07 11:02:52 +00:00
2025-03-07 11:02:52 +00:00
2025-03-07 11:02:52 +00:00
2025-07-15 10:30:02 +01:00
2025-08-29 11:48:24 +05:30
2025-02-24 13:38:27 +00:00
2025-07-02 16:49:34 +01:00
2025-07-02 16:49:34 +01:00
2025-04-25 20:41:08 -05:00
2025-03-10 08:11:01 -05:00
2025-04-25 20:41:08 -05:00
2025-01-14 13:07:38 +00:00
2025-01-31 09:35:26 +00:00
2025-04-25 20:41:08 -05:00
2025-02-28 17:16:59 -06:00
2025-04-29 14:53:15 -05:00
2025-01-31 09:35:26 +00:00
2025-04-25 20:41:08 -05:00
2025-04-25 20:41:08 -05:00
2025-02-06 19:11:04 +01:00
2025-06-17 10:42:42 +01:00
2025-02-27 09:22:44 +00:00
2025-04-25 20:41:08 -05:00
2025-07-08 14:27:33 +01:00
2025-04-07 12:47:16 -04:00
2025-04-07 12:47:16 -04:00
2025-07-15 10:30:02 +01:00
2025-02-06 11:45:40 +01:00
2025-05-22 15:24:20 +01:00
2024-12-05 05:23:49 +01:00
2025-01-16 19:08:38 +01:00
2025-05-30 07:50:18 -06:00
2025-09-03 15:50:21 +00:00
2025-08-15 17:35:31 +02:00
2025-08-26 22:12:35 +00:00
2025-08-26 22:12:35 +00:00
2025-08-26 22:12:35 +00:00
2025-08-26 22:12:35 +00:00
2025-04-17 09:45:43 +01:00
2025-07-11 13:19:07 +02:00
2025-07-29 11:00:25 -07:00