[llvm] Add debug location to strlen in LoopIdiomRecognize pass (PR #140164)

Amy Huang via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 14:40:27 PDT 2025


================
@@ -612,3 +612,52 @@ while.end:
   ret i64 %sub.ptr.sub
 }
 
+define i64 @valid_basic_strlen_with_dbg(ptr %str) {
+; Make sure that the call to strlen has debug info attached.
+; CHECK-LABEL: define i64 @valid_basic_strlen_with_dbg(
+; CHECK-SAME: ptr [[STR:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*]]:
+; CHECK-NEXT:    [[STRLEN:%.*]] = call i64 @strlen(ptr [[STR]]), !dbg !4
----------------
amykhuang wrote:

Oh true, I did not think of matching the contents of the debug metadata. fixed

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


More information about the llvm-commits mailing list