diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h
index fa48ee6bdbb2a0efadb155b8496d3706fc658080..69894a4b53e7a685f7e838d94a4930b7cf9caa67 100644
--- a/indra/llcommon/lluuid.h
+++ b/indra/llcommon/lluuid.h
@@ -138,8 +138,8 @@ class LL_COMMON_API LLUUID
 
 	bool operator<(const LLUUID& rhs) const
 	{
-		__m128i mm_left = _mm_lddqu_si128(reinterpret_cast<const __m128i*>(mData));
-		__m128i mm_right = _mm_lddqu_si128(reinterpret_cast<const __m128i*>(rhs.mData));
+		__m128i mm_left = load_unaligned_si128(mData);
+		__m128i mm_right = load_unaligned_si128(rhs.mData);
 
 		// To emulate lexicographical_compare behavior we have to perform two comparisons - the forward and reverse one.
 		// Then we know which bytes are equivalent and which ones are different, and for those different the comparison results
diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h
index 3f7a0bb3ed6458f08728d371d615f237febb3adc..549f723352cfac5a755508fc847c4328b3414996 100644
--- a/indra/llprimitive/llmaterialid.h
+++ b/indra/llprimitive/llmaterialid.h
@@ -79,8 +79,8 @@ class LLMaterialID
 
 	bool operator<(const LLMaterialID& rhs) const
 	{
-		__m128i mm_left = _mm_lddqu_si128(reinterpret_cast<const __m128i*>(mID));
-		__m128i mm_right = _mm_lddqu_si128(reinterpret_cast<const __m128i*>(rhs.mID));
+		__m128i mm_left = load_unaligned_si128(mID);
+		__m128i mm_right = load_unaligned_si128(rhs.mID);
 
 		// To emulate lexicographical_compare behavior we have to perform two comparisons - the forward and reverse one.
 		// Then we know which bytes are equivalent and which ones are different, and for those different the comparison results