Thank you Mr. Tim. Is "AArch64" a namespace? Because when I tried "X86::MOV", it gave me an error saying that first define X86 namespace. Sorry if I sound stupid but I am new to LLVM. Thank you again. On Thu, Oct 2, 2014 at 8:16 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Sachin, > > > int op = mi->getOpcode(); > > This is a target-specific opcode, and corresponds to one of the values > defined in (from a CMake build directory) > lib/Target/XYZ/XYZGenInstrInfo.inc. > > The easiest way to find out which is actually to use > MachineInstr::dump (and/or "llc -debug" from the command-line to print > it out automatically); if it prints something like (to pick a > completely random example from AArch64): > > %X1<def> = LDRXui <fi#3>, 0; mem:LD8[%result] dbg:blockstret.c:20: > > Then you'd want to compare "op" against "AArch64::LDRXui" > > Cheers. > > Tim. >-- Regards, Sachin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141003/8322f0aa/attachment.html>
Hi Sachin, On 3 October 2014 13:24, sachin arora <sachin345678 at gmail.com> wrote:> Thank you Mr. Tim. Is "AArch64" a namespace? Because when I tried > "X86::MOV", it gave me an error saying that first define X86 namespace. > Sorry if I sound stupid but I am new to LLVM. Thank you again.Yes, AArch64 is the namespace. X86 should work too. There are 2 possible issues: most simply, you need to include X86InstrInfo.h directly or indirectly for these enumerators to be defined; if that's not it, you're probably getting an error because X86::MOV doesn't exist as a single opcode. LLVM has many different MOV instructions to model x86's different addressing modes, and you're going to have to find out which ones you need to deal with by looking at their definitions in the .td files. Cheers. Tim.
Thank you Mr. Tim. I was wondering if you can tell me in which file 'get()' is defined. I am having trouble using this function. For example if I write 'get(AArch64::LDRXui)' then there is an error generated which says: use of undeclared identifier 'get'. Thanks again !! On Fri, Oct 3, 2014 at 9:56 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Sachin, > > On 3 October 2014 13:24, sachin arora <sachin345678 at gmail.com> wrote: > > Thank you Mr. Tim. Is "AArch64" a namespace? Because when I tried > > "X86::MOV", it gave me an error saying that first define X86 namespace. > > Sorry if I sound stupid but I am new to LLVM. Thank you again. > > Yes, AArch64 is the namespace. X86 should work too. There are 2 > possible issues: most simply, you need to include X86InstrInfo.h > directly or indirectly for these enumerators to be defined; if that's > not it, you're probably getting an error because X86::MOV doesn't > exist as a single opcode. > > LLVM has many different MOV instructions to model x86's different > addressing modes, and you're going to have to find out which ones you > need to deal with by looking at their definitions in the .td files. > > Cheers. > > Tim. >-- Regards, Sachin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141008/ca04c7ea/attachment.html>
Maybe Matching Threads
- [LLVMdev] Need guidance regarding MachineFunctionPass
- [LLVMdev] Need guidance regarding MachineFunctionPass
- [LLVMdev] Need guidance regarding MachineFunctionPass implementation
- [LLVMdev] Need guidance regarding MachineFunctionPass
- Building SPEC CPU2006 Fortran benchmarks with llvm