Displaying 20 results from an estimated 30000 matches similar to: "Finding Size of X86 instruction in MachineFunctionPass"
2018 Jul 10
2
Finding Size of X86 instruction in MachineFunctionPass
The actual size of even a MC instruction will change during relaxation--we don't choose between 8-bit jumps and wider jumps until relaxation. You can get the actual encoding of an MCInst via MCCodeEmitter, but if you expect relaxation to occur, or particularly if you're testing before register allocation, the size could only be an estimate and shouldn't be trusted for exact size.
2012 Oct 23
4
[LLVMdev] How to Find Instruction Encoding for a MachineInstr
Dear All,
I'm enhancing a MachineFunctionPass that enforces control-flow
integrity. One of the things I want to do is to set the alignment of an
instruction (by adding NOPs before it in the MachineBasicBlock or by
emitting an alignment directive to the assembler) if it causes a
specific sequence of bytes to be generated at a specific alignment. The
goal is to ensure that sequences of
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.
2012 Oct 24
1
[LLVMdev] How to Find Instruction Encoding for a MachineInstr
On 10/23/12 7:19 PM, Craig Topper wrote:
> What function provides the encoding length? X86 in particular is so
> difficult to encode that only the old style JIT and the MC Code
> Emitter could possibly know how many bytes something takes.
The getSize() method of MCInstrDesc which can be fetched from a
MachineInstr using the getDesc() method:
2015 Jul 02
2
[LLVMdev] Load MachineFunctionPass plugin from library in llc?
> On Jul 2, 2015, at 2:05 PM, Jim Grosbach <grosbach at apple.com> wrote:
>
>>
>> On Jul 2, 2015, at 1:17 PM, Ethan J. Johnson <ejohns48 at cs.rochester.edu <mailto:ejohns48 at cs.rochester.edu>> wrote:
>>
>> Hi all,
>>
>> I am working on creating a MachineFunctionPass to perform an analysis on X86 code. After a bit of trouble, I was
2012 Oct 24
0
[LLVMdev] How to Find Instruction Encoding for a MachineInstr
What function provides the encoding length? X86 in particular is so
difficult to encode that only the old style JIT and the MC Code Emitter
could possibly know how many bytes something takes.
On Tue, Oct 23, 2012 at 11:58 AM, John Criswell <criswell at illinois.edu>wrote:
> Dear All,
>
> I'm enhancing a MachineFunctionPass that enforces control-flow integrity.
> One of the
2015 Jul 02
2
[LLVMdev] Load MachineFunctionPass plugin from library in llc?
Hi all,
I am working on creating a MachineFunctionPass to perform an analysis on X86
code. After a bit of trouble, I was able to get my pass compiling and
running correctly in llc. However, since a machine pass is compiled directly
into the code generator, rerunning "make" across the LLVM build tree
involves re-linking most of the major libraries and executables. This is a
rather
2015 Nov 17
2
Confused on how to do a machinefunction pass
Hi,
So, I run my pass in X86 target with llc command and it printed out
"hello****". Now I am trying to do the same pass for ARM target. So I did
exactly what I did for X86 as mentioned in my previous posts. When I run
the following command:
llc -march=arm test.ll -o test
nothing prints out. I did the same for MIPS target too and I got no result.
Can anyone tell me what I'm doing
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,
2015 Nov 17
2
Confused on how to do a machinefunction pass
Yes, I have done exactly the same. The wawanalyzer is the same. I changed
ARM.h and ARMTargetMachine.cpp in the tager/arm folder. then I make
tool/llc and lib folder.
On Tue, Nov 17, 2015 at 10:55 AM, John Criswell <jtcriswel at gmail.com> wrote:
> On 11/17/15 12:16 AM, fateme Hoseini via llvm-dev wrote:
>
> Hi,
> So, I run my pass in X86 target with llc command and it printed
2012 Oct 24
0
[LLVMdev] How to Find Instruction Encoding for a MachineInstr
On 10/23/2012 1:58 PM, John Criswell wrote:
> Dear All,
>
> I'm enhancing a MachineFunctionPass that enforces control-flow
> integrity. One of the things I want to do is to set the alignment of
> an instruction (by adding NOPs before it in the MachineBasicBlock or
> by emitting an alignment directive to the assembler) if it causes a
> specific sequence of bytes to be
2016 Mar 20
2
[GSoC 2016] Need more info on Add a MachineModulePass
On 3/18/16 12:33 PM, Quentin Colombet via llvm-dev wrote:
> Hi Vivek,
>
>> On Mar 16, 2016, at 1:00 PM, vivek pandya via llvm-dev
>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>
>> Hello,
>>
>> Probably this may be too late to start thinking about this project
>> but I think this is particularly useful
2015 Nov 04
3
Confused on how to do a machinefunction pass
Thank you so much.
That helped alot.
Fami
On Wed, Nov 4, 2015 at 9:40 AM, John Criswell <jtcriswel at gmail.com> wrote:
> On 11/3/15 7:54 PM, fateme Hoseini wrote:
>
> Dear John,
> Thank you so much for your help. I looked at those documents. Could you
> kindly answer the following questions:
>
> Does it mean that I have to make my own backend target in order to write
2015 Aug 11
3
Working with X86 registers in MachineInstr
Hi all,
I am attempting to implement the "reaching definitions" data-flow algorithm
on (X86) MachineBasicBlocks for an analysis pass. To do this, I need to
compute gen/kill sets for machine basic blocks. To start with, I am only
considering the general-purpose registers, RAX-R15 and their sub-registers.
Thus, I need to examine each MachineInstr to determine which register(s) it
2012 Oct 24
1
[LLVMdev] How to Find Instruction Encoding for a MachineInstr
On Oct 23, 2012, at 6:22 PM, Joshua Cranmer <pidgeot18 at gmail.com> wrote:
> On 10/23/2012 1:58 PM, John Criswell wrote:
>> Dear All,
>>
>> I'm enhancing a MachineFunctionPass that enforces control-flow integrity. One of the things I want to do is to set the alignment of an instruction (by adding NOPs before it in the MachineBasicBlock or by emitting an alignment
2015 Nov 04
2
Confused on how to do a machinefunction pass
Dear John,
Thank you so much for your help. I looked at those documents. Could you
kindly answer the following questions:
Does it mean that I have to make my own backend target in order to write a
machine pass even if I want to run a simple machinefunction pass? for
example,if I want my pass to get MIPS instructions as an input, I have to
copy all the files from mips target and add a file to it
2015 Feb 28
2
[LLVMdev] Getting basic block address offset from its parent function
Hi John
Thanks for your suggestions, they all sound reasonable to me. The way I'm
thinking right now is to write a MachineFuncionPass that iterate through
each MachinBasicBlock, for each MBB, adds up the instructions counts of
previous MBBs, that number multiply by 4 should be the offset of that MBB
from its MachineFunction. In order to correctly count the instructions,
this pass should be
2015 Feb 28
0
[LLVMdev] Getting basic block address offset from its parent function
On 2/27/15 6:30 PM, Ziqiang Patrick Huang wrote:
> Hi, all
>
> Is there a way of getting the basic block offset from its parent
> function ?
At the LLVM IR level, no. At the code generator layer
(MachineFunctionPass layer or the MC layer), probably yes.
>
> What I'm trying to do is to get an execution count of each basic
> blocks, so I need to know the starting
2016 Mar 16
3
[GSoC 2016] Need more info on Add a MachineModulePass
Hello,
Probably this may be too late to start thinking about this project but I
think this is particularly useful feature for LLVM. A quick use I can think
of this is Implementing Inter-procedural Register Allocation ( for Research
purpose ).
I have start looking at the code for MachineFunctionPass, I think currently
MachineModule class is not available ( the project work will include that )
but
2015 Feb 27
2
[LLVMdev] Getting basic block address offset from its parent function
Hi, all
Is there a way of getting the basic block offset from its parent function ?
What I'm trying to do is to get an execution count of each basic blocks, so
I need to know the starting address of each basic blocks. Obviously we
can't get the absolute address before linking the program, but the offset
relative to parent function should be available so I can take it and get
the function