summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2019-11-11 10:59:36 -0800
committerHiroshi Yamauchi <yamauchi@google.com>2019-11-21 14:16:00 -0800
commit52e377497ddc3aa7178d4fd4c0cda096df4d8a72 (patch)
tree86b84d9ff3012c4c5984b748c99650babd8aabcb /llvm/utils/TableGen
parent844d97f650a2d716e63e3be903c32a82f2f817b1 (diff)
downloadbcm5719-llvm-52e377497ddc3aa7178d4fd4c0cda096df4d8a72.tar.gz
bcm5719-llvm-52e377497ddc3aa7178d4fd4c0cda096df4d8a72.zip
[PGO][PGSO] DAG.shouldOptForSize part.
Summary: (Split of off D67120) SelectionDAG::shouldOptForSize changes for profile guided size optimization. Reviewers: davidxl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70095
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/GlobalISelEmitter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index fdac5ba90bb..895aa8ab65a 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -5129,6 +5129,14 @@ void GlobalISelEmitter::run(raw_ostream &OS) {
SubtargetFeatureInfo::emitComputeAvailableFeatures(
Target.getName(), "InstructionSelector", "computeAvailableModuleFeatures",
ModuleFeatures, OS);
+
+ if (Target.getName() == "X86" || Target.getName() == "AArch64") {
+ // TODO: Implement PGSO.
+ OS << "static bool shouldOptForSize(const MachineFunction *MF) {\n";
+ OS << " return MF->getFunction().hasOptSize();\n";
+ OS << "}\n\n";
+ }
+
SubtargetFeatureInfo::emitComputeAvailableFeatures(
Target.getName(), "InstructionSelector",
"computeAvailableFunctionFeatures", FunctionFeatures, OS,
OpenPOWER on IntegriCloud