[llvm] [Assignment Tracking] Trim assignments for untagged out of bounds stores (PR #66095)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 03:02:56 PDT 2023


================
@@ -0,0 +1,94 @@
+; RUN: llc %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s
+;--implicit-check-not=DBG_
+
+;; Similarly to untagged-store-assignment-outside-variable.ll this test checks
+;; that out of bounds stores that have no DIAssignID are interpreted correctly
+;; (see inline comments and checks). Hand-written IR.
+
+target triple = "x86_64-unknown-linux-gnu"
+
+declare dso_local void @a(i32)
+
+define dso_local void @b() local_unnamed_addr !dbg !14 {
+entry:
+  %c = alloca [4 x i16], align 8, !DIAssignID !24
+  %arrayidx = getelementptr inbounds [4 x i16], ptr %c, i64 0, i64 2
+  call void @llvm.dbg.assign(metadata i1 undef, metadata !18, metadata !DIExpression(DW_OP_LLVM_fragment, 128, 32), metadata !24, metadata ptr %arrayidx, metadata !DIExpression()), !dbg !26
+
+;; Set variable value (use a call to prevent eliminating redundant DBG_VALUEs).
----------------
SLTozer wrote:

Comment is copied from below, but there's no call on this one; is there meant to be? The debug assign above is definitely redundant with these two being adjacent.

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


More information about the llvm-commits mailing list