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

Michael Ilseman milseman at apple.com
Mon Dec 17 15:44:59 PST 2012


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."

The existing code in getIntrinsicID() has this assumption already, I'm just migrating it out into isIntrinsic().

> and b) every function name starting with "llvm." is an intrinsic.

I agree, this is a new assumption with my patch. I'll look into the docs, but it feels like "llvm.*" should be reserved for intrinsics. For example, if a user defines a function with that prefix, it might be auto-magically made into an intrinsic should LLVM ever introduce an intrinsic with that name. This would even happen should LLVM ever introduce an intrinsic with a similar enough prefix to that name.

> 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
> 




More information about the llvm-commits mailing list