Displaying 20 results from an estimated 300 matches similar to: "[LLVMdev] module functions"
2015 Jul 09
2
[LLVMdev] insert nop instruction
Dear All,
To add to this, you can find examples of inserting NOPs for X86 in the
CFI pass originally written at Lehigh University that we ported to
64-bit X86 for SVA:
https://github.com/jtcriswell/SVA/blob/master/llvm/lib/Target/X86/X86CFIOptPass.cpp
Alternatively, you could use an InlineAsm call at the LLVM IR level
(which I think would be easier to implement).
Regards,
John Criswell
On
2015 Jul 09
2
[LLVMdev] insert nop instruction
My pass runs after optimization passes.
On Thu, Jul 9, 2015 at 1:11 PM, David Chisnall <David.Chisnall at cl.cam.ac.uk>
wrote:
> Hi,
>
> What are you trying to achieve? Inserting NOPs into LLVM IR is likely to
> be pointless, as optimisations (in the IR or SelectionDAG) will remove them
> before machine code generation. If you want to insert NOPs into the
> generated
2015 Jul 09
4
[LLVMdev] insert nop instruction
Hi.
I need to write a function pass that insert nop instruction in function.
Examples of these instructions are: %nop = add i1 0, 0 or %nop = alloca i1,
i1 0. This link couldn't help me:
http://llvm.org/docs/ProgrammersManual.html#creating-and-inserting-new-instructions
I need a clear example about inserting new instruction. Anyone can help me?
Thanks.
-------------- next part --------------
2009 Jun 04
1
[LLVMdev] assertion in LeakDetector
Hi Bill,
I am using the following version of BuildMI :
MachineInstrBuilder BuildMI(MachineFunction &MF,
const TargetInstrDesc &TID,
unsigned DestReg)
I do the following :
void createInstrs(std::vector<MachineInstr *>& ilist)
{
Machine Instr *mi;
mi = BuildMI(MF, someTID, somereg);
2018 Dec 09
2
Parse LLVM IR
Hello,
I am a newbie to LLVM and right now I am on the hook to parse some IR code
and do some instrumentations. However, my problem is that no matter how I
tweak my parsing code, it simply cannot print out anything.
So here is my C code:
int your_fun(int arg2) {
int x = arg2;
return x+2;
}
And here is my parsing code:
#include <llvm/IR/Module.h>
#include
2014 Oct 05
2
[LLVMdev] extending LLVM - basic block reordering
Hi.
I want to change order of code basic blocks in memory. I visited "
http://llvm.org/docs/ExtendingLLVM.html" page and it advised me to ask it
before any effort.
What parts of LLVM help me and how? I am a newbie on LLVM.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2010 Nov 25
1
[LLVMdev] Detailed help with cloning the basic blocks of a function
Hi,
Thank you guys for helping me out with my previous questions.
I am new to LLVM, and I'm getting stuck trying to do some basic stuff:
Currently, I'm trying to move all the basic blocks of one function into
another one,
and at some point insert a branch into the moved function's entry point.
The best way which I've found is to use CloneBasicBlock (from Cloning.h).
However, I
2009 Jun 25
0
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
On Thu, Jun 25, 2009 at 12:32 AM, ihusar<ihusar at fit.vutbr.cz> wrote:
> //now i need to create an instruction that represents a call to a intrinsic
> Function* FIntr = Intrinsic::getDeclaration(&M, Intrinsic::regread_i32);
>
> // here it fails: void llvm::CallInst::init(llvm::Value*):
> //Assertion
2018 Feb 02
2
Debug info error on bitcode inline modification
Hi,
I'm trying to inline function defined in another bitcode module via bitcode
modification.
I'm linking multiple bitcode modules, setting inline related attributes,
applying -always-inline pass, but then debug info error occurs.
It seems debug info metadata isn't properly updated on inlining. How can I
fix it?
I'm using LLVM 3.8.1 on OS X (On below example target is Android but
2016 Mar 01
2
Insert CallInst within a function passing same parameters of the calling function.
Hi,
supposing I have a function “foo” like the following:
int foo(int a, int b) {
...
...
}
I want to insert int the LLVM IR a call instructions to a function “bar” that requires the same parameters of foo.
So my function foo will become:
int foo(int a, int b) {
bar(a,b);
…
...
}
I am using the following code:
bool ThreadSanitizer::runOnFunction(Function &F) {
2009 Jun 24
3
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
Hi everyone,
I am trying to write a pass, that finds some instructions and replaces them with my intrinsics,
but I am having problem understanding, how this should be done.
Let's say I have this instruction:
%tmp14 = load i32* getelementptr ([32 x i32]* @gpregs, i32 0, i64 28)
and i need to read the load's operands and replace it by let's say:
%tmp14 = call i32
2016 Oct 26
0
How does one reduce a function CFG to its entry block?
Hello,
I wish to reduce a function CFG to its entry block. I wrote the following code using lib/IR/Function.cpp/Function::dropAllReferences() (from llvm-3.6) as reference:
Function *F; // Suitably initialized. BasicBlock *FEntryBlock = &F->getEntryBlock(); FEntryBlock->getTerminator()->eraseFromParent(); FEntryBlock->removeFromParent(); for (Function::iterator I = F->begin(),
2009 Jun 04
2
[LLVMdev] assertion in LeakDetector
I am seeing the following assertion in leak detector.
/llvm/lib/VMCore/LeakDetector.cpp:43:
void<unnamed>::LeakDetectorImpl<T>::addGarbage(const T*) [with T =
void]: Assertion `Ts.count(Cache) == 0 && "Object already in set!"'
failed.
I am creating a list of instructions using BuildMI() and adding them
to a basic block using BB->insert(). I am seeing this
2009 Jun 04
0
[LLVMdev] assertion in LeakDetector
On Wed, Jun 3, 2009 at 5:10 PM, Manjunath Kudlur <keveman at gmail.com> wrote:
> I am seeing the following assertion in leak detector.
>
> /llvm/lib/VMCore/LeakDetector.cpp:43:
> void<unnamed>::LeakDetectorImpl<T>::addGarbage(const T*) [with T =
> void]: Assertion `Ts.count(Cache) == 0 && "Object already in set!"'
> failed.
>
> I am
2015 May 19
2
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
On Fri, May 15, 2015 at 11:20 PM, Teresa Johnson <tejohnson at google.com> wrote:
> On Fri, May 15, 2015 at 2:52 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>>
>> On Fri, May 15, 2015 at 1:15 PM, Teresa Johnson <tejohnson at google.com>
>> wrote:
>>>
>>> On Fri, May 15, 2015 at 10:04 AM, David Blaikie <dblaikie at
2018 Feb 02
0
Debug info error on bitcode inline modification
Every inlinable call in a function that has debug info (F->getSubprogram()
returns non-null) must have a DebugLoc associated with it that has a scope
chain that ends in that same DISubprogram.
https://llvm.org/docs/SourceLevelDebugging.html discusses some of the debug
info IR metadata in LLVM.
On Fri, Feb 2, 2018 at 1:03 AM Ku Nanashi via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
2018 Feb 05
1
Debug info error on bitcode inline modification
> Every inlinable call in a function that has debug info
(F->getSubprogram() returns non-null) must have a DebugLoc associated with
it that has a scope chain that ends in that same DISubprogram.
Thank you for the comment! I don't know if this is a proper way to fix, but
after I add DebugLoc same as inserting position instruction, no error
occurs.
2015 May 19
2
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
On Tue, May 19, 2015 at 12:41 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Mon, May 18, 2015 at 9:09 PM, Teresa Johnson <tejohnson at google.com>
> wrote:
>>
>> On Fri, May 15, 2015 at 11:20 PM, Teresa Johnson <tejohnson at google.com>
>> wrote:
>> > On Fri, May 15, 2015 at 2:52 PM, David Blaikie <dblaikie at gmail.com>
2008 Mar 03
1
[LLVMdev] Cloning a function
Hi,
we have two modules, one that we basically use as a library in which we store
a lot of simple function calls, the other is small program generated at
run-time.
Whenever a function call for to one of the builtin functions is being called
we use CloneFunction to clone the instruction from the library module and
insert it in the generated module.
The problem is for example when we have
2019 Aug 31
3
Usage of the jumptable attribute
Hello everyone,
I'm new to LLVM (which is a really great project by the way) and I hope
this is the right place for my question.
In the LLVM Language Reference Manual I found the "jumptable" function
attribute, which seems to be exactly what I need for my project (where I
want to add one level of indirection to every function call), but I have
trouble figuring out, how to use