llvm-project
d689c3ab - [DAGCombiner] Scalarize variable index extracts from sub byte vectors

Commit
16 hours ago
[DAGCombiner] Scalarize variable index extracts from sub byte vectors The type legalizer lowers a variable index extract from an illegal vector with sub byte elements through the stack, storing one byte per element. When the vector comes from a bitcast on a little endian target, element $i$ occupies bits $[i \cdot w, (i+1) \cdot w)$ of the source, so extract it with a shift of the integer word holding it. ``` t3: v64i1 = bitcast t2 t5: i1 = extract_vector_elt t3, t4 --> t6: i64 = bitcast t2 t7: i64 = srl t6, t4 t5: i1 = truncate t7 ``` On gfx1200 this replaces 64 scratch stores and a scratch load with a few VALU instructions. Byte sized elements, non bitcast sources and non power of 2 sizes are left unchanged.
Author
Committer
Parents
Loading