[PATCH] D23212: Do not assign new discriminator for all intrinsics.
Dehao Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 5 10:56:29 PDT 2016
danielcdh created this revision.
danielcdh added reviewers: dnovillo, davidxl.
danielcdh added a subscriber: llvm-commits.
We do not care about intrinsic calls when assigning discriminators.
https://reviews.llvm.org/D23212
Files:
lib/Transforms/Utils/AddDiscriminators.cpp
test/Transforms/AddDiscriminators/call.ll
Index: test/Transforms/AddDiscriminators/call.ll
===================================================================
--- test/Transforms/AddDiscriminators/call.ll
+++ test/Transforms/AddDiscriminators/call.ll
@@ -12,14 +12,20 @@
define void @_Z3foov() #0 !dbg !4 {
call void @_Z3barv(), !dbg !10
; CHECK: call void @_Z3barv(), !dbg ![[CALL0:[0-9]+]]
+ %a = alloca [100 x i8], align 16
+ %b = bitcast [100 x i8]* %a to i8*
+ call void @llvm.lifetime.start(i64 100, i8* %b), !dbg !11
+ call void @llvm.lifetime.end(i64 100, i8* %b), !dbg !11
call void @_Z3barv(), !dbg !11
; CHECK: call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]]
call void @_Z3barv(), !dbg !12
; CHECK: call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]]
ret void, !dbg !13
}
declare void @_Z3barv() #1
+declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind argmemonly
+declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind argmemonly
attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
Index: lib/Transforms/Utils/AddDiscriminators.cpp
===================================================================
--- lib/Transforms/Utils/AddDiscriminators.cpp
+++ lib/Transforms/Utils/AddDiscriminators.cpp
@@ -184,7 +184,7 @@
// discriminator for this instruction.
for (BasicBlock &B : F) {
for (auto &I : B.getInstList()) {
- if (isa<DbgInfoIntrinsic>(&I))
+ if (isa<IntrinsicInst>(&I))
continue;
const DILocation *DIL = I.getDebugLoc();
if (!DIL)
@@ -222,7 +222,7 @@
LocationSet CallLocations;
for (auto &I : B.getInstList()) {
CallInst *Current = dyn_cast<CallInst>(&I);
- if (!Current || isa<DbgInfoIntrinsic>(&I))
+ if (!Current || isa<IntrinsicInst>(&I))
continue;
DILocation *CurrentDIL = Current->getDebugLoc();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23212.66978.patch
Type: text/x-patch
Size: 2444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160805/cae69101/attachment.bin>
More information about the llvm-commits
mailing list