similar to: [LLVMdev] How to use BasicBlock to response the segmentation fault in generated code

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] How to use BasicBlock to response the segmentation fault in generated code"

2012 Apr 27
1
[LLVMdev] RE : RE : RE : Detect if a basicblock is part of a loop
It try to put all basicblock in a switch in a loop, like that for example: int main() { if(something) somethingelse: else another; } become: int main() { while(true) { switch(var) { case 0: if(something) var+=1; else: var+=2; break; case1:
2012 Apr 27
4
[LLVMdev] RE : Detect if a basicblock is part of a loop
Thx all for the quick answers... > De : llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] de la part de Arnaud ALLARD DE GRANDMAISON [arnaud.allarddegrandmaison at parrot.com] > > Hi, > > Depending on what have run before your pass, the loop may have been unrolled or simplified if the computation inside the loop is too simple. > > Cheers, > -- > Arnaud de
2012 Apr 27
2
[LLVMdev] RE : RE : Detect if a basicblock is part of a loop
This is my main.c (just a crappy test file): #include <stdlib.h> void foo() { foo(); } int main(int argc,char** argv) { int a = 1; int b = 3; int c = a+b; int k; for(k=0;k<10;++k) { // The loop I'm trying to detect int sdf = 123123; c++; } if(c - atoi(argv[1])
2011 Oct 24
1
[LLVMdev] if llvm can translate and generate the function in parallel with multithread
We try to use llvm to translate and generate the native code in parallel with multi-thread. But some various bugs will be triggered. We run the following code in multithread environment: ################## BasicBlock::Create(_CTX(), "dispatch", cpu->cur_func, 0); BranchInst::Create(bb_start, label_entry); cpu->exec_engine->getPointerToFunction ##################3 And cpu
2012 Apr 27
0
[LLVMdev] RE : RE : Detect if a basicblock is part of a loop
> Yes it's my own lib... It contains some obfuscation's passes. The one I'm trying to make now is making code flattening! ^^^^^^^^^^^^^^^^^^^^^^ What's the flattening effect? Maybe try NOT to flat it first? Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute
2005 Feb 07
0
[LLVMdev] Segmentation Fault(Modifying BasicBlockPlacement.cpp)
Hi, I have been trying to randomize blocks in a program and modified "BasicBlockPlacement.cpp" for the purpose but getting segmentation fault.I am not able to determine the problem.Can anyone please decrypt these error messages or suggest what might be the possible cause of failure? -----------------------------------------------------------------------------------------------------
2012 Apr 27
0
[LLVMdev] RE : Detect if a basicblock is part of a loop
> I'm running opt with my lib on a ir code emmitted by clang: $ clang -emit-llvm -S -o main.ll main.c > and opt: $ ../build/Release/bin/opt -load ../build/Release/lib/LLVMobfuscationTest.so -flattening -S main.ll -o main.opt.ll What's the clang default opt level? Maybe you should use "-O0" explicitly. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab,
2012 Apr 27
0
[LLVMdev] RE : Detect if a basicblock is part of a loop
> Just as I said to Hal, nothing else than: > $ clang -emit-llvm -S -o main.ll main.c > $ ../build/Release/bin/opt -load ../build/Release/lib/LLVMobfuscationTest.so -flattening -S main.ll -o main.opt.ll Then you might need to past your main.c. Besides, is LLVMobfuscationTest.so your own pass? What does it do? Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of
2012 Dec 19
3
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
Hello everyone, I have a segmentation fault while running an LLVM pass. I need to use BBterminators array outside the iterating "for" loop for basic blocks. It seems that LLVM does not protect the addresses ( note: TerminatorInst *BasicBlock::getTerminator() ) when iterating through the loop, so I need to keep in BBterminators "Instruction" type elements, not
2017 Jun 28
2
About the concept of "materialization"
OK. About the error it’s a long story, so it’s probably better to pin some source code here. Below is a piece of code related to my problem, clipped from lib/Transforms/Utils/ValueMapper.cpp. I was wondering what “materialized” means here. Value *Mapper::mapBlockAddress(const BlockAddress &BA) { Function *F = cast<Function>(mapValue(BA.getFunction())); // F may not have
2011 Jan 31
2
[LLVMdev] Segmentation fault on using get parent of a PHINode
I am getting a segmentation fault as soon as I touch the Basic block *b value defined as :  std::string getPHIAssigns(const PHINode *PH)  { const BasicBlock *b = PH->getParent();    errs() << b->size(); where as getPHIAssigns is being called from               for (BasicBlock::iterator ins=b->begin(), e3=b->end(); ins!=e3; ++ins, ++l) // get instructions                
2005 Feb 07
2
[LLVMdev] Segmentation Fault(Modifying BasicBlockPlacement.cpp)
On Mon, 7 Feb 2005, Tanu Sharma wrote: > I have been trying to randomize blocks in a program and modified > "BasicBlockPlacement.cpp" for the purpose but getting segmentation > fault.I am not able to determine the problem.Can anyone please decrypt > these error messages or suggest what might be the possible cause of > failure? I'd be happy to fix this, but I need
2012 Jun 18
1
[LLVMdev] The porting issue from llvm-2.8 to llvm-3.0
I successfully ported our project from llvm-2.8 to llvm-3.0. The most important change is you need to change some argument type from Vector to llvm::ArrayRef, such as CallInst::Create, FunctionType::get etc. Until now , our project is running fine except some minor issue. I still need to look into if the current issues is related to llvm 3.0 Thanks all your help. Thanks MK On Wed, Jun 13, 2012
2011 Feb 05
0
[LLVMdev] Segmentation fault on using get parent of a PHINode
Hi Surinder, I don't see anything obviously wrong with your code. I suggest that (1) you build LLVM with assertions enabled, (2) you run the verifier on your bitcode, and (3) run your program under valgrind. Ciao, Duncan. > I am getting a segmentation fault as soon as I touch the Basic block > *b value defined as : > > std::string getPHIAssigns(const PHINode *PH) > {
2005 Feb 07
0
[LLVMdev] Segmentation Fault(Modifying BasicBlockPlacement.cpp)
Thanks a lot for replying Chris, I m trying to randomize the blocks in a program.I generate a random number( between the current "InsertPos" and the last block), and then iterate through the list of basicblocks , picking up block with position equal to that of the random number and place it into the current InsertPos and increment InsertPos. Running it like this:
2010 Oct 15
1
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
Also note: there may be multiple MachineBasicBlock's for a single BasicBlock. - David M On Fri, Oct 15, 2010 at 4:59 AM, Jeff Kunkel <jdkunk3 at gmail.com> wrote: > I don't think you can. > > The BasicBlock is a member of MachineBasicBlock. It is not inherited, > so it cannot be cast. The number of the MachineBasicBlock is not the > same as any BasicBlock values.
2010 Oct 15
0
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
I don't think you can. The BasicBlock is a member of MachineBasicBlock. It is not inherited, so it cannot be cast. The number of the MachineBasicBlock is not the same as any BasicBlock values. So MachineFunction::getMachineBasicBlock( BasicBlock::{get the number} ) cannot work. I do not see much in the basic block which can identify it. So you can search for it. typedef struct findBlock {
2010 Aug 27
2
[LLVMdev] how to check whether from basicblock A we can go to basicblock B within the same function?
----- Original Message ----- From: "John Criswell" <criswell at illinois.edu> To: "Wenbin Zhang" <zhangwen at cse.ohio-state.edu> Cc: <llvmdev at cs.uiuc.edu> Sent: Friday, August 27, 2010 5:09 PM Subject: Re: [LLVMdev] how to check whether from basicblock A we can go to basicblock B within the same function? > Wenbin Zhang wrote: >> Dear all,
2010 Aug 27
0
[LLVMdev] how to check whether from basicblock A we can go to basicblock B within the same function?
Wenbin Zhang wrote: > Dear all, > Is there a way to check whether we can go from A to B within a > function when I'm writing a pass? I assume you are asking whether control flow can pass from BasicBlock A to BasicBlock B. In that case, yes: all you need to do is look at the terminator instruction of BasicBlock A and see if it can branch to BasicBlock B. There's a new indirect
2010 Jan 13
0
[LLVMdev] How to create forward reference to BasicBlock?
On Wed, Jan 13, 2010 at 2:27 PM, James Williams <junk at giantblob.com> wrote: > Hi, > > Can anyone tell me if there's a straighforward way to create a new > BasicBlock without inserting it into a function's basic block list? I want > to do this so I can create a forward reference to a block that's position in > the function is not yet known. > > I've