[llvm-branch-commits] [llvm] [X86] Remove extra MOV after widening atomic load (PR #138635)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun May 11 06:10:48 PDT 2025


================
@@ -1200,6 +1200,13 @@ def : Pat<(i16 (atomic_load_nonext_16 addr:$src)), (MOV16rm addr:$src)>;
 def : Pat<(i32 (atomic_load_nonext_32 addr:$src)), (MOV32rm addr:$src)>;
 def : Pat<(i64 (atomic_load_nonext_64 addr:$src)), (MOV64rm addr:$src)>;
 
+def : Pat<(v4i32 (scalar_to_vector (i32 (anyext (i16 (atomic_load_16 addr:$src)))))),
+           (MOVDI2PDIrm addr:$src)>;   // load atomic <2 x i8>
----------------
jofrn wrote:

Switched it to a `zext` and now it dereferences 16 bits in the asm.

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


More information about the llvm-branch-commits mailing list