[llvm] 3f199cb - [SROA] Add test for #64081 (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 22 01:19:30 PST 2023
Author: Nikita Popov
Date: 2023-12-22T10:19:21+01:00
New Revision: 3f199cb14c7c0fbfe0d33bc5a04f356f35259bf4
URL: https://github.com/llvm/llvm-project/commit/3f199cb14c7c0fbfe0d33bc5a04f356f35259bf4
DIFF: https://github.com/llvm/llvm-project/commit/3f199cb14c7c0fbfe0d33bc5a04f356f35259bf4.diff
LOG: [SROA] Add test for #64081 (NFC)
Added:
llvm/test/Transforms/SROA/pr64081.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SROA/pr64081.ll b/llvm/test/Transforms/SROA/pr64081.ll
new file mode 100644
index 00000000000000..e03e5c497b5fb5
--- /dev/null
+++ b/llvm/test/Transforms/SROA/pr64081.ll
@@ -0,0 +1,33 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt -S -passes=sroa < %s | FileCheck %s
+
+%B = type { i1, i3 }
+
+; FIXME: This is a miscompile.
+define void @test(i7 %x) {
+; CHECK-LABEL: define void @test(
+; CHECK-SAME: i7 [[X:%.*]]) {
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[RES:%.*]] = alloca [2 x i8], align 1
+; CHECK-NEXT: [[TMP_SROA_1:%.*]] = alloca i3, align 1
+; CHECK-NEXT: store i7 [[X]], ptr [[TMP_SROA_1]], align 1
+; CHECK-NEXT: store i1 undef, ptr [[RES]], align 1
+; CHECK-NEXT: [[TMP_SROA_1_0_RES_SROA_IDX:%.*]] = getelementptr inbounds i8, ptr [[RES]], i64 1
+; CHECK-NEXT: [[TMP_SROA_1_0_TMP_SROA_1_0_COPYLOAD:%.*]] = load i3, ptr [[TMP_SROA_1]], align 1
+; CHECK-NEXT: store i3 [[TMP_SROA_1_0_TMP_SROA_1_0_COPYLOAD]], ptr [[TMP_SROA_1_0_RES_SROA_IDX]], align 1
+; CHECK-NEXT: [[TMP0:%.*]] = call i8 @use(ptr [[RES]])
+; CHECK-NEXT: ret void
+;
+bb:
+ %res = alloca [2 x i8]
+ %tmp = alloca { i1, i3 }
+ %tmp.1 = getelementptr i8, ptr %tmp, i64 1
+ store i7 %x, ptr %tmp.1
+ call void @llvm.memcpy.p0.p0.i64(ptr %res, ptr %tmp, i64 2, i1 false)
+ call i8 @use(ptr %res)
+ ret void
+}
+
+declare void @use(ptr)
+
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg)
More information about the llvm-commits
mailing list