OpenCL Vector Swizzling Optimization under Global Value Numbering

Under Heterogeneous System Architecture (HSA), each device work together to improve performance. Open Computing Language (OpenCL) provides functionalities to complete parallel computing in different devices. OpenCL vector bundles identical data types and operates them meanwhile. However, optimization upon vector swizzling becomes difficult due to vector swizzling operations with several OpenCL vectors. In this paper, new method has its announcement to focus on and handle such problem. Vector swizzling optimization takes place under LLVM Global Value Numbering (GVN) optimization. In addition to fundamental functionality of congruence detection in LLVM GVN, new solution in this paper checks relationship between current definition and predecessors and find substitution of current variable with vector swizzling of the predecessors. The result is promising and has many applications on OpenCL optimization and performance breakthrough. Keywords—OpenCL; Vector Swizzling; LLVM; GVN;