Skip to content

Commit

Permalink
Do not assign new discriminator for all intrinsics.
Browse files Browse the repository at this point in the history
Summary: We do not care about intrinsic calls when assigning discriminators.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23212

llvm-svn: 277843
  • Loading branch information
danielcdh committed Aug 5, 2016
1 parent 628d6b5 commit 17c6afc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Utils/AddDiscriminators.cpp
Expand Up @@ -184,7 +184,7 @@ static bool addDiscriminators(Function &F) {
// 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)
Expand Down Expand Up @@ -222,7 +222,7 @@ static bool addDiscriminators(Function &F) {
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();
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/Transforms/AddDiscriminators/call.ll
Expand Up @@ -12,6 +12,10 @@
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
Expand All @@ -20,6 +24,8 @@ define void @_Z3foov() #0 !dbg !4 {
}

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" }
Expand Down

0 comments on commit 17c6afc

Please sign in to comment.