[llvm-dev] How to add NOP?

Erdem Derebaşoğlu via llvm-dev llvm-dev at lists.llvm.org
Sat Oct 3 07:21:51 PDT 2015


I wrote the pass but when I try to build LLVM, I get this error: "/home/erdem/llvm/lib/CodeGen/CodeGen.cpp:80: error: undefined reference to 'llvm::initializeNoopInserterPass(llvm::PassRegistry&). I need to modify Passes.h, InitializePasses.h, and Codegen.cpp files to register my pass, right?
Erdem

From: erdemderebasoglu at hotmail.com
To: vlknkls at gmail.com; llvm-dev at lists.llvm.org
Subject: RE: [llvm-dev] How to add NOP?
Date: Thu, 17 Sep 2015 16:38:36 +0300




This seems to be what I am looking for. That was very helpful. Thank you.
Erdem

From: vlknkls at gmail.com
Date: Wed, 16 Sep 2015 16:25:29 +0000
Subject: Re: [llvm-dev] How to add NOP?
To: erdemderebasoglu at hotmail.com; llvm-dev at lists.llvm.org

Use MachineInstr::memoperands() function to get memory operands then you can get the address space by using MachineMemOperand::getAddrSpace().
Volkan

On Tue, Sep 15, 2015 at 11:40 PM Erdem Derebaşoğlu <erdemderebasoglu at hotmail.com> wrote:



Thanks for the response. How can I find out if an instruction uses a private memory access?
Erdem
From: vlknkls at gmail.com
Date: Tue, 15 Sep 2015 14:38:16 +0000
Subject: Re: [llvm-dev] How to add NOP?
To: erdemderebasoglu at hotmail.com; llvm-dev at lists.llvm.org

Hi Erdem,

I would write a MachineFunction pass. You can check each load instruction to see if it is a private memory access and insert what you want by using BuildMI(...) function.

Volkan
On Tue, Sep 15, 2015 at 4:16 AM Erdem Derebaşoğlu <llvm-dev at lists.llvm.org> wrote:



I would like to convert a C file that uses OpenMP library to X86 code with a condition: I want to insert a NOP before each instruction that does a private memory access.I have written an optimization pass that inserts an inline assembly call (NOP) but it is applied at IR level, and I cannot determine where to insert it. How can I use LLVM to add NOPs accordingly?
Thanks. 		 	   		  
_______________________________________________

LLVM Developers mailing list

llvm-dev at lists.llvm.org

http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151003/745f599e/attachment.html>


More information about the llvm-dev mailing list