[LLVMdev] Vector DAG Patterns

Conor Mac Aoidh conormacaoidh at gmail.com
Tue Jul 23 04:03:39 PDT 2013


Hi All,

Been having a problem constructing a suitable pattern to represent some 
vector operations in the DAG. Stuff like andx/orx operations where 
elements of a vector are anded/ored together.

My approach thus far has been to extract the sub elements of the vector 
and and/or those elements. This is ok for 4 vectors of i32s, but becomes 
cumbersome for v16i8s. Example instruction:

andx $dst $v1

Pattern:

[(set RC:$dst,
    (and (i32 (vector_extract(vt VC:$src), 0 ) ),
        (and (i32 (vector_extract(vt VC:$src), 1 ) ),
            (and (i32 (vector_extract(vt VC:$src), 2 ) ),
                 (i32 (vector_extract(vt VC:$src), 3 ) )
            )
        )
     )
)]

Is there a better way to do this?

Regards
---
Conor Mac Aoidh



More information about the llvm-dev mailing list