[llvm] r335241 - [NFC][ARM] ldrd/strd negative tests
Sam Parker via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 21 07:53:06 PDT 2018
Author: sam_parker
Date: Thu Jun 21 07:53:06 2018
New Revision: 335241
URL: http://llvm.org/viewvc/llvm-project?rev=335241&view=rev
Log:
[NFC][ARM] ldrd/strd negative tests
Add negative tests for load and stores of alignment 2.
Modified:
llvm/trunk/test/CodeGen/ARM/ldrd.ll
Modified: llvm/trunk/test/CodeGen/ARM/ldrd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ldrd.ll?rev=335241&r1=335240&r2=335241&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/ldrd.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/ldrd.ll Thu Jun 21 07:53:06 2018
@@ -207,5 +207,57 @@ entry:
ret void
}
+; CHECK-LABEL: bitcast_ptr_ldr
+; CHECK-NOT: ldrd
+define i32 @bitcast_ptr_ldr(i16* %In) {
+entry:
+ %0 = bitcast i16* %In to i32*
+ %in.addr.0 = getelementptr inbounds i32, i32* %0, i32 0
+ %in.addr.1 = getelementptr inbounds i32, i32* %0, i32 1
+ %1 = load i32, i32* %in.addr.0, align 2
+ %2 = load i32, i32* %in.addr.1, align 2
+ %mul = mul i32 %1, %2
+ ret i32 %mul
+}
+
+; CHECK-LABEL: bitcast_gep_ldr
+; CHECK-NOT: ldrd
+define i32 @bitcast_gep_ldr(i16* %In) {
+entry:
+ %in.addr.0 = getelementptr inbounds i16, i16* %In, i32 0
+ %in.addr.1 = getelementptr inbounds i16, i16* %In, i32 2
+ %cast.0 = bitcast i16* %in.addr.0 to i32*
+ %cast.1 = bitcast i16* %in.addr.1 to i32*
+ %0 = load i32, i32* %cast.0, align 2
+ %1 = load i32, i32* %cast.1, align 2
+ %mul = mul i32 %0, %1
+ ret i32 %mul
+}
+
+; CHECK-LABEL: bitcast_ptr_str
+; CHECK-NOT: strd
+define void @bitcast_ptr_str(i32 %arg0, i32 %arg1, i16* %out) {
+entry:
+ %0 = bitcast i16* %out to i32*
+ %out.addr.0 = getelementptr inbounds i32, i32* %0, i32 0
+ %out.addr.1 = getelementptr inbounds i32, i32* %0, i32 1
+ store i32 %arg0, i32* %out.addr.0, align 2
+ store i32 %arg1, i32* %out.addr.1, align 2
+ ret void
+}
+
+; CHECK-LABEL: bitcast_gep_str
+; CHECK-NOT: strd
+define void @bitcast_gep_str(i32 %arg0, i32 %arg1, i16* %out) {
+entry:
+ %out.addr.0 = getelementptr inbounds i16, i16* %out, i32 0
+ %out.addr.1 = getelementptr inbounds i16, i16* %out, i32 2
+ %cast.0 = bitcast i16* %out.addr.0 to i32*
+ %cast.1 = bitcast i16* %out.addr.1 to i32*
+ store i32 %arg0, i32* %cast.0, align 2
+ store i32 %arg1, i32* %cast.1, align 2
+ ret void
+}
+
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) nounwind
More information about the llvm-commits
mailing list