summaryrefslogtreecommitdiff
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-02-05 18:38:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-02-05 18:38:58 +0000
commite79719ce607b6130e41e23dbdc90cc6b4e0401e6 (patch)
tree47bb93fafd9582425ebb778ec77002c222f64ed4 /lib/Target/X86
parent3edec5c15a78e4abba7eb9102fef3891c84ebdfb (diff)
Notes
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/X86DiscriminateMemOps.cpp11
-rw-r--r--lib/Target/X86/X86InsertPrefetch.cpp3
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/Target/X86/X86DiscriminateMemOps.cpp b/lib/Target/X86/X86DiscriminateMemOps.cpp
index 3654bf04f4e98..6bee20b617dde 100644
--- a/lib/Target/X86/X86DiscriminateMemOps.cpp
+++ b/lib/Target/X86/X86DiscriminateMemOps.cpp
@@ -27,6 +27,14 @@ using namespace llvm;
#define DEBUG_TYPE "x86-discriminate-memops"
+static cl::opt<bool> EnableDiscriminateMemops(
+ DEBUG_TYPE, cl::init(false),
+ cl::desc("Generate unique debug info for each instruction with a memory "
+ "operand. Should be enabled for profile-drived cache prefetching, "
+ "both in the build of the binary being profiled, as well as in "
+ "the build of the binary consuming the profile."),
+ cl::Hidden);
+
namespace {
using Location = std::pair<StringRef, unsigned>;
@@ -67,6 +75,9 @@ char X86DiscriminateMemOps::ID = 0;
X86DiscriminateMemOps::X86DiscriminateMemOps() : MachineFunctionPass(ID) {}
bool X86DiscriminateMemOps::runOnMachineFunction(MachineFunction &MF) {
+ if (!EnableDiscriminateMemops)
+ return false;
+
DISubprogram *FDI = MF.getFunction().getSubprogram();
if (!FDI || !FDI->getUnit()->getDebugInfoForProfiling())
return false;
diff --git a/lib/Target/X86/X86InsertPrefetch.cpp b/lib/Target/X86/X86InsertPrefetch.cpp
index 30b46a09ef0f9..8bd57aa2278ba 100644
--- a/lib/Target/X86/X86InsertPrefetch.cpp
+++ b/lib/Target/X86/X86InsertPrefetch.cpp
@@ -34,7 +34,8 @@ using namespace sampleprof;
static cl::opt<std::string>
PrefetchHintsFile("prefetch-hints-file",
- cl::desc("Path to the prefetch hints profile."),
+ cl::desc("Path to the prefetch hints profile. See also "
+ "-x86-discriminate-memops"),
cl::Hidden);
namespace {