[LLVMdev] Will it be slow much if a lot of BasicBlock been created?

weixuegong weixuegong at gmail.com
Mon Sep 30 00:15:41 PDT 2013


Hi, all
I am doing some work about instruction translating.
and the IR is sort of:(whatever it is)

%v1 = alloca i32
store i32 10, i32* %v1
%v0 = alloca i32
store i32 0, i32* %v0
%0 = load i32* %v0
%1 = add i32 %0, 1
store i32 %1, i32* %v0
%2 = load i32* %v1
%3 = add i32 %2, -1
store i32 %3, i32* %v1
%4 = load i32* %v0
ret i32 %4

I want to know that if I create a basic block for every instruction in
IR, like:
Label0: ; No predecessors!
%v1 = alloca i32
store i32 10, i32* %v1
Label2: ; No predecessors!
%v0 = alloca i32
store i32 0, i32* %v0
Label3: ; preds = %Label9
Label5: ; No predecessors!
%0 = load i32* %v0
%1 = add i32 %0, 1
store i32 %1, i32* %v0
Label7: ; No predecessors!
%2 = load i32* %v1
%3 = add i32 %2, -1
store i32 %3, i32* %v1
Label9: ; No predecessors!
br label %Label3
Label10: ; No predecessors!
%4 = load i32* %v0
ret i32 %4

Will it be slow too much than before OR make no difference?
What is BasicBlock treated as in llvm? Just an address of bitcode or a
kind of structure which contained some informations?

Any suggestion will be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130930/c82ea7b1/attachment.html>


More information about the llvm-dev mailing list