On Monday 29 November 2004 19:39, Chris Lattner wrote:> > > Alternatively, if you don't want to do that, you can build mem2reg into > > > your pass if it works better. To do this, your pass needs to > > > 'addRequired' DominatorTree and DominatorFrontier, then use the > > > interfaces exposed through > > > include/llvm/Transforms/Utils/PromoteMemToReg.h. > > > > This still leaves the question of TargetData parameter -- which is not > > used by the PromoteMemToReg function, AFAICT. Passing *(TargetData*)0 is > > dirty. > > Just addRequired<TargetData>(), and pass in getAnalysis<TargetData>() as > appropriate.This did not work for me -- it seems the "analyze" program does not provide any TargetData. Probably, analysis pass which modifies program is not typical, but then it's surely not transformation pass, either. - Volodya
I have trouble using the llvm tools.Some of the errors are : $ llvm-dis prog.bc $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12) ------------------------------------- $ extract -o=outprog prog.bc $ extract: bytecode didn't read correctly. Where am I doing wrong ?I wish to get human readable form of my bytecode file.The tool giving similar error. Thanks Tanu --------------------------------- Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041130/bb98f8b4/attachment.html>
On Tue, 30 Nov 2004, Vladimir Prus wrote:> On Monday 29 November 2004 19:39, Chris Lattner wrote: > > Just addRequired<TargetData>(), and pass in getAnalysis<TargetData>() as > > appropriate. > > This did not work for me -- it seems the "analyze" program does not provide > any TargetData. Probably, analysis pass which modifies program is not > typical, but then it's surely not transformation pass, either.Hrm, analyze.cpp:143 adds TargetData to the pass manager. Can you give me more information about how you are running your pass? -Chris -- http://llvm.org/ http://nondot.org/sabre/
On Tue, 30 Nov 2004, Tanu Sharma wrote:> I have trouble using the llvm tools.Some of the errors are : > > $ llvm-dis prog.bc > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12)Can you explain how you generated this bytecode file? It looks corrupted or something. Also, can you send the actual bytecode file itself? Thanks! -Chris> ------------------------------------- > > $ extract -o=outprog prog.bc > $ extract: bytecode didn't read correctly. > > Where am I doing wrong ?I wish to get human readable form of my bytecode file.The tool giving similar error. > > Thanks > > Tanu > > > --------------------------------- > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard.-Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/