enhance the load/store narrowing optimization to handle a
[oota-llvm.git] / test / CodeGen / X86 / store-narrow.ll
index f47bf31098bf0295aaee27d466d7f461db133fd6..a6566979e477048c96dce61665f482f44809df4b 100644 (file)
@@ -105,3 +105,23 @@ entry:
 ; X32: movb    8(%esp), %al
 ; X32: movb    %al, 5(%{{.*}})
 }
+
+define i32 @test7(i64* nocapture %a0, i8 zeroext %a1, i32* %P2) nounwind {
+entry:
+  %OtherLoad = load i32 *%P2
+  %A = load i64* %a0, align 4
+  %B = and i64 %A, -280375465082881    ; 0xFFFF00FFFFFFFFFF
+  %C = zext i8 %a1 to i64
+  %CS = shl i64 %C, 40
+  %D = or i64 %B, %CS
+  store i64 %D, i64* %a0, align 4
+  ret i32 %OtherLoad
+; X64: test7:
+; X64: movb    %sil, 5(%rdi)
+
+
+; X32: test7:
+; X32: movb    8(%esp), %cl
+; X32: movb    %cl, 5(%{{.*}})
+}
+