If the source being scanned has "llvm.AMDIL.barrier.global, it will match the first barrier test and return AMDIL_barrier, not AMDIL_barrier_global. On Nov 29, 2012, at 7:19 PM, Chris Lattner <clattner at apple.com> wrote:> Out of curiosity, what is wrong about that? It looks ok to me. > > -Chris > > On Nov 29, 2012, at 6:52 PM, "Relph, Richard" <Richard.Relph at amd.com> wrote: > >> Should tablegen detect this as an error, or is it documented as a limitation somewhere that we've missed? >> >> In the tablegen-generated file AMDILGenIntrinsics.inc, we have a bunch of if statements comparing strings, many of which are dead, preventing correct recognition of some intrinsics in the their text form. I'm not quite sure what GET_FUNCTION_RECOGNIZER is used for, but if it's used, it's broken… ;-) >> >> Here's a small segment: >> >> // Function name -> enum value recognizer code. >> #ifdef GET_FUNCTION_RECOGNIZER >> StringRef NameR(Name+6, Len-6); // Skip over 'llvm.' >> switch (Name[5]) { // Dispatch on first letter. >> default: break; >> case 'A': >> … >> if (NameR.startswith("MDIL.barrier.")) return AMDILIntrinsic::AMDIL_barrier; >> if (NameR.startswith("MDIL.barrier.global.")) return AMDILIntrinsic::AMDIL_barrier_global; >> if (NameR.startswith("MDIL.barrier.local.")) return AMDILIntrinsic::AMDIL_barrier_local; >> if (NameR.startswith("MDIL.barrier.region.")) return AMDILIntrinsic::AMDIL_barrier_region; >> … >> if (NameR.startswith("MDIL.fma.")) return AMDILIntrinsic::AMDIL_fma; >> if (NameR.startswith("MDIL.fma.rte.")) return AMDILIntrinsic::AMDIL_fma_rte; >> if (NameR.startswith("MDIL.fma.rtn.")) return AMDILIntrinsic::AMDIL_fma_rtn; >> if (NameR.startswith("MDIL.fma.rtp.")) return AMDILIntrinsic::AMDIL_fma_rtp; >> if (NameR.startswith("MDIL.fma.rtz.")) return AMDILIntrinsic::AMDIL_fma_rtz; >> … >> and several other similar instances. >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Yes that definitely sounds like a bug, no intrinsically in mainline are a prefix if another one, or we are getting lucky. -Chris On Nov 29, 2012, at 7:24 PM, "Relph, Richard" <Richard.Relph at amd.com> wrote:> If the source being scanned has "llvm.AMDIL.barrier.global, it will match the first barrier test and return AMDIL_barrier, not AMDIL_barrier_global. > > > On Nov 29, 2012, at 7:19 PM, Chris Lattner <clattner at apple.com> > wrote: > >> Out of curiosity, what is wrong about that? It looks ok to me. >> >> -Chris >> >> On Nov 29, 2012, at 6:52 PM, "Relph, Richard" <Richard.Relph at amd.com> wrote: >> >>> Should tablegen detect this as an error, or is it documented as a limitation somewhere that we've missed? >>> >>> In the tablegen-generated file AMDILGenIntrinsics.inc, we have a bunch of if statements comparing strings, many of which are dead, preventing correct recognition of some intrinsics in the their text form. I'm not quite sure what GET_FUNCTION_RECOGNIZER is used for, but if it's used, it's broken… ;-) >>> >>> Here's a small segment: >>> >>> // Function name -> enum value recognizer code. >>> #ifdef GET_FUNCTION_RECOGNIZER >>> StringRef NameR(Name+6, Len-6); // Skip over 'llvm.' >>> switch (Name[5]) { // Dispatch on first letter. >>> default: break; >>> case 'A': >>> … >>> if (NameR.startswith("MDIL.barrier.")) return AMDILIntrinsic::AMDIL_barrier; >>> if (NameR.startswith("MDIL.barrier.global.")) return AMDILIntrinsic::AMDIL_barrier_global; >>> if (NameR.startswith("MDIL.barrier.local.")) return AMDILIntrinsic::AMDIL_barrier_local; >>> if (NameR.startswith("MDIL.barrier.region.")) return AMDILIntrinsic::AMDIL_barrier_region; >>> … >>> if (NameR.startswith("MDIL.fma.")) return AMDILIntrinsic::AMDIL_fma; >>> if (NameR.startswith("MDIL.fma.rte.")) return AMDILIntrinsic::AMDIL_fma_rte; >>> if (NameR.startswith("MDIL.fma.rtn.")) return AMDILIntrinsic::AMDIL_fma_rtn; >>> if (NameR.startswith("MDIL.fma.rtp.")) return AMDILIntrinsic::AMDIL_fma_rtp; >>> if (NameR.startswith("MDIL.fma.rtz.")) return AMDILIntrinsic::AMDIL_fma_rtz; >>> … >>> and several other similar instances. >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >
Was a fix for this ever applied to trunk? On Fri, Nov 30, 2012 at 11:08 PM, Chris Lattner <clattner at apple.com> wrote:> Yes that definitely sounds like a bug, no intrinsically in mainline are a > prefix if another one, or we are getting lucky. > > -Chris > > On Nov 29, 2012, at 7:24 PM, "Relph, Richard" <Richard.Relph at amd.com> > wrote: > > > If the source being scanned has "llvm.AMDIL.barrier.global, it will > match the first barrier test and return AMDIL_barrier, not > AMDIL_barrier_global. > > > > > > On Nov 29, 2012, at 7:19 PM, Chris Lattner <clattner at apple.com> > > wrote: > > > >> Out of curiosity, what is wrong about that? It looks ok to me. > >> > >> -Chris > >> > >> On Nov 29, 2012, at 6:52 PM, "Relph, Richard" <Richard.Relph at amd.com> > wrote: > >> > >>> Should tablegen detect this as an error, or is it documented as a > limitation somewhere that we've missed? > >>> > >>> In the tablegen-generated file AMDILGenIntrinsics.inc, we have a > bunch of if statements comparing strings, many of which are dead, > preventing correct recognition of some intrinsics in the their text form. > I'm not quite sure what GET_FUNCTION_RECOGNIZER is used for, but if it's > used, it's broken… ;-) > >>> > >>> Here's a small segment: > >>> > >>> // Function name -> enum value recognizer code. > >>> #ifdef GET_FUNCTION_RECOGNIZER > >>> StringRef NameR(Name+6, Len-6); // Skip over 'llvm.' > >>> switch (Name[5]) { // Dispatch on first letter. > >>> default: break; > >>> case 'A': > >>> … > >>> if (NameR.startswith("MDIL.barrier.")) return > AMDILIntrinsic::AMDIL_barrier; > >>> if (NameR.startswith("MDIL.barrier.global.")) return > AMDILIntrinsic::AMDIL_barrier_global; > >>> if (NameR.startswith("MDIL.barrier.local.")) return > AMDILIntrinsic::AMDIL_barrier_local; > >>> if (NameR.startswith("MDIL.barrier.region.")) return > AMDILIntrinsic::AMDIL_barrier_region; > >>> … > >>> if (NameR.startswith("MDIL.fma.")) return AMDILIntrinsic::AMDIL_fma; > >>> if (NameR.startswith("MDIL.fma.rte.")) return > AMDILIntrinsic::AMDIL_fma_rte; > >>> if (NameR.startswith("MDIL.fma.rtn.")) return > AMDILIntrinsic::AMDIL_fma_rtn; > >>> if (NameR.startswith("MDIL.fma.rtp.")) return > AMDILIntrinsic::AMDIL_fma_rtp; > >>> if (NameR.startswith("MDIL.fma.rtz.")) return > AMDILIntrinsic::AMDIL_fma_rtz; > >>> … > >>> and several other similar instances. > >>> > >>> _______________________________________________ > >>> LLVM Developers mailing list > >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >> > > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130703/9c66a9d1/attachment.html>