[LLVMdev] instructions copy

keutoi k3ut0i at gmail.com
Sun Jul 12 01:39:07 PDT 2015


I'm Just a beginner so i may be wrong.
Does Block Insert work?
Create a new block with your instructions with (new BasicBlock) and (new BranchInst) , split using SplitBlock and insert.
http://stackoverflow.com/questions/13275577/inserting-a-block-between-two-blocks-in-llvm

If it is possible to just add instructions, can someone please suggest
how this can be done.

It must be possible for inline function instructions.

Thank You.

On Sat, Jul 11, 2015 at 11:13:16PM +0000, Yuxi Chen wrote:
> Hi,
> 
> I want to copy some dependent statements, like a = b, b = c, from one basicblock to another basicblocks.
> Because of SSA, a = b, will be like %1 = load %b, store %1, %a.
> If I just use clone() method in Instruction class, it will be like <badref> = load %b, store <badref>, %a.
> If I need remap the virtual registers, this map just will affect the whole module? And how to use it? I am a bit confused.
> 
> Any suggestion will be appreciated.
> 
> Best,
> Yuxi
> Uchicago

> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


-- 
keutoi(k3ut0i)
pub fpr D04E 573D 360D 8209 3261  550E 39BE 6531 C533 FD20
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150712/dd0d9c0a/attachment.sig>


More information about the llvm-dev mailing list