similar to: Need help on how to write MachineFunctionPass

Displaying 20 results from an estimated 2000 matches similar to: "Need help on how to write MachineFunctionPass"

2016 Mar 01
2
How to write a simple MachineFunctionPass
Hello everyone, I have written simple LLVM passes, but I cannot able to write a MachineFunctionPass pass. I am following the steps form the following link but it is not working: http://www.gabriel.urdhr.fr/2014/09/26/adding-a-llvm-pass/ Please share the sample MachineFunctionPass code or steps to follow to write MachineFunctionPass. Thanks, Bala -- Thanks, Bala IIITA Allahabad --------------
2016 May 02
3
How to convert assembly code to executable
Hello All, I have converted c program into assembly code for alpha target using following commands clang -emit-llvm matrix.c -c -o matrix.bc llc -march=alpha matrix.bc -o matrix.s Now how to convert matrix.s assembly file into executable file of alpha target? Any help is appreciated Thanks in advance !! Thanks, Bala -------------- next part -------------- An HTML attachment was scrubbed...
2016 Mar 01
0
How to write a simple MachineFunctionPass
First you should learn how to write a pass and then a MachineFunctionPass. >From LLVM website, you can refer to http://llvm.org/docs/WritingAnLLVMPass.html And for outside pass, you can refer to http://adriansampson.net/blog/llvm.html It's a great article. And the author put the source code on Github <https://github.com/sampsyo/llvm-pass-skeleton>. 2016-03-01 14:36 GMT+08:00
2016 Feb 26
1
How to write LLVM pass to collect register usage stats
Hi All, I wanted to collect the register usage stats for the program assigned by compiler(in other words "how many time each register will be accessed by the program when it will execute"). How to write LLVM pass which will analyse the code after LLVM global register allocation pass and output the stats. Regards, -Bala -- Thanks, Bala IIITA Allahabad -------------- next part
2016 May 05
2
LLVM cross compilation for arm target
Hello All, I am building llvm-clang tool chain for *arm target* by following the steps from http://clang.llvm.org/docs/CrossCompilation.html *However when I tried following cmake command for build tool chain it gives the error message :* #CC='clang' CXX='clang++' cmake -G Ninja /home/iiita/llvm-exp/llvm -DCMAKE_CROSSCOMPILING=True
2016 May 06
3
build issue in llvm-clang cross tool chain for arm target
Hello All, I am building llvm-clang cross tool chain for arm target, after successful build for Linux host now I am now building toolchain for *arm target*. However, I am getting below error message which seems to be confusing and not getting any idea how to resolve this issue. *Command :* #CC='clang' CXX='clang++' cmake -G Ninja /home/iiita/crossbuild/llvm
2016 Feb 28
0
Need help on how to write MachineFunctionPass
Hi Bala, For register allocation this might help : https://github.com/nael8r/How-To-Write-An-LLVM-Register-Allocator/blob/master/HowToWriteAnLLVMRegisterAllocator.rst -Vivek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160228/6f7aae38/attachment.html>
2013 Aug 05
2
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Hello, I want to add a global variable of arrayType in my MachineFunctionPass. However, I only get const Module from MachineFunction.getMMI().getModule(). I can't add any global variable to a const Module. Another way is to add a global variable in doInitialization in my MachineFunctionPass, but I can't determine the size of my arrayType for global variable in doInitialization. Is there
2014 Sep 17
3
[LLVMdev] Need guidance regarding MachineFunctionPass implementation
Hello all, I need to modify llvm bytecode / native code just before it is emitted i.e. after all the regular operations and optimizations are done. I was told that this can be achieved by implementing a MachineFunctionPass. I searched the internet for some tutorials or some example MachineFunctionPass but found nothing. Kindly point some links, or anything that may help. Thank you. Regards,
2013 Mar 15
2
[LLVMdev] write a simple MachineFunctionPass
Hello everyone, I have written several complex passes till now, but I cannot write a MachineFunctionPass pass. It just gives me segfault. Hence I reduced the pass to the following form : using namespace llvm; namespace { class CFGexplorator : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid CFGexplorator() : MachineFunctionPass(ID)
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
2013 Aug 05
0
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Antony, What are you trying to accomplish in this case? I did something very similar in the AMDIL backend, but it was not the cleanest solution and you are correct it has to be do at doInitialization stage and not at runOnMachineFunction. Micah > -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Antony Yu > Sent:
2013 Aug 05
0
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Can you tell us a bit more about what you're trying to accomplish? Changes to the IR performed during MachineFunctionPass::doInitialization will likely propagate down through code generation, but at that point what is the purpose of using a MachineFunctionPass? You won't have any analysis or instruction information available until runOnMachineFunction. On Mon, Aug 5, 2013 at 12:00 PM,
2013 Aug 05
3
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Micah, As you expected, I am trying to create local memory but in the NVPTX backend. It's really not convenient that I can't create local memory in runOnMachineFunction. Hmm.... Since I should do it at doInitialization stage, I also need to do some tricks in global variable and AsmPrinter to resize it. Did you use the similar way? Antony 2013/8/5 Micah Villmow <micah.villmow at
2013 Aug 05
2
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Micah, Thanks for your help. I will study on that code. Justin, Sorry for my misleading word. Local memory in OpenCL is the same as share memory in CUDA. What I mean is share memory, so MachineFrameInfo is not suitable to me. And I need codegen data, so FunctionPass is also not suitable. Anyway, thanks for the suggestion. Antony 2013/8/5 Justin Holewinski <justin.holewinski at
2013 Aug 05
0
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
If you're running a MachineFunctionPass, then the code has already been lowered to machine instructions and modifying the original IR will most likely not do what you want. You should only be using the IR as an immutable object for reference. If you want to change the IR, I would suggest using a FunctionPass instead of a MachineFunctionPass. Unless you need codegen data. At the
2013 Aug 06
0
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Yes, global variables are the only way to access shared memory. I'm just trying to get an idea of what you're aiming to accomplish to see if we can improve on the interface here. A MachineFunctionPass runs after instruction selection and relying on doInitialization to run before instruction selection is an implementation detail that I do not believe is guaranteed anywhere (I could be
2013 Aug 06
2
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
I want to create share memory in my MachineFunctionPass, and insert load/store instruction for it. The way to create share memory is to add global variables which are in share memory address space (not sure if it is the only way). Therefore, I should add global variables in fixed size in doInitialization, and record its real size in other place like MachineModuleInfo. Then modify or query its real
2014 Oct 02
2
[LLVMdev] Need guidance regarding MachineFunctionPass
Hello, I am writing a MachineFunctionPass that inspects the generated machine code, and examines each opcode and its corresponding operands. If the 'instruction + operands' match a particular sequence, then the pass should replace them with a fixed instruction + operands sequence. I tried using MachineInstr's getOpcode and getOperand functions but the pass didn't work as expected.
2013 Aug 07
0
[LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
Is there any way you could approximate the register/instruction usage and perform live-range analysis in a higher-level LLVM IR pass? I'm not sure how useful NVPTXRegisterInfo would be anyway. Unlike backends that target "real" ISAs, these structures do not contain any special properties about registers or instructions, like cost or scheduling information. Are you trying to figure