[llvm-commits] Patch: Have isa<IntrinsicInst> do a string prefix compare

Peter Cooper peter_cooper at apple.com
Mon Dec 17 15:42:20 PST 2012


Hi Jim

We do already have this in Function::getIntrinsicID():

if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
      || Name[2] != 'v' || Name[3] != 'm')
    return 0;  // All intrinsics start with 'llvm.'

So all intrinsics do start with "llvm.", but yes, this doesn't cover the point you raised that this would reserve all names starting with "llvm." as intrinsics.

Pete
On Dec 17, 2012, at 3:35 PM, Jim Grosbach <grosbach at apple.com> wrote:

> Hi Michael,
> 
> This assumes that a) all intrinsics have names starting with "llvm." and b) every function name starting with "llvm." is an intrinsic. Both of those seem pretty strong to me. I don't suppose there's any chance there's docs to that effect in LangRef or anything like that?
> 
> -Jim
> 
> On Dec 17, 2012, at 1:13 PM, Michael Ilseman <milseman at apple.com> wrote:
> 
>> Refactor isIntrinsic() to be quicker, and change classof() (and thus, isa<IntrinsicInst>()) to use it. This decreases the number of occurrences of the slow-path string matching performed by getIntrinsicID().
>> 
>> <0001-Refactor-isIntrinsic-to-be-quicker-and-change-classo.patch>_______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121217/337996a1/attachment.html>


More information about the llvm-commits mailing list