[llvm] [DSE] Split memory intrinsics if they are dead in the middle (PR #75478)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 18:54:35 PDT 2024


================
@@ -0,0 +1,94 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+
+; RUN: opt < %s -passes=dse -S | FileCheck %s
+
+define void @overwrite_middle(ptr nocapture noundef writeonly %X) {
+; CHECK-LABEL: define void @overwrite_middle(
+; CHECK-SAME: ptr nocapture noundef writeonly [[X:%.*]]) {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr inbounds i8, ptr [[X]], i64 976
+; CHECK-NEXT:    tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) [[TMP0]], i8 5, i64 24, i1 false)
----------------
DianQK wrote:

We also need to use a smaller align value, can you add a test case for that?

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


More information about the llvm-commits mailing list