[LLVMdev] Break operands into multiple instructions

Kodakara, Sreekumar V sreekumar.v.kodakara at intel.com
Fri Aug 19 10:58:27 PDT 2011


Hi All,

I am creating an instrumentation pass using LLVM libraries. I am using clang++ (version 2.9) to compile cpp code into LLVM bit code. When I generate the llvm bit code using clang++ using -O3, I get many instances of instructions that look like the following.

br i1 icmp ne (i8* bitcast (i32 (i32)* @pthread_cancel to i8*), i8* null), label %bb23, label %bb25

Here three LLVM instructions are used in one instruction, namely br, icmp and bitcast. Is there a way to tell clang++ to break the operand of br into 3 separate instructions or a pass that exists that does it. Ideally, I would like to see the following

I8* tmp0 = i8* bitcast (i32 (i32)* @pthread_cancel to i8*
I1 tmp = icmp ne i8* tmp0, i8* null
br i1 tmp, label %bb23, label %bb25

Thanks
Sreekumar


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110819/537b1cff/attachment.html>


More information about the llvm-dev mailing list