summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index e5993f51e4d..7e89492f1c6 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -755,6 +755,9 @@ void CodeGenPGO::valueProfile(CGBuilderTy &Builder, uint32_t ValueKind,
if (!ValuePtr || !ValueSite || !Builder.GetInsertBlock())
return;
+ if (isa<llvm::Constant>(ValuePtr))
+ return;
+
bool InstrumentValueSites = CGM.getCodeGenOpts().hasProfileClangInstr();
if (InstrumentValueSites && RegionCounterMap) {
auto BuilderInsertPoint = Builder.saveIP();
OpenPOWER on IntegriCloud