Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] LLVM seg fault : dereference an uninitialized pointer Instruction*"
2012 Dec 21
0
[LLVMdev] llvm segfault Instruction::getOpcode
Hello,
I get a segfault and I cannot find the reason. The main computation is done
in "
`struct patternDC : public FunctionPass`
" but I also have
class ifChecker {
public:
virtual bool operEquiv(Instruction *I1, Instruction *I2);
};
I have in
bool patternDC::runOnFunction(Function &F) {
...
ifChecker* CC=new ifChecker();
if (
2013 Jan 10
1
[LLVMdev] LLVM Instruction to ICmpInst conversion
Hello !
I want some piece of advice regarding a LLVM pass. My particular problem is:
There is a method
bool patternDC::runOnFunction(Function &F) {
...
if ( CC->operEquiv(icmpInstrArray[i], icmpInstrArray[j]) ) {...}
...
}
having the array elements of type Instruction* :
http://llvm.org/doxygen/classllvm_1_1Instruction.html
The called method is
bool
2012 Dec 20
1
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
I solved by checking
if(BB->size()>1)
Thank you all for the help !
Now debugging the next segfault.
On Thu, Dec 20, 2012 at 12:59 PM, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:
> getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>()
> Get the previous node, or 0 for the list
2013 May 02
0
[LLVMdev] int to StringRed conversion
Yes, it sounds good. I can try tomorrow.
Thank you for your advice !
On Thu, May 2, 2013 at 5:43 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
> I think the better solution should be:
>
>
> LLVMContext& C = is->getContext();
> Value *values[] = {
> ConstantInt::getSigned(Type::getInt64Ty(C), *scsr*),
> MDString::get(C, *"path"*)
> };
2013 Jun 07
1
[LLVMdev] CFG of a function
But I don't want to map only basic blocks, I need too to map the edges "the
whole CFG of the function"
Save the CFG of the function in another memory address and call it for
example orgCFG and change the CFG by referencing to the orgCFG
Thank you for help and patience
On 6 June 2013 10:59, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:
> I
2013 Mar 01
1
[LLVMdev] llvm get annotations
Hi, I solved it. From the ConstantStruct you can call getOperand() multiple
times, so "mine" as deep as you can.
On Fri, Mar 1, 2013 at 1:41 PM, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:
>
> Hi Sebastian,
>
> Thanks for the response.
>
> I already did this :
>
> I cast the entire annotated expression to Value*. Then, in
2013 Jun 06
0
[LLVMdev] CFG of a function
I don't use a function for do the mapping, it may be MapValue(). If it does
not work, alias an int identifier for each basic block. Be aware because
basic block cannot have the same name (getName) in the same function, but
they might have the same name being in different functions. Therefore, take
into account the function name as well.
Good luck
On Thu, Jun 6, 2013 at 10:55 AM, Rasha Omar
2013 May 02
2
[LLVMdev] int to StringRed conversion
I think the better solution should be:
LLVMContext& C = is->getContext();
Value *values[] = {
ConstantInt::getSigned(Type::getInt64Ty(C), *scsr*),
MDString::get(C, *"path"*)
};
lnstr.setMetadata(*"your_analysis_name"*, MDNode::get(C, values));
So that you can take advantage of the type system of LLVM bitcode, and
don't have to cast the integers from/to strings
2012 Dec 20
0
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>()
Get the previous node, or 0 for the list head. I don't see any method like
hasPrevNode.
It can be a weird problem because "current->getPrevNode()" is indicating to
"current" itself (the problem appears for the BB with only one element)?
On Thu, Dec
2013 Mar 01
0
[LLVMdev] llvm get annotations
Hi Sebastian,
Thanks for the response.
I already did this :
I cast the entire annotated expression to Value*. Then, in order to avoid
ugly things like getAsString(), I check if V->getValueID() ==
Value::ConstantArrayVal in order to cast it to ConstantArray. Because it
contains only array[0], I cast array0>getOperand(0) to ConstantStruct.
Therefore, from ConstantStruct you can get all the
2013 May 02
0
[LLVMdev] int to StringRed conversion
The problem is that I want to pass only srsr which is an int. "marked" was
just an example :)
Thanks you!
On Thu, May 2, 2013 at 5:06 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
> I'm not familiar with this, but maybe you can try:
>
> StringRef tst = ("marked" + Twine(srsr)).str();
>
> It seems that you can't use integer as meta data
2013 Jun 06
0
[LLVMdev] CFG of a function
Map every basic block from the CFG to a set of integers. The successors
from the CFG can be used to make the edges in your simplified graph. The
pair (Callee,Caller) can link the CFG-s between them in a larger CFG-like.
On Wed, Jun 5, 2013 at 11:03 PM, Rasha Omar <rasha.sala7 at gmail.com> wrote:
> What do you mean by mapping to integers?
>
>
> On 5 June 2013 22:32, Alexandru
2013 Jun 06
3
[LLVMdev] CFG of a function
I think I understood that, but what I mean is what is the function
responsible to do mapping is it MapValue() in ValueMapper.h?
Thanks for your help
On 6 June 2013 09:54, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:
> Map every basic block from the CFG to a set of integers. The successors
> from the CFG can be used to make the edges in your simplified
2013 Jun 05
2
[LLVMdev] CFG of a function
What do you mean by mapping to integers?
On 5 June 2013 22:32, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:
> Why you don't map the basic blocks to integers and apply algorithms on the
> integer graph? And construct your new CFG.
>
>
> On Wed, Jun 5, 2013 at 10:27 PM, Rasha Omar <rasha.sala7 at gmail.com> wrote:
>
>> How
2013 Mar 05
0
[LLVMdev] LLVM load instruction query
Try :
INITIALIZE a1 if you didnt.
if (cpProf EXISTS){
CallInst* newInst = CallInst::Create(cpProf,a1,"");
if (BB->getTerminator() && CI)
BB->getInstList().insert((Instruction*)CI, newInst);
On Tue, Mar 5, 2013 at 1:04 PM, Anshul Garg <gargaa24 at gmail.com> wrote:
> CallInst* newInst = CallInst::Create(cpProf,a1,"");
>
2013 Feb 27
0
[LLVMdev] llvm get globals definition line number
However, I do have:
!924 = metadata !{i32 786484, i32 0, null, metadata !"r", metadata
!"r", metadata !"", metadata !841, i32 19, metadata !56, i32 0, i32 1, i32*
@r} ; [ DW_TAG_variable ] [r] [line 19] [def]
with on which `!0` is indirectly dependent and there is `!llvm.dbg.cu =
!{!0}` .
On Wed, Feb 27, 2013 at 11:35 AM, Alexandru Ionut Diaconescu <
2012 Dec 20
2
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
Hello,
Thank you for your answer. If I want to use
then I have
error: ‘NodeTy* llvm::ilist_half_node<NodeTy>::getPrev() [with NodeTy =
llvm::Instruction]’ is protected
error: ‘llvm::ilist_half_node<llvm::Instruction>’ is not an accessible base
of ‘llvm::Instruction’
Do you know any other method to access the previous instruction of a
terminator instruction? PS: back() is not an
2013 Jan 11
2
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hi Duncan,
Thank you for your response! Now it works.
But I have another problem: Do you know how can I iterate through a Value*?
For instance, I have :
Instruction *I1; // I take only I1 that are ICmp
errs()<<"\n "<<*I1->getOperand(0)<<" \n";
// %3 = load i32* %c, align 4
As expected. Now I want to get %c from the previous to use "%c" in
2013 Jun 10
0
[LLVMdev] CFG of a function
Hi Rasha,
First, you should not erase that cloned function XD the idea is that your
pass should create that new function, add it to a module (that could be the
same one where the original function is, or another one that you could be
creating if that is the case), and then just let it be: the pass manager
should identify this new function (after your pass returned) and all the
other analysis and
2013 Mar 15
0
[LLVMdev] write a simple MachineFunctionPass
I found that : "Code generator passes are registered and initialized
specially by TargetMachine::addPassesToEmitFile and similar routines, so
they cannot generally be run from the *opt* or *bugpoint* commands."...So
how I can run a MachineFunctionPass? In the end, I just want to apply a DFS
on a CFG of a function. And I need oriented edges and wanted to use