Hi all, I want to implement llvm.memory.barrier on PowerPC. The implementation would be the single instruction "sync", but currently it's defined with: setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand) in lib/Target/PowerPC/PPCISelLowering.cpp, which causes it to be a noop. I replaced the "Expand" with "Legal" in the hope I'd get an error message that'd point me to where I need to start adding stuff, but I just got the cryptic: Cannot yet select: 0x10fc0500: ch = MemBarrier 0x10fc0368, 0x10fc0698, 0x10fc0610, 0x10fc0698, 0x10fc0698, 0x10fc0698". Can anyone point me in the right direction? Cheers, Gary -- http://gbenson.net/
Hi Gary, You're probably missing the required recipe in the .td file. Look at the documentation for tablegen and maybe try to find some examples to copy. Good luck! -bw On Jul 25, 2008, at 5:57 AM, Gary Benson <gbenson at redhat.com> wrote:> Hi all, > > I want to implement llvm.memory.barrier on PowerPC. The > implementation would be the single instruction "sync", but > currently it's defined with: > > setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand) > > in lib/Target/PowerPC/PPCISelLowering.cpp, which causes it > to be a noop. I replaced the "Expand" with "Legal" in the > hope I'd get an error message that'd point me to where I > need to start adding stuff, but I just got the cryptic: > > Cannot yet select: 0x10fc0500: ch = MemBarrier 0x10fc0368, > 0x10fc0698, 0x10fc0610, 0x10fc0698, 0x10fc0698, 0x10fc0698". > > Can anyone point me in the right direction? > > Cheers, > Gary > > -- > http://gbenson.net/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Jul 25, 2008, at 3:57 AM, Gary Benson wrote:> Hi all, > > I want to implement llvm.memory.barrier on PowerPC. The > implementation would be the single instruction "sync", but > currently it's defined with: > > setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand) > > in lib/Target/PowerPC/PPCISelLowering.cpp, which causes it > to be a noop. I replaced the "Expand" with "Legal" in theThat's not necessary. You can just remove this line. The default action is "legal".> > hope I'd get an error message that'd point me to where I > need to start adding stuff, but I just got the cryptic: > > Cannot yet select: 0x10fc0500: ch = MemBarrier 0x10fc0368, > 0x10fc0698, 0x10fc0610, 0x10fc0698, 0x10fc0698, 0x10fc0698". > > > Can anyone point me in the right direction?You need to add a pattern to match "membarrier" (see Target/ TargetSelectionDAG.td) to the right target instruction(s) in PPCInstrInfo.td. You can take a look at the examples in X86InstrSSE.td. Evan> > > Cheers, > Gary > > -- > http://gbenson.net/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] Implementing llvm.memory.barrier on PowerPC
- [LLVMdev] Implementing llvm.memory.barrier on PowerPC
- [LLVMdev] Implementing llvm.memory.barrier on PowerPC
- [LLVMdev] Implementing llvm.memory.barrier on PowerPC
- [LLVMdev] Implementing llvm.memory.barrier on PowerPC