[LLVMdev] Optimized code analysis problems
Nipun Arora
nipun2512 at gmail.com
Fri Jan 30 19:10:38 PST 2009
Hi all,
I am trying to do an analysis of a parallelized code using sse
optimizations. The problem I am encountering is that I need to do some
matching based on the analysis and I would like to extract the names of the
functions as is rather than llvm intrinsics with an llvm. representation.
Essentially I would like to extract the control flow graph representation
with function names (eg. _mm_cvtsi32_si128) instead of the functions being
replaced by 'llvm.*'
Is there anyway to extract these names directly as function calls?
I have included the sample code below.
I get the function call names as llvm.x86 something instead of getting
function names(eg. _mm_cvtsi32_si128)
#include <pmmintrin.h>
#include<sys/time.h>
#include<iostream>
void foo_opt(unsigned char output[64], int Yc[64], int S_BITS)
{
__m128i XMM1, XMM2, XMM3, XMM4;
__m128i *xmm1 = (__m128i*)Yc;
__m128i XMM5 = _mm_cvtsi32_si128(S_BITS + 3) ;
XMM2 = _mm_set1_epi32(S_BITS + 2);
for (int l = 0; l < 8; l++) {
XMM1 = _mm_loadu_si128(xmm1++);
XMM3 = _mm_add_epi32(XMM1, XMM2);
XMM1 = _mm_cmplt_epi32(XMM1, _mm_setzero_si128());
XMM1 = _mm_srli_epi32(XMM1, 31);
XMM3 = _mm_sub_epi32(XMM3, XMM1);
XMM3 = _mm_srl_epi32(XMM3, XMM5);
XMM1 = _mm_loadu_si128(xmm1++);
XMM4 = _mm_add_epi32(XMM1, XMM2);
XMM1 = _mm_cmplt_epi32(XMM1, _mm_setzero_si128());
XMM1 = _mm_srli_epi32(XMM1, 31);
XMM4 = _mm_sub_epi32(XMM4, XMM1);
XMM4 = _mm_srl_epi32(XMM4, XMM5);
XMM3 = _mm_packs_epi32(XMM3, XMM4);
XMM3 = _mm_packus_epi16(XMM3, XMM3);
_mm_storel_epi64((__m128i*)(output+8*l), XMM3);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090130/01e86b9e/attachment.html>
More information about the llvm-dev
mailing list