similar to: [LLVMdev] OPT optimizations

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] OPT optimizations"

2011 Jan 23
1
[LLVMdev] Pointers in Load and Store
John, I have looked at the real code (instead of the obsolete one) and it appears to be easy to find if an operand is a getelementptr instruction. if (ConstantExpr * CE = dyn_cast<ConstantExpr>(I.getOperand(0))) { Out<< "*** operand 0 is a constant Expr******"; if (CE->getOpcode() == Instruction::GetElementPtr) { Out<< "*** operand 0 is
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
On 1/21/2011 10:46 PM, Surinder wrote: > John, > > I have looked at the SAFECode and thought following sould work > > if (isa<Constant>(I.getOperand(0))) > { Out<< "*** operand 0 is a constant ******"; > if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) > { Out<<
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
John, I have looked at the SAFECode and thought following sould work if (isa<Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI =
2011 Jan 21
0
[LLVMdev] Pointers in Load and Store
On 1/20/2011 10:02 PM, Surinder wrote: > When I compile C programs into llvm, it produces load instructions in > two different flavours. > > (1) %8 = load i8** %bp, align 8 > > (2) %1 = load i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, > i64 0), align 1 > > I know that %bp in first case and the entire "getelementptr inbounds > ([4 x i8]* @.str, i64
2011 Jan 21
2
[LLVMdev] Pointers in Load and Store
When I compile C programs into llvm, it produces load instructions in two different flavours. (1) %8 = load i8** %bp, align 8 (2) %1 = load i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), align 1 I know that %bp in first case and the entire "getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0)" in second case can be obtained by dump'ing I.getOperand(0)
2011 Jan 25
1
[LLVMdev] LLVM grammar for ANTLR
Hi Sam, Thanks for your reply. I am implementing my research (http://www.it.usyd.edu.au/~suri/Detecting%20Buffer%20Over.pdf), a translation of LLVM to a simple non-deterministic language to detect buffer overflows. It involves (1) printing a control flow graph of basic blocks of a function (easily done) (2) translating each llvm statement to a corresponding data flow language (needs ASTs to
2011 Jan 24
0
[LLVMdev] LLVM grammar for ANTLR
Hello Surinder, The existing hand-written parser is callable from almost anywhere so the only reason you'd need to have a parser for it would be to extend it. Originally it was written using Flex and Bison but Chris Lattner rewrote it from scratch to catch more errors at the parsing stage. The only feature I've found to be missing from the existing LLVM-AS utility was an include
2011 Jan 31
0
[LLVMdev] Error : llvm/include/llvm/Pass.h:188: error: incomplete type 'llvm::DominatorTree' used in nested name specifier
Hi Surinder, Did you remember to #include "llvm/Analysis/Dominators.h"? Best, Douglas On Sun, Jan 30, 2011 at 11:24 PM, Surinder <surifilms at gmail.com> wrote: > I am creating a new pass (function pass) called Dfl from the Hello > example and notes on "Writing an LLVM Pass". When I compile the > program I get inncomplete type error
2011 Jan 12
1
[LLVMdev] newbi to llvm - how to get array size
Hi, I am new to llvm to so please be kind to me if I am asking something that is too simple. I want to get the bounds of an array when I have a handle to getelementptr or insertelement or extractvalue instructions. I am writing a translation routine from llvm to a non-deterministic language and want to include array bounds check in it. The array size gets printed as part of the type of the
2011 Jan 31
0
[LLVMdev] How to convert an iterator to an object pointer
Hi Surinder, You'll need to dereference your iterator to get a pointer: const BasicBlock *p = *pr; Cheers, Lang. On Mon, Jan 31, 2011 at 3:04 PM, Surinder <surifilms at gmail.com> wrote: > I have a pointer to a basic block and am iterating thru its > predecessor blocks. I want to get a pointer to the predecessor block. > How do I do it. I am using following code and it
2011 Jan 24
3
[LLVMdev] LLVM grammar for ANTLR
Has anyone written a grammar for LLVM for ANTLR. I mean an ANTLR grammar that parses LLVM instructions. Is an LLVM grammar available for any other parsing tool? Surinder
2011 Jan 31
2
[LLVMdev] Error : llvm/include/llvm/Pass.h:188: error: incomplete type 'llvm::DominatorTree' used in nested name specifier
I am creating a new pass (function pass) called Dfl from the Hello example and notes on "Writing an LLVM Pass". When I compile the program I get inncomplete type error (llvm/include/llvm/Pass.h:188: error: incomplete type 'llvm::DominatorTree' used in nested name specifier). The code is given below. Surinder struct Dfl : public FunctionPass { raw_ostream *Out; static
2011 Jan 31
0
[LLVMdev] llvm::Pass::Pass(llvm::PassKind, intptr_t): Assertion `pid && "pid cannot be 0"' failed.
llvm/include/llvm/Pass.h:93: llvm::Pass::Pass(llvm::PassKind, intptr_t): Assertion `pid && "pid cannot be 0"' failed. On Mon, Jan 31, 2011 at 3:55 PM, Surinder <surifilms at gmail.com> wrote: > I have written a new pass, it compiles ok but crashes when i run it > with error (llvm::Pass::Pass(llvm::PassKind, intptr_t): Assertion `pid > && "pid
2011 Jan 31
3
[LLVMdev] How to convert an iterator to an object pointer
I have a pointer to a basic block and am iterating thru its predecessor blocks. I want to get a pointer to the predecessor block. How do I do it. I am using following code and it given compile time errors. error: cannot convert 'llvm::const_pred_iterator' to 'const llvm::BasicBlock*' in initialization const BasicBlock *b = PH->getParent(); // process all pred block
2011 Jan 31
2
[LLVMdev] llvm::Pass::Pass(llvm::PassKind, intptr_t): Assertion `pid && "pid cannot be 0"' failed.
I have written a new pass, it compiles ok but crashes when i run it with error (llvm::Pass::Pass(llvm::PassKind, intptr_t): Assertion `pid && "pid cannot be 0"' failed.). The pass is : using namespace llvm; namespace { struct Dfl : public FunctionPass { static char ID; Dfl() : FunctionPass(ID) { } virtual bool runOnFunction(Function &F) { bool
2015 Feb 09
2
[LLVMdev] Is "clang -O1" the same as "clang -O0 + opt -O1"?
Hello, I encounter a bug that pumped during execution of "clang -O1". However the bug cannot be reproduced by using "clang -O0 + opt -O1". It seems that "clang -O1" is not the same as "clang -O0 + opt -O1". According to the generated LLVM IRs are large, I would like to use bugpoint with "clang -O1" directly instead of using "clang -O0"
2020 Apr 04
2
Running opt O1 outside of llvm
Hi, I would like to run the -O1 pass sequence followed by -reg2mem from an out of tree project which uses llvm. I am using the following code snippet to do so but in some cases, my method is also vectorising the code, which doesn't happen when running the same sequence(-S -O1 -reg2mem) through opt. Can someone please help me find what I am missing? Thanks, Akash. *
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                
2011 Jan 23
2
[LLVMdev] Undoing SSA and Phi instructions
Hi, I am emitting llvm bit code using llvm-gcc -c -emit-llvm -O0 -o test.bc test.c and then optimizing it with opt -O3 -print-module test.bc in order to obtain a dump of generated IR. The resulting code has Phi nodes and is perhaps in SSA form. I want to undo the SSA form while retaining all the other optimizations. Is mem2reg the right optimization to be added after -O3, i.e., opt -O3
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) > {