[LLVMdev] Preventing IR instruction duplication

Matt Arsenault arsenm2 at gmail.com
Thu Jul 17 09:33:12 PDT 2014


On Jul 17, 2014, at 8:41 AM, Jan Hoogerbrugge <jan.hoogerbrugge at gmail.com> wrote:

> Hi,
> 
> For a certain type of analysis I generate inline assembly which I insert into the LLVM IR code. This
> inline assembly code contains labels that should not be duplicated. Problem is that the tail
> duplication pass duplicates code. It checks isNotDuplicatable on a machine instruction however
> there is no such a flag on an IR instruction that I could set. Is there a way to tell in an IR pass 
> that code should not be duplicated?
> 
> Jan

There is the noduplicate attribute you can place on the function definition / the asm call site which should work

-Matt



More information about the llvm-dev mailing list