Is there a reason why memcmp isn't an intrinsic?

Since you have memcpy, memmove, and memset in there, I was wondering why memcmp wasn't there as well. It seems obvious - which makes me think that if it's not there, then there must be some reason for it.

-- Talin

Why do you want it to be an intrinsic? What does that provide?

-Chris

Chris Lattner wrote:

Since you have memcpy, memmove, and memset in there, I was wondering why
memcmp wasn't there as well. It seems obvious - which makes me think
that if it's not there, then there must be some reason for it.
    
Why do you want it to be an intrinsic? What does that provide?
  

I can't really answer that question, since I don't know why memcpy, et al, are intrinsics either. I was assuming that whatever rationale made it beneficial to make the mem.* functions intrinsics would apply to memcmp as well...but perhaps this is not the case?

The reason memcpy is an intrinsic is so that it can capture alignment information about the pointers, and someday we may add volatility info to it. Since memcmp isn't currently expanded inline by any code generators, this alignment info wouldn't be used for anything. When/if someone is interested in doing this in the codegen, it would make sense to add the intrinsic.

-Chris