aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorDmitry Chigarev <dmitry.chigarev@intel.com>2025-09-19 11:12:14 +0200
committerGitHub <noreply@github.com>2025-09-19 11:12:14 +0200
commitc4617bcae1308cf256bbd3738065eba2a4be8eb2 (patch)
tree309be97cd500d9cc0a292a3cbced4739acee9348 /clang/lib/AST/ByteCode/Compiler.cpp
parent771c94c8db14b990a38c95977f708e9480020244 (diff)
downloadllvm-c4617bcae1308cf256bbd3738065eba2a4be8eb2.zip
llvm-c4617bcae1308cf256bbd3738065eba2a4be8eb2.tar.gz
llvm-c4617bcae1308cf256bbd3738065eba2a4be8eb2.tar.bz2
[MLIR][XeGPU][VectorToXeGPU] Add lowering from vector.gather/scatter to xegpu.load/store (#158024)
Lowering for `vector.gather`/`vector.scatter` into `xegpu.load`/`xegpu.store`. High level steps to lower vector.gather/scatter: ``` %0 = vector.gather %source[%off1, %off2, %off3][%indices], %mask, %pass_thru : memref<8x16x32xf32>, vector<8xindex>, vector<8xi1>, vector<8xf32> into vector<8xf32> ``` 1. Compute strides and a memref offset for the `%source` memref using `computeMemrefMeta` func from the transfer_read/write lowering 2. Compute a linear offset like `%lin_off = %base_offset + %off1 * strides#0 + %off2 * strides#1 + %off3 * strides#2` 3. Combine the linear offset with `%indices`: `%off = (broadcast %lin_off : index to vector<8xindex>) + %indices * strides#2` 4. Convert memref to an i64: `%flat_memref = memref.extract_aligned_pointer_as_index %source + arith.index_cast` 5. Perform load/store: `%vec = xegpu.load %flat_memref[%off], %mask` 6. Apply selection to propagate values from the pass_thru vector: `%res = arith.select %mask, %vec, %pass_thru`
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
0 files changed, 0 insertions, 0 deletions