[clang] [Clang] [Lexer] Detect SSE4.2 availability at runtime in fastParseASCIIIdentifier (PR #171914)

Mikael Holmen via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 10 05:12:09 PST 2026


================
@@ -1943,12 +1955,20 @@ fastParseASCIIIdentifier(const char *CurPtr,
       continue;
     return CurPtr;
   }
-#endif
 
-  unsigned char C = *CurPtr;
-  while (isAsciiIdentifierContinue(C))
-    C = *++CurPtr;
-  return CurPtr;
+  return fastParseASCIIIdentifierScalar(CurPtr);
+}
+
+__attribute__((target("sse4.2"))) static const char *
+fastParseASCIIIdentifier(const char *CurPtr, const char *BufferEnd) {
----------------
mikaelholmen wrote:

> I am still unable to reproduce. Are you able to reproduce on godbolt? Sorry for the inconvenience.

I'm sorry, but my godbolt skills reach just far enough to use it to run clang/opt/llc on some small code example, but not to compile the entire compiler.

https://github.com/llvm/llvm-project/pull/171914


More information about the cfe-commits mailing list