[llvm] 041ec82 - [Verifier] Skip debug location check for some non-inlinable functions
Yuanfang Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 11:04:26 PDT 2022
Author: Yuanfang Chen
Date: 2022-09-02T11:03:55-07:00
New Revision: 041ec822421aae33f064d96a21607e550766dd4d
URL: https://github.com/llvm/llvm-project/commit/041ec822421aae33f064d96a21607e550766dd4d
DIFF: https://github.com/llvm/llvm-project/commit/041ec822421aae33f064d96a21607e550766dd4d.diff
LOG: [Verifier] Skip debug location check for some non-inlinable functions
If a callee function is not interposable, skip debug location check for its callsites. Doing this is instrumentation-friendly otherwise under some conditions this check triggers for some un-inlinable call sites.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D133060
Added:
Modified:
llvm/lib/IR/Verifier.cpp
llvm/test/Verifier/callsite-dbgloc.ll
Removed:
################################################################################
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index fe6ae62813b91..004d2641a893a 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3442,8 +3442,10 @@ void Verifier::visitCallBase(CallBase &Call) {
// Verify that each inlinable callsite of a debug-info-bearing function in a
// debug-info-bearing function has a debug location attached to it. Failure to
- // do so causes assertion failures when the inliner sets up inline scope info.
+ // do so causes assertion failures when the inliner sets up inline scope info
+ // (Interposable functions are not inlinable).
if (Call.getFunction()->getSubprogram() && Call.getCalledFunction() &&
+ !Call.getCalledFunction()->isInterposable() &&
Call.getCalledFunction()->getSubprogram())
CheckDI(Call.getDebugLoc(),
"inlinable function call in a function with "
diff --git a/llvm/test/Verifier/callsite-dbgloc.ll b/llvm/test/Verifier/callsite-dbgloc.ll
index c809ba2518006..4fdb55da48413 100644
--- a/llvm/test/Verifier/callsite-dbgloc.ll
+++ b/llvm/test/Verifier/callsite-dbgloc.ll
@@ -19,6 +19,20 @@ entry:
ret void, !dbg !10
}
+; Function Attrs: nounwind ssp uwtable
+define weak void @j() #0 !dbg !17 {
+entry:
+ call void (...) @i(), !dbg !18
+ ret void, !dbg !19
+}
+
+; Function Attrs: nounwind ssp uwtable
+define linkonce_odr void @k() #0 !dbg !20 {
+entry:
+ call void (...) @i(), !dbg !21
+ ret void, !dbg !22
+}
+
declare void @i(...) #1
; Function Attrs: nounwind ssp uwtable
@@ -27,6 +41,10 @@ entry:
; Manually removed !dbg.
; CHECK: inlinable function call in a function with debug info must have a !dbg location
call void @h()
+; CHECK-NOT: inlinable function call in a function with debug info must have a !dbg location
+ call void @j()
+; CHECK: inlinable function call in a function with debug info must have a !dbg location
+ call void @k()
ret void, !dbg !13
}
@@ -62,3 +80,9 @@ attributes #0 = { nounwind ssp uwtable }
!14 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: false, unit: !0, retainedNodes: !2)
!15 = !DILocation(line: 4, column: 12, scope: !14)
!16 = !DILocation(line: 4, column: 17, scope: !14)
+!17 = distinct !DISubprogram(name: "j", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !0, retainedNodes: !2)
+!18 = !DILocation(line: 4, column: 12, scope: !17)
+!19 = !DILocation(line: 4, column: 17, scope: !17)
+!20 = distinct !DISubprogram(name: "k", scope: !1, file: !1, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: false, unit: !0, retainedNodes: !2)
+!21 = !DILocation(line: 4, column: 12, scope: !20)
+!22 = !DILocation(line: 4, column: 17, scope: !20)
More information about the llvm-commits
mailing list