[llvm-dev] Finding Size of X86 instruction in MachineFunctionPass

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 10 07:29:05 PDT 2018


Dear All,

Is there a way in newer versions of LLVM (4.0 and higher) to find the 
size of an x86 instruction within a MachineFunctionPass?  If not, is 
there something I can do in the MC layer to do this?

I'm trying to modify LLVM to implement something like Native Client in 
which groups of instructions are aligned at a specific alignment and 
have the same length.  My current approach is to split each 
MachineBasicBlock so that it is less than or equal to the desired size 
and then align each MachineBasicBlock at the proper alignment.  However, 
I've been poking around doxygen and can't find anything that will give 
me the size of an x86 instruction.

Thanks in advance,

John Criswell

-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell



More information about the llvm-dev mailing list