diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 47485737ab8..c68de4a0115 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -22,7 +22,7 @@ #include "llvm/Transforms/IPO.h" #include "llvm/CallGraphSCCPass.h" #include "llvm/GlobalVariable.h" -#include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/CaptureTracking.h" #include "llvm/ADT/SmallSet.h" @@ -137,6 +137,10 @@ bool FunctionAttrs::AddReadAttrs(const std::vector &SCC) { continue; } + // Ignore dbg info intrinsics. + if (isa(I)) + continue; + // Any remaining instructions need to be taken seriously! Check if they // read or write memory. if (I->mayWriteToMemory())