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

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 11 11:39:37 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Thibault Monnier (Thibault-Monnier)

<details>
<summary>Changes</summary>

This PR reopens #<!-- -->171914 after it was merged then reverted by #<!-- -->174946 because of compilation failures.

The only change from the original PR is f535c05bc332a84709df497ed27aaba193dab0f3. Waiting for confirmation from @<!-- -->mstorsjo and @<!-- -->mikaelholmen that it fixes the issues.

---
Full diff: https://github.com/llvm/llvm-project/pull/175452.diff


1 Files Affected:

- (modified) clang/lib/Lex/Lexer.cpp (+4-3) 


``````````diff
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 5e8ed5f815c7b..50699511e0888 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -1932,7 +1932,7 @@ static const char *fastParseASCIIIdentifierScalar(const char *CurPtr) {
 // the 'target' attribute, which is used for runtime dispatch. Otherwise, we
 // fall back to the scalar implementation.
 #if (defined(__i386__) || defined(__x86_64__)) && defined(__has_attribute) &&  \
-    __has_attribute(target) && !defined(_MSC_VER)
+    __has_attribute(target) && defined(__linux__)
 __attribute__((target("sse4.2"))) static const char *
 fastParseASCIIIdentifierSSE42(const char *CurPtr, const char *BufferEnd) {
   alignas(16) static constexpr char AsciiIdentifierRange[16] = {
@@ -1965,8 +1965,9 @@ fastParseASCIIIdentifier(const char *CurPtr, const char *BufferEnd) {
 
 __attribute__((target("default")))
 #endif
-static const char *fastParseASCIIIdentifier(const char *CurPtr,
-                                            const char *BufferEnd) {
+static const char *
+fastParseASCIIIdentifier(const char *CurPtr,
+                         [[maybe_unused]] const char *BufferEnd) {
   return fastParseASCIIIdentifierScalar(CurPtr);
 }
 

``````````

</details>


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


More information about the cfe-commits mailing list